From 272bed17d9c697b972a552c60003f2a350c285c9 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 12 Nov 2020 16:19:23 +0100 Subject: [PATCH] Style popup menu scroll bar --- app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java | 3 ++- app/src/main/res/drawable/scroll_thumb_popup.xml | 5 +++++ app/src/main/res/drawable/scroll_track_popup.xml | 5 +++++ app/src/main/res/values/styles.xml | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/scroll_thumb_popup.xml create mode 100644 app/src/main/res/drawable/scroll_track_popup.xml diff --git a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java index 7b006d97a8..5a7adc41ab 100644 --- a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java +++ b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java @@ -25,6 +25,7 @@ import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.view.ContextThemeWrapper; import androidx.appcompat.widget.PopupMenu; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleObserver; @@ -34,7 +35,7 @@ import androidx.lifecycle.OnLifecycleEvent; public class PopupMenuLifecycle extends PopupMenu implements LifecycleObserver { public PopupMenuLifecycle(@NonNull Context context, LifecycleOwner owner, @NonNull View anchor) { - super(context, anchor); + super(new ContextThemeWrapper(context, R.style.popupMenuStyle), anchor); Log.i("Instantiate " + this); owner.getLifecycle().addObserver(this); diff --git a/app/src/main/res/drawable/scroll_thumb_popup.xml b/app/src/main/res/drawable/scroll_thumb_popup.xml new file mode 100644 index 0000000000..5c0bd046dd --- /dev/null +++ b/app/src/main/res/drawable/scroll_thumb_popup.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/scroll_track_popup.xml b/app/src/main/res/drawable/scroll_track_popup.xml new file mode 100644 index 0000000000..449f5693cc --- /dev/null +++ b/app/src/main/res/drawable/scroll_track_popup.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c8a2fa31a6..f6cf85aadb 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -444,4 +444,10 @@ @style/TextAppearance.AppCompat.Small ?android:attr/textColorSecondary + +