AppCompat ToolBar popupTheme not used when multi selection active

醉酒当歌 提交于 2019-12-07 12:45:28

Its Menu -ActionMode you see your default OptionsMenu popUp background is the white, and the default contextual Menu for your app is the Yellow in your case. When you enter into multi-selection a ActionMode is triggered to handle the itemClick and what have you, and since you know how CAB works.

if you want to maintain the same white background in your setMultiChoiceModeListener override onPrepareActionMode(ActionMode mode, Menu menu) and use getCustomView().setBackgroundColor(Color.White);

Edit: addressing comment

This is what i mean in your onPrePareActionMode()

@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
    //the mode parameter is your CAB, so call that on it
    mode.getCustomView().setBackgroundColor(Color.White);
}

Hope its helpful

Can you Try editing you style with this property, selectableItemBackground

  <style name="ToolbarOverflowMenuStyle" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:backgroundTint">@color/white</item>
<item name="selectableItemBackground">?android:selectableItemBackground</item></style>

Had a similar problem with SwitchCompat and the solution was in one of the properties itself. Also this blog helped a lot . http://blog.mohitkanwal.com/blog/2015/03/07/styling-material-toolbar-in-android/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!