Skip to content

Commit

Permalink
getIdentifier for category name
Browse files Browse the repository at this point in the history
  • Loading branch information
maltaisn committed Feb 26, 2019
1 parent 81f35ab commit 07e7613
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ org.gradle.jvmargs=-Xmx3g
org.gradle.parallel=true

# When set to true the Gradle daemon is used to run the build. For local developer builds this is our favorite property.
# The developer environment is o
# ptimized for speed and feedback so we nearly always run Gradle jobs with the daemon.
# The developer environment is optimized for speed and feedback so we nearly always run Gradle jobs with the daemon.
org.gradle.daemon=true

android.useAndroidX=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,15 @@ private synchronized void loadIcons(@XmlRes int xmlFile, boolean append) {
String idStr = parser.getAttributeValue(null, XML_ATTR_ID);
String nameStr = parser.getAttributeValue(null, XML_ATTR_NAME);
int id = Integer.valueOf(idStr);
int resId = (nameStr == null ? 0 : Integer.valueOf(nameStr.substring(1)));
int resId = 0;
if (nameStr != null) {
if (nameStr.startsWith("@string/")) {
resId = context.getResources().getIdentifier(
nameStr.substring(8), "string", context.getPackageName());
} else {
resId = Integer.valueOf(nameStr.substring(1));
}
}

category = categories.get(id);
if (category == null) {
Expand Down

0 comments on commit 07e7613

Please sign in to comment.