mirror of
https://github.com/alesimula/Murine-launcher.git
synced 2026-10-28 09:43:42 +00:00
ICONLOADER - fix monochrome icon crash for ClockDrawableWrapper
This commit is contained in:
1 parent
43cb328886
commit
c6bc1d733f
1 file changed
+5
@@ -255,6 +255,11 @@ public class ClockDrawableWrapper extends CustomAdaptiveIconDrawable implements
|
||||
result.hourLayerIndex = hourLayerIndex;
|
||||
result.minuteLayerIndex = minuteLayerIndex;
|
||||
result.secondLayerIndex = secondLayerIndex;
|
||||
// The monochrome layer can have fewer layers than the colored one (e.g. no second hand)
|
||||
int layerCount = ((LayerDrawable) ((AdaptiveIconDrawable) icon).getForeground()).getNumberOfLayers();
|
||||
if (result.hourLayerIndex >= layerCount) result.hourLayerIndex = INVALID_VALUE;
|
||||
if (result.minuteLayerIndex >= layerCount) result.minuteLayerIndex = INVALID_VALUE;
|
||||
if (result.secondLayerIndex >= layerCount) result.secondLayerIndex = INVALID_VALUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user