OSDN Git Service

Fix animating quick settings tiles
authorJason Monk <jmonk@google.com>
Wed, 2 Dec 2015 16:30:36 +0000 (11:30 -0500)
committerJason Monk <jmonk@google.com>
Wed, 2 Dec 2015 16:30:36 +0000 (11:30 -0500)
Bug: 25835488
Change-Id: Id9757dd2ae05c73a8b06d3bf9e8b3a2cb8296437

packages/SystemUI/src/com/android/systemui/qs/QSTileView.java
packages/SystemUI/src/com/android/systemui/qs/tiles/CustomTile.java

index f32cfdc..4cc2b8d 100644 (file)
@@ -222,7 +222,6 @@ public class QSTileView extends QSTileBaseView {
         final ImageView icon = new ImageView(mContext);
         icon.setId(android.R.id.icon);
         icon.setScaleType(ScaleType.CENTER_INSIDE);
-        icon.setImageTintList(ColorStateList.valueOf(getContext().getColor(android.R.color.white)));
         return icon;
     }
 
index b0d885a..d26e8d6 100644 (file)
@@ -23,6 +23,7 @@ import android.content.Intent;
 import android.content.ServiceConnection;
 import android.content.pm.PackageManager;
 import android.content.pm.ServiceInfo;
+import android.graphics.drawable.Drawable;
 import android.os.IBinder;
 import android.os.UserHandle;
 import android.service.quicksettings.IQSTileService;
@@ -132,7 +133,9 @@ public class CustomTile extends QSTile<QSTile.State> {
     @Override
     protected void handleUpdateState(State state, Object arg) {
         state.visible = true;
-        state.icon = new DrawableIcon(mTile.getIcon().loadDrawable(mContext));
+        Drawable drawable = mTile.getIcon().loadDrawable(mContext);
+        drawable.setTint(mContext.getColor(android.R.color.white));
+        state.icon = new DrawableIcon(drawable);
         state.label = mTile.getLabel();
         if (mTile.getContentDescription() != null) {
             state.contentDescription = mTile.getContentDescription();