summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/lockclock/misc/IconUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyanogenmod/lockclock/misc/IconUtils.java')
-rw-r--r--src/com/cyanogenmod/lockclock/misc/IconUtils.java12
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());
}