summaryrefslogtreecommitdiffhomepage
path: root/app/src
diff options
context:
space:
mode:
authorHarsh Shandilya <harsh@prjkt.io>2018-07-18 10:28:57 +0530
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-20 03:17:49 +0200
commitc78c5276b38ceff35cc1447d8b3833802b1299dc (patch)
tree2b6170a0cc01f2557b838e61a477fbfb8b64c6b9 /app/src
parent497ec129040bf5a721dae20ec971a14402c29f52 (diff)
TunnelListFragment: Allocate interpolators outside scroll listener
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
Diffstat (limited to 'app/src')
-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();
}
});