TunnelListFragment: Dejank action mode title
When unselecting items, the toolbar briefly says '0 items selected' before it reverts back to the non-action mode toolbar which feels janky at best. To mitigate this, just set a blank title to the action mode toolbar when item count is 0, to facilitate the smoothness of the transition to non-action mode toolbar. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
af814951f3
commit
d5df0c10ab
@ -343,7 +343,11 @@ public class TunnelListFragment extends BaseFragment {
|
|||||||
|
|
||||||
private void updateTitle(final ActionMode mode) {
|
private void updateTitle(final ActionMode mode) {
|
||||||
final int count = (int) getCheckedPositions().count();
|
final int count = (int) getCheckedPositions().count();
|
||||||
mode.setTitle(resources.getQuantityString(R.plurals.delete_title, count, count));
|
if (count == 0) {
|
||||||
|
mode.setTitle("");
|
||||||
|
} else {
|
||||||
|
mode.setTitle(resources.getQuantityString(R.plurals.delete_title, count, count));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user