Revert "Fix reaction overlay not showing on first try in RTL mode."

This reverts commit 424979d91f.
fork-5.53.8
Cody Henthorne 2021-02-13 19:50:32 -05:00
rodzic d924fc92ab
commit eba04eb75b
1 zmienionych plików z 21 dodań i 36 usunięć

Wyświetl plik

@ -144,41 +144,6 @@ public final class ConversationReactionOverlay extends RelativeLayout {
maskView.setTargetParentTranslationY(translationY);
}
private OnLayoutChangeListener createUpdateViewPositionsOnLayoutChangeListener(@NonNull View maskTarget,
int maskPaddingBottom,
@NonNull PointF lastSeenDownPoint)
{
return new OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
final float scrubberTranslationY = Math.max(-scrubberDistanceFromTouchDown + actionBarHeight,
lastSeenDownPoint.y - scrubberHeight - scrubberDistanceFromTouchDown - statusBarHeight);
final float halfWidth = scrubberWidth / 2f + scrubberHorizontalMargin;
final float screenWidth = getResources().getDisplayMetrics().widthPixels;
final float downX = ViewUtil.isLtr(ConversationReactionOverlay.this) ? lastSeenDownPoint.x : screenWidth - lastSeenDownPoint.x;
final float scrubberTranslationX = Util.clamp(downX - halfWidth,
scrubberHorizontalMargin,
screenWidth + scrubberHorizontalMargin - halfWidth * 2) * (ViewUtil.isLtr(ConversationReactionOverlay.this) ? 1 : -1);
backgroundView.setTranslationX(scrubberTranslationX);
backgroundView.setTranslationY(scrubberTranslationY);
foregroundView.setTranslationX(scrubberTranslationX);
foregroundView.setTranslationY(scrubberTranslationY);
verticalScrubBoundary.update(lastSeenDownPoint.y - distanceFromTouchDownPointToTopOfScrubberDeadZone,
lastSeenDownPoint.y + distanceFromTouchDownPointToBottomOfScrubberDeadZone);
maskView.setPadding(0, 0, 0, maskPaddingBottom);
maskView.setTarget(maskTarget);
removeOnLayoutChangeListener(this);
}
};
}
public void show(@NonNull Activity activity,
@NonNull View maskTarget,
@NonNull Recipient conversationRecipient,
@ -206,7 +171,27 @@ public final class ConversationReactionOverlay extends RelativeLayout {
statusBarHeight = ViewUtil.getStatusBarHeight(this);
}
addOnLayoutChangeListener(createUpdateViewPositionsOnLayoutChangeListener(maskTarget, maskPaddingBottom, lastSeenDownPoint));
final float scrubberTranslationY = Math.max(-scrubberDistanceFromTouchDown + actionBarHeight,
lastSeenDownPoint.y - scrubberHeight - scrubberDistanceFromTouchDown - statusBarHeight);
final float halfWidth = scrubberWidth / 2f + scrubberHorizontalMargin;
final float screenWidth = getResources().getDisplayMetrics().widthPixels;
final float downX = ViewUtil.isLtr(this) ? lastSeenDownPoint.x : screenWidth - lastSeenDownPoint.x;
final float scrubberTranslationX = Util.clamp(downX - halfWidth,
scrubberHorizontalMargin,
screenWidth + scrubberHorizontalMargin - halfWidth * 2) * (ViewUtil.isLtr(this) ? 1 : -1);
backgroundView.setTranslationX(scrubberTranslationX);
backgroundView.setTranslationY(scrubberTranslationY);
foregroundView.setTranslationX(scrubberTranslationX);
foregroundView.setTranslationY(scrubberTranslationY);
verticalScrubBoundary.update(lastSeenDownPoint.y - distanceFromTouchDownPointToTopOfScrubberDeadZone,
lastSeenDownPoint.y + distanceFromTouchDownPointToBottomOfScrubberDeadZone);
maskView.setPadding(0, 0, 0, maskPaddingBottom);
maskView.setTarget(maskTarget);
hideAnimatorSet.end();
toolbar.setVisibility(VISIBLE);