From d5df0c10abcd7cd6215d6c83bf175ff22d25104d Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 1 Jun 2018 17:45:37 +0530 Subject: 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 --- .../java/com/wireguard/android/fragment/TunnelListFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/com/wireguard/android') diff --git a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java index 1138796d..4ad36a94 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -343,7 +343,11 @@ public class TunnelListFragment extends BaseFragment { private void updateTitle(final ActionMode mode) { 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)); + } } } -- cgit v1.2.3