alexandroid/decompiled/jadx/sources/com/google/android/material/bottomsheet/InsetsAnimationCallback.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

61 lines
2.4 KiB
Java

package com.google.android.material.bottomsheet;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.core.view.WindowInsetsAnimationCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.android.material.animation.AnimationUtils;
import java.util.Iterator;
import java.util.List;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes7.dex */
class InsetsAnimationCallback extends WindowInsetsAnimationCompat.Callback {
private int startTranslationY;
private int startY;
private final int[] tmpLocation;
private final View view;
public InsetsAnimationCallback(View view) {
super(0);
this.tmpLocation = new int[2];
this.view = view;
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Callback
public void onEnd(@NonNull WindowInsetsAnimationCompat windowInsetsAnimationCompat) {
this.view.setTranslationY(0.0f);
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Callback
public void onPrepare(@NonNull WindowInsetsAnimationCompat windowInsetsAnimationCompat) {
this.view.getLocationOnScreen(this.tmpLocation);
this.startY = this.tmpLocation[1];
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Callback
@NonNull
public WindowInsetsCompat onProgress(@NonNull WindowInsetsCompat windowInsetsCompat, @NonNull List<WindowInsetsAnimationCompat> list) {
Iterator<WindowInsetsAnimationCompat> it2 = list.iterator();
while (true) {
if (!it2.hasNext()) {
break;
}
if ((it2.next().getTypeMask() & WindowInsetsCompat.Type.ime()) != 0) {
this.view.setTranslationY(AnimationUtils.lerp(this.startTranslationY, 0, r0.getInterpolatedFraction()));
break;
}
}
return windowInsetsCompat;
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Callback
@NonNull
public WindowInsetsAnimationCompat.BoundsCompat onStart(@NonNull WindowInsetsAnimationCompat windowInsetsAnimationCompat, @NonNull WindowInsetsAnimationCompat.BoundsCompat boundsCompat) {
this.view.getLocationOnScreen(this.tmpLocation);
int i = this.startY - this.tmpLocation[1];
this.startTranslationY = i;
this.view.setTranslationY(i);
return boundsCompat;
}
}