Loading packages/SystemUI/res/color/tint_color_selector.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:alpha="0.25" android:color="?android:attr/colorForeground"/> <item android:state_activated="false" android:alpha="0.3" android:color="?android:attr/colorForeground"/> <item android:color="?android:attr/colorForeground"/> </selector> No newline at end of file packages/SystemUI/res/drawable/ic_hotspot_unavailable.xml +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ android:width="48dp" android:viewportHeight="48" android:viewportWidth="48" android:tint="@color/qs_tile_tint_unavailable" > android:alpha="0.25" android:tint="?android:attr/colorControlNormal" > <group android:name="ic_hotspot" android:translateX="23.97354" Loading packages/SystemUI/res/values/colors.xml +0 −4 Original line number Diff line number Diff line Loading @@ -144,10 +144,6 @@ <color name="remote_input_accent">#eeeeee</color> <color name="qs_tile_tint_unavailable">#40ffffff</color> <color name="qs_tile_tint_inactive">#4dffffff</color> <color name="qs_tile_tint_active">#ffffffff</color> <!-- Keyboard shortcuts colors --> <color name="ksh_application_group_color">#fff44336</color> <color name="ksh_keyword_color">#d9000000</color> Loading packages/SystemUI/src/com/android/systemui/BatteryMeterDrawable.java +6 −0 Original line number Diff line number Diff line Loading @@ -491,6 +491,12 @@ public class BatteryMeterDrawable extends Drawable implements @Override public void setColorFilter(@Nullable ColorFilter colorFilter) { mFramePaint.setColorFilter(colorFilter); mBatteryPaint.setColorFilter(colorFilter); mWarningTextPaint.setColorFilter(colorFilter); mTextPaint.setColorFilter(colorFilter); mBoltPaint.setColorFilter(colorFilter); mPlusPaint.setColorFilter(colorFilter); } @Override Loading packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java +4 −19 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ */ package com.android.systemui.qs.external; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; Loading @@ -24,7 +27,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Binder; import android.os.IBinder; Loading @@ -37,19 +39,14 @@ import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; import android.util.Log; import android.view.IWindowManager; import android.view.WindowManager; import android.view.WindowManagerGlobal; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.systemui.R; import com.android.systemui.qs.QSTile; import com.android.systemui.qs.external.TileLifecycleManager.TileChangeListener; import com.android.systemui.statusbar.phone.QSTileHost; import libcore.util.Objects; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG; public class CustomTile extends QSTile<QSTile.State> implements TileChangeListener { public static final String PREFIX = "custom("; Loading Loading @@ -301,7 +298,7 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen tileState = Tile.STATE_UNAVAILABLE; drawable = mDefaultIcon.loadDrawable(mAppContext); } int color = mContext.getColor(getColor(tileState)); final int color = TileColorPicker.getInstance(mContext).getColor(tileState); drawable.setTint(color); state.icon = mHasRes ? new DrawableIconWithRes(drawable, icon.getResId()) : new DrawableIcon(drawable); Loading Loading @@ -335,18 +332,6 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen }); } private static int getColor(int state) { switch (state) { case Tile.STATE_UNAVAILABLE: return R.color.qs_tile_tint_unavailable; case Tile.STATE_INACTIVE: return R.color.qs_tile_tint_inactive; case Tile.STATE_ACTIVE: return R.color.qs_tile_tint_active; } return 0; } public static String toSpec(ComponentName name) { return PREFIX + name.flattenToShortString() + ")"; } Loading Loading
packages/SystemUI/res/color/tint_color_selector.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2016 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:alpha="0.25" android:color="?android:attr/colorForeground"/> <item android:state_activated="false" android:alpha="0.3" android:color="?android:attr/colorForeground"/> <item android:color="?android:attr/colorForeground"/> </selector> No newline at end of file
packages/SystemUI/res/drawable/ic_hotspot_unavailable.xml +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ android:width="48dp" android:viewportHeight="48" android:viewportWidth="48" android:tint="@color/qs_tile_tint_unavailable" > android:alpha="0.25" android:tint="?android:attr/colorControlNormal" > <group android:name="ic_hotspot" android:translateX="23.97354" Loading
packages/SystemUI/res/values/colors.xml +0 −4 Original line number Diff line number Diff line Loading @@ -144,10 +144,6 @@ <color name="remote_input_accent">#eeeeee</color> <color name="qs_tile_tint_unavailable">#40ffffff</color> <color name="qs_tile_tint_inactive">#4dffffff</color> <color name="qs_tile_tint_active">#ffffffff</color> <!-- Keyboard shortcuts colors --> <color name="ksh_application_group_color">#fff44336</color> <color name="ksh_keyword_color">#d9000000</color> Loading
packages/SystemUI/src/com/android/systemui/BatteryMeterDrawable.java +6 −0 Original line number Diff line number Diff line Loading @@ -491,6 +491,12 @@ public class BatteryMeterDrawable extends Drawable implements @Override public void setColorFilter(@Nullable ColorFilter colorFilter) { mFramePaint.setColorFilter(colorFilter); mBatteryPaint.setColorFilter(colorFilter); mWarningTextPaint.setColorFilter(colorFilter); mTextPaint.setColorFilter(colorFilter); mBoltPaint.setColorFilter(colorFilter); mPlusPaint.setColorFilter(colorFilter); } @Override Loading
packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java +4 −19 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ */ package com.android.systemui.qs.external; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; Loading @@ -24,7 +27,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Binder; import android.os.IBinder; Loading @@ -37,19 +39,14 @@ import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; import android.util.Log; import android.view.IWindowManager; import android.view.WindowManager; import android.view.WindowManagerGlobal; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.systemui.R; import com.android.systemui.qs.QSTile; import com.android.systemui.qs.external.TileLifecycleManager.TileChangeListener; import com.android.systemui.statusbar.phone.QSTileHost; import libcore.util.Objects; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_QS_DIALOG; public class CustomTile extends QSTile<QSTile.State> implements TileChangeListener { public static final String PREFIX = "custom("; Loading Loading @@ -301,7 +298,7 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen tileState = Tile.STATE_UNAVAILABLE; drawable = mDefaultIcon.loadDrawable(mAppContext); } int color = mContext.getColor(getColor(tileState)); final int color = TileColorPicker.getInstance(mContext).getColor(tileState); drawable.setTint(color); state.icon = mHasRes ? new DrawableIconWithRes(drawable, icon.getResId()) : new DrawableIcon(drawable); Loading Loading @@ -335,18 +332,6 @@ public class CustomTile extends QSTile<QSTile.State> implements TileChangeListen }); } private static int getColor(int state) { switch (state) { case Tile.STATE_UNAVAILABLE: return R.color.qs_tile_tint_unavailable; case Tile.STATE_INACTIVE: return R.color.qs_tile_tint_inactive; case Tile.STATE_ACTIVE: return R.color.qs_tile_tint_active; } return 0; } public static String toSpec(ComponentName name) { return PREFIX + name.flattenToShortString() + ")"; } Loading