Skip to content

Commit af148d6

Browse files
committed
Merge branch 'release/v1.6.1'
2 parents b9ed1e5 + 98de2bc commit af148d6

File tree

8 files changed

+33
-39
lines changed

8 files changed

+33
-39
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The Android-Iconics Library is pushed to [Maven Central], so you just need to ad
2626

2727
```gradle
2828
dependencies {
29-
compile 'com.mikepenz:iconics:1.6.0@aar'
29+
compile 'com.mikepenz:iconics:1.6.1@aar'
3030
}
3131
```
3232

@@ -35,7 +35,7 @@ Provide your own font without the additional icons
3535

3636
```gradle
3737
dependencies {
38-
compile 'com.mikepenz:iconics-core:1.6.0@aar'
38+
compile 'com.mikepenz:iconics-core:1.6.1@aar'
3939
}
4040
```
4141

@@ -131,7 +131,7 @@ Just add the dependency of any and as many typface-library-addons in your build.
131131

132132
```javascript
133133
dependencies {
134-
compile 'com.mikepenz:iconics:1.6.0@aar'
134+
compile 'com.mikepenz:iconics:1.6.1@aar'
135135
compile 'com.mikepenz:octicons-typeface:2.2.1@aar'
136136
compile 'com.mikepenz:meteocons-typeface:1.1.2@aar'
137137
compile 'com.mikepenz:community-material-typeface:1.1.71@aar'

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 152
16-
versionName "1.5.2"
15+
versionCode 161
16+
versionName "1.6.1"
1717
enforceUniquePackageName false
1818
}
1919

library-core/build.gradle

+2-2
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 160
11-
versionName "1.6.0"
10+
versionCode 161
11+
versionName "1.6.1"
1212
}
1313
buildTypes {
1414
release {

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.6.0
36-
VERSION_CODE=160
35+
VERSION_NAME=1.6.1
36+
VERSION_CODE=161
3737

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

library-core/src/main/java/com/mikepenz/iconics/utils/GenericsUtil.java

+18-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.mikepenz.iconics.utils;
22

33
import android.content.Context;
4+
import android.text.TextUtils;
45

56
import java.lang.reflect.Field;
67
import java.util.ArrayList;
@@ -10,15 +11,16 @@
1011
*/
1112
public class GenericsUtil {
1213

14+
/**
15+
* a helper to get the string fields from the R class
16+
*
17+
* @param ctx
18+
* @return
19+
*/
1320
public static String[] getFields(Context ctx) {
14-
Class rClass = resolveRClass(ctx.getPackageName());
15-
16-
if (rClass != null) {
17-
for (Class c : rClass.getClasses()) {
18-
if (c.getName().endsWith("string")) {
19-
return getDefinedFonts(ctx, c.getFields());
20-
}
21-
}
21+
Class rStringClass = resolveRClass(ctx.getPackageName());
22+
if (rStringClass != null) {
23+
return getDefinedFonts(ctx, rStringClass.getFields());
2224
}
2325
return new String[0];
2426
}
@@ -30,25 +32,17 @@ public static String[] getFields(Context ctx) {
3032
* @return
3133
*/
3234
private static Class resolveRClass(String packageName) {
33-
try {
34-
return Class.forName(packageName + ".R");
35-
} catch (ClassNotFoundException e) {
36-
e.printStackTrace();
37-
}
38-
try {
39-
return Class.forName(packageName.replace(".debug", "") + ".R");
40-
} catch (ClassNotFoundException e) {
41-
e.printStackTrace();
42-
}
43-
try {
44-
return Class.forName(packageName.replace(".release", "") + ".R");
45-
} catch (ClassNotFoundException e) {
46-
e.printStackTrace();
47-
}
35+
do {
36+
try {
37+
return Class.forName(packageName + ".R$string");
38+
} catch (ClassNotFoundException e) {
39+
packageName = packageName.contains(".") ? packageName.substring(0, packageName.lastIndexOf('.')) : "";
40+
}
41+
} while (!TextUtils.isEmpty(packageName));
42+
4843
return null;
4944
}
5045

51-
5246
/**
5347
* A helper method to get a String[] out of a fieldArray
5448
*

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Android-Iconics is a library to use (almost) any alternative icon-font in your projects. It allows you to add any Android-Iconics compatible typeface-library-addon to your project and you are able to start using that font.
2828
]]>
2929
</string>
30-
<string name="library_AndroidIconics_libraryVersion">1.5.2</string>
30+
<string name="library_AndroidIconics_libraryVersion">1.6.1</string>
3131
<string name="library_AndroidIconics_libraryWebsite">https://github.com/mikepenz/Android-Iconics</string>
3232
<string name="library_AndroidIconics_licenseId">apache_2_0</string>
3333
<string name="library_AndroidIconics_isOpenSource">true</string>

library/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 160
11-
versionName "1.6.0"
10+
versionCode 161
11+
versionName "1.6.1"
1212
}
1313
buildTypes {
1414
release {
@@ -25,5 +25,5 @@ if (project.hasProperty('pushall') || project.hasProperty('libraryonly')) {
2525
}
2626

2727
dependencies {
28-
compile "com.mikepenz:iconics-core:1.6.0"
28+
compile "com.mikepenz:iconics-core:1.6.1"
2929
}

library/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.6.0
36-
VERSION_CODE=160
35+
VERSION_NAME=1.6.1
36+
VERSION_CODE=161
3737

3838
POM_NAME=Android-Iconics Library
3939
POM_ARTIFACT_ID=iconics

0 commit comments

Comments
 (0)