summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2018-07-18 10:28:57 +0530
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-20 03:17:49 +0200
commitb1d1e3b43678579b805bf65b0bb43e9f940dab50 (patch)
tree2b6170a0cc01f2557b838e61a477fbfb8b64c6b9
parentd33e322b67043e86c1033c55f67b6339e0d66ed8 (diff)
TunnelListFragment: Allocate interpolators outside scroll listener
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r--app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java7
1 files changed, 5 insertions, 2 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 96716849..5fc782ac 100644
--- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
+++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java
@@ -6,6 +6,7 @@
package com.wireguard.android.fragment;
+import android.animation.TimeInterpolator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ContentResolver;
@@ -61,6 +62,8 @@ import java9.util.stream.StreamSupport;
public class TunnelListFragment extends BaseFragment {
private static final int REQUEST_IMPORT = 1;
private static final String TAG = "WireGuard/" + TunnelListFragment.class.getSimpleName();
+ private static final TimeInterpolator FAB_SHOW_ANIMATION = new DecelerateInterpolator(2);
+ private static final TimeInterpolator FAB_HIDE_ANIMATION = new AccelerateInterpolator(2);
private final ActionModeListener actionModeListener = new ActionModeListener();
@Nullable private ActionMode actionMode;
@@ -198,7 +201,7 @@ public class TunnelListFragment extends BaseFragment {
public void show() {
binding.createMenu.animate()
.translationY(0)
- .setInterpolator(new DecelerateInterpolator(2))
+ .setInterpolator(FAB_SHOW_ANIMATION)
.start();
}
@@ -206,7 +209,7 @@ public class TunnelListFragment extends BaseFragment {
public void hide() {
binding.createMenu.animate()
.translationY(binding.createMenu.getHeight() + getResources().getDimension(R.dimen.fab_margin))
- .setInterpolator(new AccelerateInterpolator(2))
+ .setInterpolator(FAB_HIDE_ANIMATION)
.start();
}
});