discord-jadx/app/src/main/java/com/discord/widgets/chat/input/gifpicker/ViewScalingOnTouchListener....

45 lines
1.9 KiB
Java

package com.discord.widgets.chat.input.gifpicker;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.MotionEvent;
import android.view.View;
import d0.z.d.m;
/* compiled from: ViewScalingOnTouchListener.kt */
public final class ViewScalingOnTouchListener implements View.OnTouchListener {
private final float scaledownFactor;
public ViewScalingOnTouchListener(float f) {
this.scaledownFactor = f;
}
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
m.checkNotNullParameter(view, "view");
m.checkNotNullParameter(motionEvent, "event");
int action = motionEvent.getAction();
if (action == 0) {
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(view, "scaleX", this.scaledownFactor);
ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(view, "scaleY", this.scaledownFactor);
m.checkNotNullExpressionValue(ofFloat, "scaleDownX");
ofFloat.setDuration(200L);
m.checkNotNullExpressionValue(ofFloat2, "scaleDownY");
ofFloat2.setDuration(200L);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ofFloat).with(ofFloat2);
animatorSet.start();
} else if (action == 1 || action == 3) {
ObjectAnimator ofFloat3 = ObjectAnimator.ofFloat(view, "scaleX", 1.0f);
ObjectAnimator ofFloat4 = ObjectAnimator.ofFloat(view, "scaleY", 1.0f);
m.checkNotNullExpressionValue(ofFloat3, "scaleUpX");
ofFloat3.setDuration(200L);
m.checkNotNullExpressionValue(ofFloat4, "scaleUpY");
ofFloat4.setDuration(200L);
AnimatorSet animatorSet2 = new AnimatorSet();
animatorSet2.play(ofFloat3).with(ofFloat4);
animatorSet2.start();
}
return false;
}
}