I have a android.View.ContextMenu, which pops up after clicking an item in a recyclerview. It looks like this:
My problem is, that I don't know how to change the color of the header (here: 12345678) and the divider.
I tried to create a PopupMenuStyle, but I'm only able to change the items, not the header. I use Theme.AppCompat.Light.DarkActionBar as a parent for my theming
EDIT 1:
With this I can set the headertextcolor to primary text color, but the divider still stays blue, regardless of which items I add.
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
...
</style>
EDIT 2:
Context Menu-creation
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
MenuInflater inflater = getActivity().getMenuInflater();
inflater.inflate(R.menu.my_menu, menu);
menu.setHeaderTitle("12345678");
}
Styling
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" parent="@style/AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:alertDialogTheme">@style/AppCompatAlertDialogStyle</item>
</style>
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<!-- I tried a lot here, but nothing works -->
</style>