From 7166f7b7aafa1170e92c5c38445964ccd2e9cbc3 Mon Sep 17 00:00:00 2001 From: DrDisagree Date: Thu, 7 Sep 2023 15:48:24 +0600 Subject: [PATCH] Media Player: Change UI to material 3 style --- .../iconify/ui/activities/MediaPlayer.java | 6 +- .../main/res/layout/activity_media_player.xml | 152 ++++++++++-------- 2 files changed, 92 insertions(+), 66 deletions(-) diff --git a/app/src/main/java/com/drdisagree/iconify/ui/activities/MediaPlayer.java b/app/src/main/java/com/drdisagree/iconify/ui/activities/MediaPlayer.java index 5fdfbcbbf..a56cd6179 100644 --- a/app/src/main/java/com/drdisagree/iconify/ui/activities/MediaPlayer.java +++ b/app/src/main/java/com/drdisagree/iconify/ui/activities/MediaPlayer.java @@ -25,7 +25,6 @@ protected void onCreate(Bundle savedInstanceState) { refreshPreview(); binding.mpAccent.setChecked(Prefs.getBoolean("IconifyComponentMPA.overlay")); - binding.mpAccent.setOnCheckedChangeListener((buttonView, isChecked) -> { if (isChecked) { binding.mpSystem.setChecked(false); @@ -36,9 +35,9 @@ protected void onCreate(Bundle savedInstanceState) { } refreshPreview(); }); + binding.mpAccentContainer.setOnClickListener(v -> binding.mpAccent.toggle()); binding.mpSystem.setChecked(Prefs.getBoolean("IconifyComponentMPS.overlay")); - binding.mpSystem.setOnCheckedChangeListener((buttonView, isChecked) -> { if (isChecked) { binding.mpAccent.setChecked(false); @@ -49,9 +48,9 @@ protected void onCreate(Bundle savedInstanceState) { } refreshPreview(); }); + binding.mpSystemContainer.setOnClickListener(v -> binding.mpSystem.toggle()); binding.mpPitchBlack.setChecked(Prefs.getBoolean("IconifyComponentMPB.overlay")); - binding.mpPitchBlack.setOnCheckedChangeListener((buttonView, isChecked) -> { if (isChecked) { binding.mpAccent.setChecked(false); @@ -62,6 +61,7 @@ protected void onCreate(Bundle savedInstanceState) { } refreshPreview(); }); + binding.mpPitchBlackContainer.setOnClickListener(v -> binding.mpPitchBlack.toggle()); } private void refreshPreview() { diff --git a/app/src/main/res/layout/activity_media_player.xml b/app/src/main/res/layout/activity_media_player.xml index 6433501c7..39a455a69 100644 --- a/app/src/main/res/layout/activity_media_player.xml +++ b/app/src/main/res/layout/activity_media_player.xml @@ -38,118 +38,144 @@ layout="@layout/view_media_player_preview_system" android:visibility="gone" /> - + + + android:background="@drawable/item_background_material" + android:clickable="true"> + android:layout_centerVertical="true" + android:layout_marginVertical="22dp" + android:layout_marginStart="24dp" + android:layout_marginEnd="10dp" + android:layout_toStartOf="@id/mp_accent" + android:orientation="vertical"> - - - + android:layout_height="wrap_content" + android:text="Make background follow accent" + android:textColor="@color/text_color_secondary" /> - + + + + + + android:layout_centerVertical="true" + android:layout_marginVertical="22dp" + android:layout_marginStart="24dp" + android:layout_marginEnd="10dp" + android:layout_toStartOf="@id/mp_system" + android:orientation="vertical"> - - - + android:layout_height="wrap_content" + android:text="Make background follow system" + android:textColor="@color/text_color_secondary" /> - + + + + + + android:layout_centerVertical="true" + android:layout_marginVertical="22dp" + android:layout_marginStart="24dp" + android:layout_marginEnd="10dp" + android:layout_toStartOf="@id/mp_pitch_black" + android:orientation="vertical"> - - - + android:layout_height="wrap_content" + android:text="Make background pitch black" + android:textColor="@color/text_color_secondary" /> - + + + +