summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard
diff options
context:
space:
mode:
authorHarsh Shandilya <harsh@prjkt.io>2018-06-01 17:45:37 +0530
committerHarsh Shandilya <harsh@prjkt.io>2018-06-01 18:42:20 +0530
commit235e1f8174fa18c54b8c80d6d22101f3bd126b54 (patch)
tree3a5670ae1379a7d75b917d4805b39e0e3444cb02 /app/src/main/java/com/wireguard
parent86d0db6c30a17c60db94823864071f748243b46b (diff)
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 <harsh@prjkt.io>
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r--app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java6
1 files changed, 5 insertions, 1 deletions
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));
+ }
}
}