Apparently, I missed the built-in CAB function - the built-in overflow menu that destroys some action items when the screen is too small to show all of them.
Another manipulation that must be performed in order to always minimize certain actions in this overflow menu is to set for each of them:
android:showAsAction="never" app:showAsAction="never"
So, let's say we have 3 actions (delete, selece_all, add) in the CAB, and we want two of them (select_all, add) to be always minimized in the built-in overflow menu, we will set this to CAB xml:
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:mm="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_delete" android:orderInCategory="100" mm:showAsAction="always" android:icon="@drawable/ic_action_delete" android:title="Delete"/> <item android:id="@+id/action_select" android:orderInCategory="200" android:showAsAction="never" mm:showAsAction="never" android:title="@string/select_all"/> <item android:id="@+id/action_add" android:orderInCategory="300" android:showAsAction="never" mm:showAsAction="never" android:title="@string/button_add"/>
source share