Merge "Add a property for Numpad Button text color"

This commit is contained in:
Youngjun Kwak
2021-08-13 16:12:13 +00:00
committed by Android (Google) Code Review
3 changed files with 8 additions and 6 deletions

View File

@@ -62,8 +62,8 @@
<item name="android:src">@drawable/ic_backspace_24dp</item>
</style>
<style name="NumPadKey.Enter">
<item name="android:colorControlNormal">?android:attr/textColorSecondary</item>
<item name="android:src">@drawable/ic_keyboard_tab_36dp</item>
<item name="android:colorControlNormal">?android:attr/textColorSecondary</item>
<item name="android:src">@drawable/ic_keyboard_tab_36dp</item>
</style>
<style name="Widget.TextView.NumPadKey.Klondike"
parent="@android:style/Widget.DeviceDefault.TextView">

View File

@@ -69,6 +69,9 @@
<!-- Shadows under the clock, date and other keyguard text fields -->
<color name="keyguard_shadow_color">#B2000000</color>
<!-- Color for the images in keyguard number pad buttons -->
<color name="keyguard_keypad_image_color">@android:color/background_light</color>
<!-- Color for rounded background for activated user in keyguard user switcher -->
<color name="kg_user_switcher_activated_background_color">#26000000</color>
<!-- Icon color for user avatars in keyguard user switcher -->

View File

@@ -26,7 +26,7 @@ import android.view.MotionEvent;
import androidx.annotation.Nullable;
import com.android.settingslib.Utils;
import com.android.systemui.R;
/**
* Similar to the {@link NumPadKey}, but displays an image.
@@ -92,8 +92,7 @@ public class NumPadButton extends AlphaOptimizedImageButton {
public void reloadColors() {
if (mAnimator != null) mAnimator.reloadColors(getContext());
int textColor = Utils.getColorAttrDefaultColor(getContext(),
android.R.attr.colorBackground);
((VectorDrawable) getDrawable()).setTintList(ColorStateList.valueOf(textColor));
int imageColor = getContext().getColor(R.color.keyguard_keypad_image_color);
((VectorDrawable) getDrawable()).setTintList(ColorStateList.valueOf(imageColor));
}
}