mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Style popup menu scroll bar
This commit is contained in:
parent
f748c3717c
commit
272bed17d9
4 changed files with 18 additions and 1 deletions
|
@ -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);
|
||||
|
|
5
app/src/main/res/drawable/scroll_thumb_popup.xml
Normal file
5
app/src/main/res/drawable/scroll_thumb_popup.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="?attr/colorAccent" />
|
||||
</shape>
|
5
app/src/main/res/drawable/scroll_track_popup.xml
Normal file
5
app/src/main/res/drawable/scroll_track_popup.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="?attr/colorSeparator" />
|
||||
</shape>
|
|
@ -444,4 +444,10 @@
|
|||
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Small</item>
|
||||
<item name="android:textColor">?android:attr/textColorSecondary</item>
|
||||
</style>
|
||||
|
||||
<style name="popupMenuStyle" parent="Base.Widget.AppCompat.PopupMenu">
|
||||
<item name="android:scrollbarSize">6dp</item>
|
||||
<item name="android:scrollbarThumbVertical">@drawable/scroll_thumb_popup</item>
|
||||
<item name="android:scrollbarTrackVertical">@drawable/scroll_track_popup</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue