diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-20 16:41:53 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-20 16:41:53 +0200 |
commit | d0d56f3a1b32b4ae5a60afa593e78032c0c93fed (patch) | |
tree | 2d072ab0adddef322c1e1ae00e65854d42bf6caa /app/src/main/java/com/wireguard/android/fragment | |
parent | fbf32a6c2940681117f022c3dd9703e5cf11659d (diff) |
fab: move in direct ratio to scroll
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/fragment')
-rw-r--r-- | app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java | 24 |
1 files changed, 2 insertions, 22 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 5fc782ac..352c71d7 100644 --- a/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java +++ b/app/src/main/java/com/wireguard/android/fragment/TunnelListFragment.java @@ -27,8 +27,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; -import android.view.animation.AccelerateInterpolator; -import android.view.animation.DecelerateInterpolator; import com.wireguard.android.Application; import com.wireguard.android.R; @@ -38,7 +36,7 @@ import com.wireguard.android.databinding.TunnelListFragmentBinding; import com.wireguard.android.databinding.TunnelListItemBinding; import com.wireguard.android.model.Tunnel; import com.wireguard.android.util.ExceptionLoggers; -import com.wireguard.android.widget.CustomRecyclerViewScrollListener; +import com.wireguard.android.widget.fab.FloatingActionsMenuRecyclerViewScrollListener; import com.wireguard.config.Config; import java.io.BufferedReader; @@ -62,8 +60,6 @@ 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; @@ -196,23 +192,7 @@ public class TunnelListFragment extends BaseFragment { } return false; }); - binding.tunnelList.setOnScrollListener(new CustomRecyclerViewScrollListener() { - @Override - public void show() { - binding.createMenu.animate() - .translationY(0) - .setInterpolator(FAB_SHOW_ANIMATION) - .start(); - } - - @Override - public void hide() { - binding.createMenu.animate() - .translationY(binding.createMenu.getHeight() + getResources().getDimension(R.dimen.fab_margin)) - .setInterpolator(FAB_HIDE_ANIMATION) - .start(); - } - }); + binding.tunnelList.setOnScrollListener(new FloatingActionsMenuRecyclerViewScrollListener(binding.createMenu)); binding.executePendingBindings(); return binding.getRoot(); } |