Skip to content

Commit 86467d2

Browse files
committed
Merge branch 'release/v1.7.9'
2 parents 366660b + d560ad7 commit 86467d2

File tree

9 files changed

+83
-14
lines changed

9 files changed

+83
-14
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Provide additional fonts for you project, or even create your custom font with j
4242
##1. Provide the gradle dependency
4343
```gradle
4444
dependencies {
45-
compile 'com.mikepenz:iconics-core:1.7.8@aar'
45+
compile 'com.mikepenz:iconics-core:1.7.9@aar'
4646
}
4747
```
4848

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ android {
1212
defaultConfig {
1313
minSdkVersion rootProject.ext.minSdkVersion
1414
targetSdkVersion rootProject.ext.targetSdkVersion
15-
versionCode 178
16-
versionName "1.7.8"
15+
versionCode 179
16+
versionName "1.7.9"
1717
enforceUniquePackageName false
1818
}
1919

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

+11
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

+10-2
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

library-core/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 18
11-
versionName "1.7.8"
10+
versionCode 19
11+
versionName "1.7.9"
1212
}
1313
buildTypes {
1414
release {
@@ -25,5 +25,5 @@ if (project.hasProperty('pushall') || project.hasProperty('librarycoreonly')) {
2525
}
2626

2727
dependencies {
28-
compile 'com.android.support:support-v4:23.1.0'
28+
compile 'com.android.support:appcompat-v7:23.1.0'
2929
}

library-core/gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
# This option should only be used with decoupled projects. More details, visit
3333
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
3434
# org.gradle.parallel=true
35-
VERSION_NAME=1.7.8
36-
VERSION_CODE=178
35+
VERSION_NAME=1.7.9
36+
VERSION_CODE=179
3737

3838
POM_NAME=Android-Iconics Library
3939
POM_ARTIFACT_ID=iconics-core

library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java

+13-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import android.graphics.ColorFilter;
4040
import android.graphics.Paint;
4141
import android.graphics.Path;
42-
import android.graphics.PixelFormat;
4342
import android.graphics.Rect;
4443
import android.graphics.RectF;
4544
import android.graphics.Typeface;
@@ -48,6 +47,7 @@
4847
import android.support.annotation.ColorRes;
4948
import android.support.annotation.DimenRes;
5049
import android.support.v4.content.ContextCompat;
50+
import android.text.TextPaint;
5151
import android.util.Log;
5252

5353
import com.mikepenz.iconics.typeface.IIcon;
@@ -131,7 +131,12 @@ protected IconicsDrawable(Context context, final ITypeface typeface, final IIcon
131131
}
132132

133133
private void prepare() {
134-
mIconPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
134+
mIconPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
135+
mIconPaint.setStyle(Paint.Style.FILL);
136+
mIconPaint.setTextAlign(Paint.Align.CENTER);
137+
mIconPaint.setUnderlineText(false);
138+
mIconPaint.setAntiAlias(true);
139+
135140
mBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
136141

137142
mContourPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@@ -776,7 +781,7 @@ public int getIntrinsicHeight() {
776781

777782
@Override
778783
public int getOpacity() {
779-
return PixelFormat.OPAQUE;
784+
return this.mAlpha;
780785
}
781786

782787

@@ -805,6 +810,11 @@ public void setColorFilter(ColorFilter cf) {
805810
mIconPaint.setColorFilter(cf);
806811
}
807812

813+
@Override
814+
public void clearColorFilter() {
815+
mIconPaint.setColorFilter(null);
816+
}
817+
808818
/**
809819
* Creates a BitMap to use in Widgets or anywhere else
810820
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.mikepenz.iconics.view;
2+
3+
import android.content.Context;
4+
import android.os.Build;
5+
import android.support.v7.widget.AppCompatButton;
6+
import android.util.AttributeSet;
7+
import android.widget.TextView;
8+
9+
import com.mikepenz.iconics.Iconics;
10+
11+
public class IconicsCompatButton extends AppCompatButton {
12+
13+
public IconicsCompatButton(Context context) {
14+
super(context);
15+
}
16+
17+
public IconicsCompatButton(Context context, AttributeSet attrs) {
18+
super(context, attrs);
19+
}
20+
21+
public IconicsCompatButton(Context context, AttributeSet attrs, int defStyle) {
22+
super(context, attrs, defStyle);
23+
}
24+
25+
@Override
26+
public void setText(CharSequence text, TextView.BufferType type) {
27+
// NOTES:
28+
// 1. Need to disable the All Caps option to make Spannable work properly!
29+
// 2. This method will be called from the constructor of the super class
30+
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
31+
setAllCaps(false);
32+
}
33+
34+
if (!isInEditMode()) {
35+
super.setText(new Iconics.IconicsBuilder().ctx(getContext()).on(text).build(), type);
36+
} else {
37+
super.setText(text, type);
38+
}
39+
}
40+
}

library-core/src/main/res/values/library_androidiconics_strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
This library allows you to include vector icons everywhere in your project. No limits are given. Scale with no limit, use any Color at any time, provide a contour, and many additional customizations
2626
]]>
2727
</string>
28-
<string name="library_AndroidIconics_libraryVersion">1.7.8</string>
28+
<string name="library_AndroidIconics_libraryVersion">1.7.9</string>
2929
<string name="library_AndroidIconics_libraryWebsite">https://github.com/mikepenz/Android-Iconics</string>
3030
<string name="library_AndroidIconics_licenseId">apache_2_0</string>
3131
<string name="library_AndroidIconics_isOpenSource">true</string>

0 commit comments

Comments
 (0)