From 0ec51f5b34248320b05b92d16c31b503c6e60d4b Mon Sep 17 00:00:00 2001 From: sk Date: Mon, 19 Dec 2022 16:34:16 +0100 Subject: [PATCH] set pivot point once --- .../android/ui/displayitems/FooterStatusDisplayItem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java index 0c9e234e4..246c6996f 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FooterStatusDisplayItem.java @@ -132,8 +132,6 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{ private boolean onButtonTouch(View v, MotionEvent event){ int action = event.getAction(); - // 20dp to center in middle of icon, because: (icon width = 24dp) / 2 + (paddingStart = 8dp) - v.setPivotX(V.dp(20)); long eventDuration = event.getEventTime() - event.getDownTime(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { touchingView = null; @@ -143,6 +141,8 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{ else v.startAnimation(opacityIn); } else if (action == MotionEvent.ACTION_DOWN) { touchingView = v; + // 20dp to center in middle of icon, because: (icon width = 24dp) / 2 + (paddingStart = 8dp) + v.setPivotX(V.dp(20)); v.postDelayed(longClickRunnable, ViewConfiguration.getLongPressTimeout()); v.startAnimation(opacityOut); v.animate().scaleX(0.85f).scaleY(0.85f).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(75).start();