diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-07-10 19:44:50 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-07-10 19:44:50 -0700 |
commit | 1b915b3b2d422fe7b64814fdc4940d1f3206cf9c (patch) | |
tree | 23e29de72a942cd98ff5890da0a15b0cebd3e661 /app/src/main | |
parent | fef84ba6d5b222cb775bed4f1426fbcaa989863f (diff) | |
download | dsub-1b915b3b2d422fe7b64814fdc4940d1f3206cf9c.tar.gz dsub-1b915b3b2d422fe7b64814fdc4940d1f3206cf9c.tar.bz2 dsub-1b915b3b2d422fe7b64814fdc4940d1f3206cf9c.zip |
Fix ActionMode system bar
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java | 16 | ||||
-rw-r--r-- | app/src/main/res/values/themes.xml | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java index e8e2bc4a..629585b0 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java @@ -16,16 +16,21 @@ package github.daneren2005.dsub.adapter; import android.content.Context; +import android.content.res.Resources; +import android.os.Build; import android.support.v7.widget.PopupMenu; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; +import android.util.TypedValue; import android.view.ActionMode; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; import java.util.ArrayList; import java.util.Arrays; @@ -368,6 +373,17 @@ public abstract class SectionAdapter<T> extends RecyclerView.Adapter<UpdateViewH notifyDataSetChanged(); mode.setTitle(context.getResources().getString(R.string.select_album_n_selected, selected.size())); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + TypedValue typedValue = new TypedValue(); + Resources.Theme theme = context.getTheme(); + theme.resolveAttribute(R.attr.colorPrimaryDark, typedValue, true); + int colorPrimaryDark = typedValue.data; + + Window window = ((SubsonicFragmentActivity) context).getWindow(); + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + window.setStatusBarColor(colorPrimaryDark); + } return true; } diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 76f0250c..3307f32e 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -52,6 +52,7 @@ <item name="actionbarPopupStyle">@style/ThemeOverlay.AppCompat.Light</item> <item name="android:spinnerItemStyle">@style/DarkSpinnerItem</item> <item name="windowActionModeOverlay">true</item> + <item name="actionModeBackground">?attr/colorPrimary</item> </style> <style name="Theme.DSub.Dark.Base" parent="@style/Theme.AppCompat"> <item name="offline_icon">@drawable/main_offline_dark</item> |