Skip to content

Commit 6e2f185

Browse files
committed
* add new sample to playground activity
1 parent 5d02785 commit 6e2f185

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

app/src/main/java/com/mikepenz/iconics/sample/PlaygroundActivity.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import android.app.Activity;
2020
import android.content.Context;
2121
import android.graphics.Color;
22+
import android.graphics.drawable.StateListDrawable;
2223
import android.os.Bundle;
2324
import android.text.Spannable;
2425
import android.text.SpannableString;
@@ -32,6 +33,7 @@
3233
import android.view.ViewGroup;
3334
import android.widget.ArrayAdapter;
3435
import android.widget.Button;
36+
import android.widget.ImageButton;
3537
import android.widget.ImageView;
3638
import android.widget.ListView;
3739
import android.widget.TextView;
@@ -83,6 +85,15 @@ protected void onCreate(Bundle savedInstanceState) {
8385
.on(b4)
8486
.build();
8587

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+
8697
ListView listView = (ListView) findViewById(R.id.list);
8798

8899
IconicsDrawable iconicsDrawableBase = new IconicsDrawable(this).actionBar().color(Color.GREEN).backgroundColor(Color.RED);

app/src/main/res/layout/activity_playground.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,23 @@
192192
android:orientation="horizontal">
193193

194194
<com.mikepenz.iconics.view.IconicsButton
195-
android:layout_width="120dp"
195+
android:layout_width="0dp"
196196
android:layout_height="60dp"
197+
android:layout_weight="1"
197198
android:text="{faw-adjust} Button" />
198199

199200
<Button
200201
android:id="@+id/test4"
201-
android:layout_width="120dp"
202+
android:layout_width="0dp"
202203
android:layout_height="60dp"
204+
android:layout_weight="1"
203205
android:text="{gmd-poll} Button" />
206+
207+
<ImageButton
208+
android:id="@+id/test6"
209+
android:layout_width="0dp"
210+
android:layout_height="60dp"
211+
android:layout_weight="1" />
204212
</LinearLayout>
205213

206214

0 commit comments

Comments
 (0)