Skip to content

Commit d170fa7

Browse files
committed
fixed color transparincy not picked up in xml files
1 parent 5ea4d1b commit d170fa7

File tree

7 files changed

+40
-16
lines changed

7 files changed

+40
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You don't have to worry about android including the file twice in your apk. Andr
3030

3131
```groovy
3232
dependencies {
33-
compile 'net.steamcrafted:materialiconlib:1.0.8'
33+
compile 'net.steamcrafted:materialiconlib:1.0.9'
3434
}
3535
```
3636

app/app.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" />
7373
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/de.hdodenhof/circleimageview/2.0.0/jars" />
7474
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
75+
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
7576
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
7677
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
7778
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />

app/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ android {
1919
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020
}
2121
}
22+
23+
24+
25+
lintOptions {
26+
abortOnError false
27+
}
2228
}
2329

2430
dependencies {
2531
compile fileTree(dir: 'libs', include: ['*.jar'])
2632
compile 'com.android.support:appcompat-v7:22.2.0'
2733
compile 'de.hdodenhof:circleimageview:2.0.0'
2834
/*compile project(':materialiconlib')*/
29-
compile 'net.steamcrafted:materialiconlib:1.0.8'
35+
compile project(":materialiconlib")
3036
}

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

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,31 @@
7373

7474

7575

76-
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
77-
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
78-
xmlns:app="http://schemas.android.com/apk/res-auto"
79-
android:id="@+id/listview"
80-
android:numColumns="5"
81-
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
82-
android:paddingRight="@dimen/activity_horizontal_margin"
83-
android:paddingTop="@dimen/activity_vertical_margin"
84-
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"/>
76+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
77+
android:layout_width="match_parent"
78+
android:layout_height="match_parent">
79+
80+
<net.steamcrafted.materialiconlib.MaterialIconView
81+
xmlns:app="http://schemas.android.com/apk/res-auto"
82+
android:layout_width="match_parent"
83+
android:layout_height="96dp"
84+
app:materialIcon="file"
85+
app:materialIconColor="#3300FF00"
86+
87+
android:id="@+id/file_icon"
88+
android:background="#A0C"
89+
/>
90+
91+
<GridView
92+
android:layout_below="@+id/file_icon"
93+
xmlns:android="http://schemas.android.com/apk/res/android"
94+
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
95+
xmlns:app="http://schemas.android.com/apk/res-auto"
96+
android:id="@+id/listview"
97+
android:numColumns="5"
98+
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
99+
android:paddingRight="@dimen/activity_horizontal_margin"
100+
android:paddingTop="@dimen/activity_vertical_margin"
101+
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"/>
102+
</RelativeLayout>
85103

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ allprojects {
1616
repositories {
1717
jcenter()
1818
}
19-
}
19+
}

materialiconlib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'com.android.library'
44
ext {
55
PUBLISH_GROUP_ID = 'net.steamcrafted'
66
PUBLISH_ARTIFACT_ID = 'materialiconlib'
7-
PUBLISH_VERSION = '1.0.8'
7+
PUBLISH_VERSION = '1.0.9'
88
}
99

1010
android {

materialiconlib/src/main/java/net/steamcrafted/materialiconlib/MaterialDrawableBuilder.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ public MaterialDrawableBuilder setSizePx(int size) {
128128
*/
129129
public MaterialDrawableBuilder setColor(int color) {
130130
paint.setColor(color);
131-
if(Color.alpha(color) != 255){
132-
paint.setAlpha(Color.alpha(color));
133-
}
131+
setAlpha(Color.alpha(color));
134132
return this;
135133
}
136134

@@ -262,6 +260,7 @@ public void draw(Canvas canvas) {
262260
String textValue = MaterialIconUtils.getIconString(icon.ordinal());
263261
paint.getTextBounds(textValue, 0, 1, mCachedRect);
264262
float textBottom = (getBounds().height() - mCachedRect.height()) / 2f + mCachedRect.height() - mCachedRect.bottom;
263+
265264
canvas.drawText(textValue, getBounds().width() / 2f, textBottom, paint);
266265
}
267266

0 commit comments

Comments
 (0)