|
19 | 19 | import android.app.Activity; |
20 | 20 | import android.content.Context; |
21 | 21 | import android.graphics.Color; |
| 22 | +import android.graphics.drawable.StateListDrawable; |
22 | 23 | import android.os.Bundle; |
23 | 24 | import android.text.Spannable; |
24 | 25 | import android.text.SpannableString; |
|
32 | 33 | import android.view.ViewGroup; |
33 | 34 | import android.widget.ArrayAdapter; |
34 | 35 | import android.widget.Button; |
| 36 | +import android.widget.ImageButton; |
35 | 37 | import android.widget.ImageView; |
36 | 38 | import android.widget.ListView; |
37 | 39 | import android.widget.TextView; |
@@ -83,6 +85,15 @@ protected void onCreate(Bundle savedInstanceState) { |
83 | 85 | .on(b4) |
84 | 86 | .build(); |
85 | 87 |
|
| 88 | + |
| 89 | + //Show how to style the text of an existing button (NOT WORKING AT THE MOMENT) |
| 90 | + ImageButton b6 = (ImageButton) findViewById(R.id.test6); |
| 91 | + |
| 92 | + StateListDrawable iconStateListDrawable = new StateListDrawable(); |
| 93 | + iconStateListDrawable.addState(new int[]{android.R.attr.state_pressed}, new IconicsDrawable(this, FontAwesome.Icon.faw_thumbs_o_up).sizeDp(48).color(Color.parseColor("#aaFF0000")).contourWidthDp(1)); |
| 94 | + iconStateListDrawable.addState(new int[]{}, new IconicsDrawable(this, FontAwesome.Icon.faw_thumbs_o_up).sizeDp(48).color(Color.parseColor("#aa00FF00")).contourWidthDp(2)); |
| 95 | + b6.setImageDrawable(iconStateListDrawable); |
| 96 | + |
86 | 97 | ListView listView = (ListView) findViewById(R.id.list); |
87 | 98 |
|
88 | 99 | IconicsDrawable iconicsDrawableBase = new IconicsDrawable(this).actionBar().color(Color.GREEN).backgroundColor(Color.RED); |
|
0 commit comments