UPDATE
Same issue present in the latest Gmail app. I still don't understand why would Google make such unpleasant UI change. Obsessive in me goes crazy whenever I see it
QUESTION
I have this weird issue with appcompat-v7 23. Issue I am going to describe does not happen with 22 series
You can get source code that reproduces this issuse form
https://github.com/devserv/t/
Once built, you can tap and hold an item in the list to activate ActionMode
Issue:
When in ActionMode, appcompat turns status bar to black. This does not happen if I don’t use following
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
in my v21 style but I have to use it because I want my navigation drawer to look behind status bar.
I used to use following to avoid black status bar when ActionMode started and ended
public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.appColorPrimaryDark));
}
}
public void onDestroyActionMode(ActionMode actionMode) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getActivity().getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent));
}
mMode = null;
}
Above code did not create/avoided status bar turning black, but does not work properly on v23 of appcompat. Instead you see a short black status bar while ActionMode destroyed. It looks like related to the animation that plays when ActionMode destroyed.
I have tried to open bug reports but it has been declined with comment
Don't re-create bugs.
Am I missing something?
Here are the screenshots for normal and action mode.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…