aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2018-06-01 17:45:37 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2018-06-01 18:42:20 +0530
commitd5df0c10abcd7cd6215d6c83bf175ff22d25104d (patch)
tree3a5670ae1379a7d75b917d4805b39e0e3444cb02 /app/src/main
parentfab: Make label responsive to night mode (diff)
downloadwireguard-android-d5df0c10abcd7cd6215d6c83bf175ff22d25104d.tar.xz
wireguard-android-d5df0c10abcd7cd6215d6c83bf175ff22d25104d.zip
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>
Diffstat (limited to 'app/src/main')
-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));
+ }
}
}