From fe6228f26a83f13b27901383f4be7735792fe172 Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Wed, 14 Jun 2017 15:40:02 -0400 Subject: [PATCH] Fix null drawable for Mobile signal data edit QS tile Currently it's a funky situation with CellTileView. There should ultimate be a better way to handle displaying the SignalDrawable (per the TODO comments), but this is a sensible fix to show the mobile data icon in the edit QS screen for now. Test: visual Bug: 62525439 Change-Id: I95f0fb86862aa6a7b60f304053a73127907943ee --- .../src/com/android/systemui/qs/CellTileView.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java b/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java index eaf715ffc4c9e..5b3ec08ce7526 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/CellTileView.java @@ -35,9 +35,7 @@ public class CellTileView extends SignalTileView { public CellTileView(Context context) { super(context); mSignalDrawable = new SignalDrawable(mContext); - float dark = Utils.getColorAttr(context, android.R.attr.colorForeground) == 0xff000000 - ? 1 : 0; - mSignalDrawable.setDarkIntensity(dark); + mSignalDrawable.setDarkIntensity(isDark(mContext)); mSignalDrawable.setIntrinsicSize(context.getResources().getDimensionPixelSize( R.dimen.qs_tile_icon_size)); } @@ -50,6 +48,10 @@ public class CellTileView extends SignalTileView { } } + private static int isDark(Context context) { + return Utils.getColorAttr(context, android.R.attr.colorForeground) == 0xff000000 ? 1 : 0; + } + public static class SignalIcon extends Icon { private final int mState; @@ -64,7 +66,11 @@ public class CellTileView extends SignalTileView { @Override public Drawable getDrawable(Context context) { - return null; + //TODO: Not the optimal solution to create this drawable + SignalDrawable d = new SignalDrawable(context); + d.setDarkIntensity(isDark(context)); + d.setLevel(getState()); + return d; } } }