diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-12-13 02:17:59 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-12-13 02:17:59 +0100 |
commit | 37cccfb76ca994a5cf37b2248dce54e1b316ab03 (patch) | |
tree | e2febb55099517af31d436d0260f13a50d5f1a71 /src/com/cyanogenmod/lockclock/misc/IconUtils.java | |
parent | 1030b8578fa79c3b662d2806a370fbb83cc9a6a2 (diff) | |
parent | 5ad279bfaf041aea373051887babad8bc44e50c5 (diff) | |
download | packages_apps_LockClock-37cccfb76ca994a5cf37b2248dce54e1b316ab03.zip packages_apps_LockClock-37cccfb76ca994a5cf37b2248dce54e1b316ab03.tar.gz packages_apps_LockClock-37cccfb76ca994a5cf37b2248dce54e1b316ab03.tar.bz2 |
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_packages_apps_LockClock into replicant-6.0replicant-6.0-beta-0001replicant-6.0-alpha-0006
Diffstat (limited to 'src/com/cyanogenmod/lockclock/misc/IconUtils.java')
-rw-r--r-- | src/com/cyanogenmod/lockclock/misc/IconUtils.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/lockclock/misc/IconUtils.java b/src/com/cyanogenmod/lockclock/misc/IconUtils.java index 437d075..3a4f4d0 100644 --- a/src/com/cyanogenmod/lockclock/misc/IconUtils.java +++ b/src/com/cyanogenmod/lockclock/misc/IconUtils.java @@ -30,6 +30,7 @@ import android.graphics.drawable.Drawable; import android.util.DisplayMetrics; import android.util.Log; import com.cyanogenmod.lockclock.R; +import com.cyanogenmod.lockclock.weather.Utils; public class IconUtils { private static final String TAG = "IconUtils"; @@ -41,8 +42,9 @@ public class IconUtils { } final Resources res = context.getResources(); - final int resId = res.getIdentifier("weather_" + iconSet + "_" + conditionCode, - "drawable", context.getPackageName()); + final int resId = res.getIdentifier("weather_" + iconSet + "_" + + Utils.addOffsetToConditionCodeFromWeatherContract(conditionCode), "drawable", + context.getPackageName()); if (resId != 0) { return resId; @@ -62,12 +64,13 @@ public class IconUtils { boolean isMonoSet = Constants.MONOCHROME.equals(iconSet); Resources res = null; int resId = 0; + int fixedConditionCode = Utils.addOffsetToConditionCodeFromWeatherContract(conditionCode); if (iconSet.startsWith("ext:")) { String packageName = iconSet.substring(4); try { res = context.getPackageManager().getResourcesForApplication(packageName); - resId = res.getIdentifier("weather_" + conditionCode, "drawable", packageName); + resId = res.getIdentifier("weather_" + fixedConditionCode, "drawable", packageName); } catch (PackageManager.NameNotFoundException e) { // fall back to colored icons iconSet = Constants.COLOR_STD; @@ -75,7 +78,8 @@ public class IconUtils { } if (resId == 0) { String identifier = isMonoSet - ? "weather_" + conditionCode : "weather_" + iconSet + "_" + conditionCode; + ? "weather_" + fixedConditionCode : "weather_" + + iconSet + "_" + fixedConditionCode; res = context.getResources(); resId = res.getIdentifier(identifier, "drawable", context.getPackageName()); } |