diff options
author | Michael W <baddaemon87@gmail.com> | 2022-02-23 18:26:53 +0100 |
---|---|---|
committer | Michael W <baddaemon87@gmail.com> | 2022-04-18 10:02:59 +0200 |
commit | 23d7064d1abf2feb41d3d1a1812038a26e836181 (patch) | |
tree | fbaa16cf9a6a2cdb6948c111185b6073d12287e9 /src/com/android/deskclock/settings/SimpleMenuPreference.java | |
parent | a997c68c843843e79bf79fed3eee7728ebf1e643 (diff) |
DeskClock: Material Me? No YOU!
* Since Android 12 introduced a new style, try to mimic it for this app
* Due to AndroidX and the support libraries still being old, we have to,
like Settings does with SettingsLib, create our own styles in the
desired looks
* Also adjust the color scheme to reflect Material You
* We deviated from AOSP already quite a bit, so we don't need to really
care about the change's footprint
* Clean up behind us by removing (now unused) resources and includes in
files that were modified anyways (and adjust order while on it)
* Copy CollapsibleToolbarBaseActivity and required resources from
SettingsLib - that way we can mimic the style easily without having
to move this app to system_ext or using privileged_api
* Since we always use dark layout, modify slightly so it works for us
* Remove things we don't need so we don't have to copy too many files
from SettingsLib
Change-Id: I4c81e03c71f468a9e468426a8233ad96059cb05d
Diffstat (limited to 'src/com/android/deskclock/settings/SimpleMenuPreference.java')
-rw-r--r-- | src/com/android/deskclock/settings/SimpleMenuPreference.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/deskclock/settings/SimpleMenuPreference.java b/src/com/android/deskclock/settings/SimpleMenuPreference.java index 579ad578e..faead0f0f 100644 --- a/src/com/android/deskclock/settings/SimpleMenuPreference.java +++ b/src/com/android/deskclock/settings/SimpleMenuPreference.java @@ -24,6 +24,7 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; +import android.widget.TextView; import com.android.deskclock.R; import com.android.deskclock.Utils; @@ -133,9 +134,9 @@ public class SimpleMenuPreference extends DropDownPreference { public View getDropDownView(int position, View convertView, @NonNull ViewGroup parent) { final View view = super.getDropDownView(position, convertView, parent); if (position == 0) { - view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white_08p)); - } else { - view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.transparent)); + view.setBackgroundResource(R.drawable.popup_background_selected); + TextView tv = (TextView) view; + tv.setTextColor(getContext().getColor(R.color.black)); } return view; } |