I have a recycler view and when user long clicks an item, I begin an action mode with beginActionMode
and later finish the action mode when selection is done.
PROBLEM
Is when the action mode is finished and it hides its tool bar, I show mine in onDestroyActionMode
but the view jerks down then up.
How can I smoothly hide the action mode tool bar then show the action bar without the view jerk.
Note
In beginActionMode
the view does not jerk, it only does so when closing action mode.
here is beginActionMode
private boolean beginActionMode () {
if (fActionMode == null) {
fSwipeRefereshLayout.setEnabled (false);
fActionMode = startSupportActionMode (this);
// I hide the action bar here
getSupportActionBar ().hide ();
fSelectingItems = true;
fSelectedItems.clear ();
return true;
}
fActionMode.invalidate ();
return false;
}
and onDestroyActionMode
@Override
public void onDestroyActionMode (ActionMode am) {
fActionMode = null;
fSelectingItems = false;
selectAll ();
fTabLayout.setClickable (true);
// I show action bar here
getSupportActionBar ().show ();
fSwipeRefereshLayout.setEnabled (true);
}