Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,442 @@
package androidx.core.widget;
import android.content.res.Resources;
import android.os.SystemClock;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat;
/* loaded from: classes.dex */
public abstract class AutoScrollHelper implements View.OnTouchListener {
private static final int DEFAULT_ACTIVATION_DELAY = ViewConfiguration.getTapTimeout();
private static final int DEFAULT_EDGE_TYPE = 1;
private static final float DEFAULT_MAXIMUM_EDGE = Float.MAX_VALUE;
private static final int DEFAULT_MAXIMUM_VELOCITY_DIPS = 1575;
private static final int DEFAULT_MINIMUM_VELOCITY_DIPS = 315;
private static final int DEFAULT_RAMP_DOWN_DURATION = 500;
private static final int DEFAULT_RAMP_UP_DURATION = 500;
private static final float DEFAULT_RELATIVE_EDGE = 0.2f;
private static final float DEFAULT_RELATIVE_VELOCITY = 1.0f;
public static final int EDGE_TYPE_INSIDE = 0;
public static final int EDGE_TYPE_INSIDE_EXTEND = 1;
public static final int EDGE_TYPE_OUTSIDE = 2;
private static final int HORIZONTAL = 0;
public static final float NO_MAX = Float.MAX_VALUE;
public static final float NO_MIN = 0.0f;
public static final float RELATIVE_UNSPECIFIED = 0.0f;
private static final int VERTICAL = 1;
private int mActivationDelay;
private boolean mAlreadyDelayed;
boolean mAnimating;
private int mEdgeType;
private boolean mEnabled;
private boolean mExclusive;
boolean mNeedsCancel;
boolean mNeedsReset;
private Runnable mRunnable;
final View mTarget;
final ClampedScroller mScroller = new ClampedScroller();
private final Interpolator mEdgeInterpolator = new AccelerateInterpolator();
private float[] mRelativeEdges = {0.0f, 0.0f};
private float[] mMaximumEdges = {Float.MAX_VALUE, Float.MAX_VALUE};
private float[] mRelativeVelocity = {0.0f, 0.0f};
private float[] mMinimumVelocity = {0.0f, 0.0f};
private float[] mMaximumVelocity = {Float.MAX_VALUE, Float.MAX_VALUE};
public static float constrain(float f, float f2, float f3) {
return f > f3 ? f3 : f < f2 ? f2 : f;
}
public static int constrain(int i, int i2, int i3) {
return i > i3 ? i3 : i < i2 ? i2 : i;
}
private float constrainEdgeValue(float f, float f2) {
if (f2 == 0.0f) {
return 0.0f;
}
int i = this.mEdgeType;
if (i == 0 || i == 1) {
if (f < f2) {
if (f >= 0.0f) {
return DEFAULT_RELATIVE_VELOCITY - (f / f2);
}
if (this.mAnimating && i == 1) {
return DEFAULT_RELATIVE_VELOCITY;
}
}
} else if (i == 2 && f < 0.0f) {
return f / (-f2);
}
return 0.0f;
}
public abstract boolean canTargetScrollHorizontally(int i);
public abstract boolean canTargetScrollVertically(int i);
public boolean isEnabled() {
return this.mEnabled;
}
public boolean isExclusive() {
return this.mExclusive;
}
public abstract void scrollTargetBy(int i, int i2);
@NonNull
public AutoScrollHelper setActivationDelay(int i) {
this.mActivationDelay = i;
return this;
}
@NonNull
public AutoScrollHelper setEdgeType(int i) {
this.mEdgeType = i;
return this;
}
public AutoScrollHelper setExclusive(boolean z) {
this.mExclusive = z;
return this;
}
public AutoScrollHelper(@NonNull View view) {
this.mTarget = view;
float f = Resources.getSystem().getDisplayMetrics().density;
float f2 = (int) ((1575.0f * f) + 0.5f);
setMaximumVelocity(f2, f2);
float f3 = (int) ((f * 315.0f) + 0.5f);
setMinimumVelocity(f3, f3);
setEdgeType(1);
setMaximumEdges(Float.MAX_VALUE, Float.MAX_VALUE);
setRelativeEdges(DEFAULT_RELATIVE_EDGE, DEFAULT_RELATIVE_EDGE);
setRelativeVelocity(DEFAULT_RELATIVE_VELOCITY, DEFAULT_RELATIVE_VELOCITY);
setActivationDelay(DEFAULT_ACTIVATION_DELAY);
setRampUpDuration(500);
setRampDownDuration(500);
}
public AutoScrollHelper setEnabled(boolean z) {
if (this.mEnabled && !z) {
requestStop();
}
this.mEnabled = z;
return this;
}
@NonNull
public AutoScrollHelper setMaximumVelocity(float f, float f2) {
float[] fArr = this.mMaximumVelocity;
fArr[0] = f / 1000.0f;
fArr[1] = f2 / 1000.0f;
return this;
}
@NonNull
public AutoScrollHelper setMinimumVelocity(float f, float f2) {
float[] fArr = this.mMinimumVelocity;
fArr[0] = f / 1000.0f;
fArr[1] = f2 / 1000.0f;
return this;
}
@NonNull
public AutoScrollHelper setRelativeVelocity(float f, float f2) {
float[] fArr = this.mRelativeVelocity;
fArr[0] = f / 1000.0f;
fArr[1] = f2 / 1000.0f;
return this;
}
@NonNull
public AutoScrollHelper setRelativeEdges(float f, float f2) {
float[] fArr = this.mRelativeEdges;
fArr[0] = f;
fArr[1] = f2;
return this;
}
@NonNull
public AutoScrollHelper setMaximumEdges(float f, float f2) {
float[] fArr = this.mMaximumEdges;
fArr[0] = f;
fArr[1] = f2;
return this;
}
@NonNull
public AutoScrollHelper setRampUpDuration(int i) {
this.mScroller.setRampUpDuration(i);
return this;
}
@NonNull
public AutoScrollHelper setRampDownDuration(int i) {
this.mScroller.setRampDownDuration(i);
return this;
}
/* JADX WARN: Code restructure failed: missing block: B:11:0x0013, code lost:
if (r0 != 3) goto L20;
*/
@Override // android.view.View.OnTouchListener
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public boolean onTouch(android.view.View r6, android.view.MotionEvent r7) {
/*
r5 = this;
boolean r0 = r5.mEnabled
r1 = 0
if (r0 != 0) goto L6
return r1
L6:
int r0 = r7.getActionMasked()
r2 = 1
if (r0 == 0) goto L1a
if (r0 == r2) goto L16
r3 = 2
if (r0 == r3) goto L1e
r6 = 3
if (r0 == r6) goto L16
goto L58
L16:
r5.requestStop()
goto L58
L1a:
r5.mNeedsCancel = r2
r5.mAlreadyDelayed = r1
L1e:
float r0 = r7.getX()
int r3 = r6.getWidth()
float r3 = (float) r3
android.view.View r4 = r5.mTarget
int r4 = r4.getWidth()
float r4 = (float) r4
float r0 = r5.computeTargetVelocity(r1, r0, r3, r4)
float r7 = r7.getY()
int r6 = r6.getHeight()
float r6 = (float) r6
android.view.View r3 = r5.mTarget
int r3 = r3.getHeight()
float r3 = (float) r3
float r6 = r5.computeTargetVelocity(r2, r7, r6, r3)
androidx.core.widget.AutoScrollHelper$ClampedScroller r7 = r5.mScroller
r7.setTargetVelocity(r0, r6)
boolean r6 = r5.mAnimating
if (r6 != 0) goto L58
boolean r6 = r5.shouldAnimate()
if (r6 == 0) goto L58
r5.startAnimating()
L58:
boolean r6 = r5.mExclusive
if (r6 == 0) goto L61
boolean r6 = r5.mAnimating
if (r6 == 0) goto L61
r1 = r2
L61:
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.widget.AutoScrollHelper.onTouch(android.view.View, android.view.MotionEvent):boolean");
}
public boolean shouldAnimate() {
ClampedScroller clampedScroller = this.mScroller;
int verticalDirection = clampedScroller.getVerticalDirection();
int horizontalDirection = clampedScroller.getHorizontalDirection();
return (verticalDirection != 0 && canTargetScrollVertically(verticalDirection)) || (horizontalDirection != 0 && canTargetScrollHorizontally(horizontalDirection));
}
private void startAnimating() {
int i;
if (this.mRunnable == null) {
this.mRunnable = new ScrollAnimationRunnable();
}
this.mAnimating = true;
this.mNeedsReset = true;
if (!this.mAlreadyDelayed && (i = this.mActivationDelay) > 0) {
ViewCompat.postOnAnimationDelayed(this.mTarget, this.mRunnable, i);
} else {
this.mRunnable.run();
}
this.mAlreadyDelayed = true;
}
private void requestStop() {
if (this.mNeedsReset) {
this.mAnimating = false;
} else {
this.mScroller.requestStop();
}
}
private float computeTargetVelocity(int i, float f, float f2, float f3) {
float edgeValue = getEdgeValue(this.mRelativeEdges[i], f2, this.mMaximumEdges[i], f);
if (edgeValue == 0.0f) {
return 0.0f;
}
float f4 = this.mRelativeVelocity[i];
float f5 = this.mMinimumVelocity[i];
float f6 = this.mMaximumVelocity[i];
float f7 = f4 * f3;
if (edgeValue > 0.0f) {
return constrain(edgeValue * f7, f5, f6);
}
return -constrain((-edgeValue) * f7, f5, f6);
}
private float getEdgeValue(float f, float f2, float f3, float f4) {
float interpolation;
float constrain = constrain(f * f2, 0.0f, f3);
float constrainEdgeValue = constrainEdgeValue(f2 - f4, constrain) - constrainEdgeValue(f4, constrain);
if (constrainEdgeValue < 0.0f) {
interpolation = -this.mEdgeInterpolator.getInterpolation(-constrainEdgeValue);
} else {
if (constrainEdgeValue <= 0.0f) {
return 0.0f;
}
interpolation = this.mEdgeInterpolator.getInterpolation(constrainEdgeValue);
}
return constrain(interpolation, -1.0f, DEFAULT_RELATIVE_VELOCITY);
}
public void cancelTargetTouch() {
long uptimeMillis = SystemClock.uptimeMillis();
MotionEvent obtain = MotionEvent.obtain(uptimeMillis, uptimeMillis, 3, 0.0f, 0.0f, 0);
this.mTarget.onTouchEvent(obtain);
obtain.recycle();
}
public class ScrollAnimationRunnable implements Runnable {
public ScrollAnimationRunnable() {
}
@Override // java.lang.Runnable
public void run() {
AutoScrollHelper autoScrollHelper = AutoScrollHelper.this;
if (autoScrollHelper.mAnimating) {
if (autoScrollHelper.mNeedsReset) {
autoScrollHelper.mNeedsReset = false;
autoScrollHelper.mScroller.start();
}
ClampedScroller clampedScroller = AutoScrollHelper.this.mScroller;
if (clampedScroller.isFinished() || !AutoScrollHelper.this.shouldAnimate()) {
AutoScrollHelper.this.mAnimating = false;
return;
}
AutoScrollHelper autoScrollHelper2 = AutoScrollHelper.this;
if (autoScrollHelper2.mNeedsCancel) {
autoScrollHelper2.mNeedsCancel = false;
autoScrollHelper2.cancelTargetTouch();
}
clampedScroller.computeScrollDelta();
AutoScrollHelper.this.scrollTargetBy(clampedScroller.getDeltaX(), clampedScroller.getDeltaY());
ViewCompat.postOnAnimation(AutoScrollHelper.this.mTarget, this);
}
}
}
public static class ClampedScroller {
private int mEffectiveRampDown;
private int mRampDownDuration;
private int mRampUpDuration;
private float mStopValue;
private float mTargetVelocityX;
private float mTargetVelocityY;
private long mStartTime = Long.MIN_VALUE;
private long mStopTime = -1;
private long mDeltaTime = 0;
private int mDeltaX = 0;
private int mDeltaY = 0;
private float interpolateValue(float f) {
return ((-4.0f) * f * f) + (f * 4.0f);
}
public int getDeltaX() {
return this.mDeltaX;
}
public int getDeltaY() {
return this.mDeltaY;
}
public void setRampDownDuration(int i) {
this.mRampDownDuration = i;
}
public void setRampUpDuration(int i) {
this.mRampUpDuration = i;
}
public void setTargetVelocity(float f, float f2) {
this.mTargetVelocityX = f;
this.mTargetVelocityY = f2;
}
public void start() {
long currentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
this.mStartTime = currentAnimationTimeMillis;
this.mStopTime = -1L;
this.mDeltaTime = currentAnimationTimeMillis;
this.mStopValue = 0.5f;
this.mDeltaX = 0;
this.mDeltaY = 0;
}
public void requestStop() {
long currentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
this.mEffectiveRampDown = AutoScrollHelper.constrain((int) (currentAnimationTimeMillis - this.mStartTime), 0, this.mRampDownDuration);
this.mStopValue = getValueAt(currentAnimationTimeMillis);
this.mStopTime = currentAnimationTimeMillis;
}
public boolean isFinished() {
return this.mStopTime > 0 && AnimationUtils.currentAnimationTimeMillis() > this.mStopTime + ((long) this.mEffectiveRampDown);
}
private float getValueAt(long j) {
if (j < this.mStartTime) {
return 0.0f;
}
long j2 = this.mStopTime;
if (j2 < 0 || j < j2) {
return AutoScrollHelper.constrain((j - r0) / this.mRampUpDuration, 0.0f, AutoScrollHelper.DEFAULT_RELATIVE_VELOCITY) * 0.5f;
}
float f = this.mStopValue;
return (AutoScrollHelper.DEFAULT_RELATIVE_VELOCITY - f) + (f * AutoScrollHelper.constrain((j - j2) / this.mEffectiveRampDown, 0.0f, AutoScrollHelper.DEFAULT_RELATIVE_VELOCITY));
}
public void computeScrollDelta() {
if (this.mDeltaTime == 0) {
throw new RuntimeException("Cannot compute scroll delta before calling start()");
}
long currentAnimationTimeMillis = AnimationUtils.currentAnimationTimeMillis();
float interpolateValue = interpolateValue(getValueAt(currentAnimationTimeMillis));
long j = currentAnimationTimeMillis - this.mDeltaTime;
this.mDeltaTime = currentAnimationTimeMillis;
float f = j * interpolateValue;
this.mDeltaX = (int) (this.mTargetVelocityX * f);
this.mDeltaY = (int) (f * this.mTargetVelocityY);
}
public int getHorizontalDirection() {
float f = this.mTargetVelocityX;
return (int) (f / Math.abs(f));
}
public int getVerticalDirection() {
float f = this.mTargetVelocityY;
return (int) (f / Math.abs(f));
}
}
}

View File

@@ -0,0 +1,34 @@
package androidx.core.widget;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public interface AutoSizeableTextView {
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
@Deprecated
public static final boolean PLATFORM_SUPPORTS_AUTOSIZE;
static {
PLATFORM_SUPPORTS_AUTOSIZE = Build.VERSION.SDK_INT >= 27;
}
int getAutoSizeMaxTextSize();
int getAutoSizeMinTextSize();
int getAutoSizeStepGranularity();
int[] getAutoSizeTextAvailableSizes();
int getAutoSizeTextType();
void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) throws IllegalArgumentException;
void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[] iArr, int i) throws IllegalArgumentException;
void setAutoSizeTextTypeWithDefaults(int i);
}

View File

@@ -0,0 +1,65 @@
package androidx.core.widget;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.widget.CheckedTextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.ReplaceWith;
import androidx.annotation.RequiresApi;
/* loaded from: classes.dex */
public final class CheckedTextViewCompat {
private CheckedTextViewCompat() {
}
public static void setCheckMarkTintList(@NonNull CheckedTextView checkedTextView, @Nullable ColorStateList colorStateList) {
Api21Impl.setCheckMarkTintList(checkedTextView, colorStateList);
}
@Nullable
public static ColorStateList getCheckMarkTintList(@NonNull CheckedTextView checkedTextView) {
return Api21Impl.getCheckMarkTintList(checkedTextView);
}
public static void setCheckMarkTintMode(@NonNull CheckedTextView checkedTextView, @Nullable PorterDuff.Mode mode) {
Api21Impl.setCheckMarkTintMode(checkedTextView, mode);
}
@Nullable
public static PorterDuff.Mode getCheckMarkTintMode(@NonNull CheckedTextView checkedTextView) {
return Api21Impl.getCheckMarkTintMode(checkedTextView);
}
@Nullable
@ReplaceWith(expression = "textView.getCheckMarkDrawable()")
@Deprecated
public static Drawable getCheckMarkDrawable(@NonNull CheckedTextView checkedTextView) {
return checkedTextView.getCheckMarkDrawable();
}
@RequiresApi(21)
public static class Api21Impl {
private Api21Impl() {
}
public static void setCheckMarkTintList(@NonNull CheckedTextView checkedTextView, @Nullable ColorStateList colorStateList) {
checkedTextView.setCheckMarkTintList(colorStateList);
}
@Nullable
public static ColorStateList getCheckMarkTintList(@NonNull CheckedTextView checkedTextView) {
return checkedTextView.getCheckMarkTintList();
}
public static void setCheckMarkTintMode(@NonNull CheckedTextView checkedTextView, @Nullable PorterDuff.Mode mode) {
checkedTextView.setCheckMarkTintMode(mode);
}
@Nullable
public static PorterDuff.Mode getCheckMarkTintMode(@NonNull CheckedTextView checkedTextView) {
return checkedTextView.getCheckMarkTintMode();
}
}
}

View File

@@ -0,0 +1,75 @@
package androidx.core.widget;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.widget.CompoundButton;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import java.lang.reflect.Field;
/* loaded from: classes.dex */
public final class CompoundButtonCompat {
private static final String TAG = "CompoundButtonCompat";
private static Field sButtonDrawableField;
private static boolean sButtonDrawableFieldFetched;
private CompoundButtonCompat() {
}
public static void setButtonTintList(@NonNull CompoundButton compoundButton, @Nullable ColorStateList colorStateList) {
Api21Impl.setButtonTintList(compoundButton, colorStateList);
}
@Nullable
public static ColorStateList getButtonTintList(@NonNull CompoundButton compoundButton) {
return Api21Impl.getButtonTintList(compoundButton);
}
public static void setButtonTintMode(@NonNull CompoundButton compoundButton, @Nullable PorterDuff.Mode mode) {
Api21Impl.setButtonTintMode(compoundButton, mode);
}
@Nullable
public static PorterDuff.Mode getButtonTintMode(@NonNull CompoundButton compoundButton) {
return Api21Impl.getButtonTintMode(compoundButton);
}
@Nullable
public static Drawable getButtonDrawable(@NonNull CompoundButton compoundButton) {
return Api23Impl.getButtonDrawable(compoundButton);
}
@RequiresApi(21)
public static class Api21Impl {
private Api21Impl() {
}
public static void setButtonTintList(CompoundButton compoundButton, ColorStateList colorStateList) {
compoundButton.setButtonTintList(colorStateList);
}
public static ColorStateList getButtonTintList(CompoundButton compoundButton) {
return compoundButton.getButtonTintList();
}
public static void setButtonTintMode(CompoundButton compoundButton, PorterDuff.Mode mode) {
compoundButton.setButtonTintMode(mode);
}
public static PorterDuff.Mode getButtonTintMode(CompoundButton compoundButton) {
return compoundButton.getButtonTintMode();
}
}
@RequiresApi(23)
public static class Api23Impl {
private Api23Impl() {
}
public static Drawable getButtonDrawable(CompoundButton compoundButton) {
return compoundButton.getButtonDrawable();
}
}
}

View File

@@ -0,0 +1,130 @@
package androidx.core.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
/* loaded from: classes.dex */
public class ContentLoadingProgressBar extends ProgressBar {
private static final int MIN_DELAY_MS = 500;
private static final int MIN_SHOW_TIME_MS = 500;
private final Runnable mDelayedHide;
private final Runnable mDelayedShow;
boolean mDismissed;
boolean mPostedHide;
boolean mPostedShow;
long mStartTime;
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$new$0() {
this.mPostedHide = false;
this.mStartTime = -1L;
setVisibility(8);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$new$1() {
this.mPostedShow = false;
if (this.mDismissed) {
return;
}
this.mStartTime = System.currentTimeMillis();
setVisibility(0);
}
public ContentLoadingProgressBar(@NonNull Context context) {
this(context, null);
}
public ContentLoadingProgressBar(@NonNull Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet, 0);
this.mStartTime = -1L;
this.mPostedHide = false;
this.mPostedShow = false;
this.mDismissed = false;
this.mDelayedHide = new Runnable() { // from class: androidx.core.widget.ContentLoadingProgressBar$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
ContentLoadingProgressBar.this.lambda$new$0();
}
};
this.mDelayedShow = new Runnable() { // from class: androidx.core.widget.ContentLoadingProgressBar$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
ContentLoadingProgressBar.this.lambda$new$1();
}
};
}
@Override // android.widget.ProgressBar, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
removeCallbacks();
}
@Override // android.widget.ProgressBar, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
removeCallbacks();
}
private void removeCallbacks() {
removeCallbacks(this.mDelayedHide);
removeCallbacks(this.mDelayedShow);
}
public void hide() {
post(new Runnable() { // from class: androidx.core.widget.ContentLoadingProgressBar$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
ContentLoadingProgressBar.this.hideOnUiThread();
}
});
}
/* JADX INFO: Access modifiers changed from: private */
@UiThread
public void hideOnUiThread() {
this.mDismissed = true;
removeCallbacks(this.mDelayedShow);
this.mPostedShow = false;
long currentTimeMillis = System.currentTimeMillis();
long j = this.mStartTime;
long j2 = currentTimeMillis - j;
if (j2 >= 500 || j == -1) {
setVisibility(8);
} else {
if (this.mPostedHide) {
return;
}
postDelayed(this.mDelayedHide, 500 - j2);
this.mPostedHide = true;
}
}
public void show() {
post(new Runnable() { // from class: androidx.core.widget.ContentLoadingProgressBar$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
ContentLoadingProgressBar.this.showOnUiThread();
}
});
}
/* JADX INFO: Access modifiers changed from: private */
@UiThread
public void showOnUiThread() {
this.mStartTime = -1L;
this.mDismissed = false;
removeCallbacks(this.mDelayedHide);
this.mPostedHide = false;
if (this.mPostedShow) {
return;
}
postDelayed(this.mDelayedShow, 500L);
this.mPostedShow = true;
}
}

View File

@@ -0,0 +1,132 @@
package androidx.core.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.EdgeEffect;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
/* loaded from: classes.dex */
public final class EdgeEffectCompat {
private final EdgeEffect mEdgeEffect;
@Deprecated
public EdgeEffectCompat(Context context) {
this.mEdgeEffect = new EdgeEffect(context);
}
@NonNull
public static EdgeEffect create(@NonNull Context context, @Nullable AttributeSet attributeSet) {
if (Build.VERSION.SDK_INT >= 31) {
return Api31Impl.create(context, attributeSet);
}
return new EdgeEffect(context);
}
public static float getDistance(@NonNull EdgeEffect edgeEffect) {
if (Build.VERSION.SDK_INT >= 31) {
return Api31Impl.getDistance(edgeEffect);
}
return 0.0f;
}
@Deprecated
public void setSize(int i, int i2) {
this.mEdgeEffect.setSize(i, i2);
}
@Deprecated
public boolean isFinished() {
return this.mEdgeEffect.isFinished();
}
@Deprecated
public void finish() {
this.mEdgeEffect.finish();
}
@Deprecated
public boolean onPull(float f) {
this.mEdgeEffect.onPull(f);
return true;
}
@Deprecated
public boolean onPull(float f, float f2) {
onPull(this.mEdgeEffect, f, f2);
return true;
}
public static void onPull(@NonNull EdgeEffect edgeEffect, float f, float f2) {
Api21Impl.onPull(edgeEffect, f, f2);
}
public static float onPullDistance(@NonNull EdgeEffect edgeEffect, float f, float f2) {
if (Build.VERSION.SDK_INT >= 31) {
return Api31Impl.onPullDistance(edgeEffect, f, f2);
}
onPull(edgeEffect, f, f2);
return f;
}
@Deprecated
public boolean onRelease() {
this.mEdgeEffect.onRelease();
return this.mEdgeEffect.isFinished();
}
@Deprecated
public boolean onAbsorb(int i) {
this.mEdgeEffect.onAbsorb(i);
return true;
}
@Deprecated
public boolean draw(Canvas canvas) {
return this.mEdgeEffect.draw(canvas);
}
@RequiresApi(31)
public static class Api31Impl {
private Api31Impl() {
}
public static EdgeEffect create(Context context, AttributeSet attributeSet) {
try {
return new EdgeEffect(context, attributeSet);
} catch (Throwable unused) {
return new EdgeEffect(context);
}
}
public static float onPullDistance(EdgeEffect edgeEffect, float f, float f2) {
try {
return edgeEffect.onPullDistance(f, f2);
} catch (Throwable unused) {
edgeEffect.onPull(f, f2);
return 0.0f;
}
}
public static float getDistance(EdgeEffect edgeEffect) {
try {
return edgeEffect.getDistance();
} catch (Throwable unused) {
return 0.0f;
}
}
}
@RequiresApi(21)
public static class Api21Impl {
private Api21Impl() {
}
public static void onPull(EdgeEffect edgeEffect, float f, float f2) {
edgeEffect.onPull(f, f2);
}
}
}

View File

@@ -0,0 +1,54 @@
package androidx.core.widget;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
/* loaded from: classes.dex */
public class ImageViewCompat {
@Nullable
public static ColorStateList getImageTintList(@NonNull ImageView imageView) {
return Api21Impl.getImageTintList(imageView);
}
public static void setImageTintList(@NonNull ImageView imageView, @Nullable ColorStateList colorStateList) {
Api21Impl.setImageTintList(imageView, colorStateList);
}
@Nullable
public static PorterDuff.Mode getImageTintMode(@NonNull ImageView imageView) {
return Api21Impl.getImageTintMode(imageView);
}
public static void setImageTintMode(@NonNull ImageView imageView, @Nullable PorterDuff.Mode mode) {
Api21Impl.setImageTintMode(imageView, mode);
}
private ImageViewCompat() {
}
@RequiresApi(21)
public static class Api21Impl {
private Api21Impl() {
}
public static ColorStateList getImageTintList(ImageView imageView) {
return imageView.getImageTintList();
}
public static void setImageTintList(ImageView imageView, ColorStateList colorStateList) {
imageView.setImageTintList(colorStateList);
}
public static PorterDuff.Mode getImageTintMode(ImageView imageView) {
return imageView.getImageTintMode();
}
public static void setImageTintMode(ImageView imageView, PorterDuff.Mode mode) {
imageView.setImageTintMode(mode);
}
}
}

View File

@@ -0,0 +1,25 @@
package androidx.core.widget;
import android.view.View;
import android.widget.ListPopupWindow;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.ReplaceWith;
/* loaded from: classes.dex */
public final class ListPopupWindowCompat {
private ListPopupWindowCompat() {
}
@Deprecated
public static View.OnTouchListener createDragToOpenListener(Object obj, View view) {
return createDragToOpenListener((ListPopupWindow) obj, view);
}
@Nullable
@ReplaceWith(expression = "listPopupWindow.createDragToOpenListener(src)")
@Deprecated
public static View.OnTouchListener createDragToOpenListener(@NonNull ListPopupWindow listPopupWindow, @NonNull View view) {
return listPopupWindow.createDragToOpenListener(view);
}
}

View File

@@ -0,0 +1,49 @@
package androidx.core.widget;
import android.widget.ListView;
import androidx.annotation.NonNull;
/* loaded from: classes.dex */
public class ListViewAutoScrollHelper extends AutoScrollHelper {
private final ListView mTarget;
@Override // androidx.core.widget.AutoScrollHelper
public boolean canTargetScrollHorizontally(int i) {
return false;
}
public ListViewAutoScrollHelper(@NonNull ListView listView) {
super(listView);
this.mTarget = listView;
}
@Override // androidx.core.widget.AutoScrollHelper
public void scrollTargetBy(int i, int i2) {
this.mTarget.scrollListBy(i2);
}
@Override // androidx.core.widget.AutoScrollHelper
public boolean canTargetScrollVertically(int i) {
ListView listView = this.mTarget;
int count = listView.getCount();
if (count == 0) {
return false;
}
int childCount = listView.getChildCount();
int firstVisiblePosition = listView.getFirstVisiblePosition();
int i2 = firstVisiblePosition + childCount;
if (i > 0) {
if (i2 >= count && listView.getChildAt(childCount - 1).getBottom() <= listView.getHeight()) {
return false;
}
} else {
if (i >= 0) {
return false;
}
if (firstVisiblePosition <= 0 && listView.getChildAt(0).getTop() >= 0) {
return false;
}
}
return true;
}
}

View File

@@ -0,0 +1,24 @@
package androidx.core.widget;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.annotation.ReplaceWith;
@Deprecated
/* loaded from: classes.dex */
public final class ListViewCompat {
@ReplaceWith(expression = "listView.scrollListBy(y)")
@Deprecated
public static void scrollListBy(@NonNull ListView listView, int i) {
listView.scrollListBy(i);
}
@ReplaceWith(expression = "listView.canScrollList(direction)")
@Deprecated
public static boolean canScrollList(@NonNull ListView listView, int i) {
return listView.canScrollList(i);
}
private ListViewCompat() {
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
package androidx.core.widget;
import android.view.View;
import android.widget.PopupMenu;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/* loaded from: classes.dex */
public final class PopupMenuCompat {
private PopupMenuCompat() {
}
@Nullable
public static View.OnTouchListener getDragToOpenListener(@NonNull Object obj) {
return ((PopupMenu) obj).getDragToOpenListener();
}
}

View File

@@ -0,0 +1,67 @@
package androidx.core.widget;
import android.view.View;
import android.widget.PopupWindow;
import androidx.annotation.NonNull;
import androidx.annotation.ReplaceWith;
import androidx.annotation.RequiresApi;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public final class PopupWindowCompat {
private static final String TAG = "PopupWindowCompatApi21";
private static Method sGetWindowLayoutTypeMethod;
private static boolean sGetWindowLayoutTypeMethodAttempted;
private static Field sOverlapAnchorField;
private static boolean sOverlapAnchorFieldAttempted;
private static Method sSetWindowLayoutTypeMethod;
private static boolean sSetWindowLayoutTypeMethodAttempted;
private PopupWindowCompat() {
}
@ReplaceWith(expression = "popup.showAsDropDown(anchor, xoff, yoff, gravity)")
@Deprecated
public static void showAsDropDown(@NonNull PopupWindow popupWindow, @NonNull View view, int i, int i2, int i3) {
popupWindow.showAsDropDown(view, i, i2, i3);
}
public static void setOverlapAnchor(@NonNull PopupWindow popupWindow, boolean z) {
Api23Impl.setOverlapAnchor(popupWindow, z);
}
public static boolean getOverlapAnchor(@NonNull PopupWindow popupWindow) {
return Api23Impl.getOverlapAnchor(popupWindow);
}
public static void setWindowLayoutType(@NonNull PopupWindow popupWindow, int i) {
Api23Impl.setWindowLayoutType(popupWindow, i);
}
public static int getWindowLayoutType(@NonNull PopupWindow popupWindow) {
return Api23Impl.getWindowLayoutType(popupWindow);
}
@RequiresApi(23)
public static class Api23Impl {
private Api23Impl() {
}
public static void setOverlapAnchor(PopupWindow popupWindow, boolean z) {
popupWindow.setOverlapAnchor(z);
}
public static boolean getOverlapAnchor(PopupWindow popupWindow) {
return popupWindow.getOverlapAnchor();
}
public static void setWindowLayoutType(PopupWindow popupWindow, int i) {
popupWindow.setWindowLayoutType(i);
}
public static int getWindowLayoutType(PopupWindow popupWindow) {
return popupWindow.getWindowLayoutType();
}
}
}

View File

@@ -0,0 +1,105 @@
package androidx.core.widget;
import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.OverScroller;
@Deprecated
/* loaded from: classes.dex */
public final class ScrollerCompat {
OverScroller mScroller;
@Deprecated
public static ScrollerCompat create(Context context) {
return create(context, null);
}
@Deprecated
public static ScrollerCompat create(Context context, Interpolator interpolator) {
return new ScrollerCompat(context, interpolator);
}
public ScrollerCompat(Context context, Interpolator interpolator) {
this.mScroller = interpolator != null ? new OverScroller(context, interpolator) : new OverScroller(context);
}
@Deprecated
public boolean isFinished() {
return this.mScroller.isFinished();
}
@Deprecated
public int getCurrX() {
return this.mScroller.getCurrX();
}
@Deprecated
public int getCurrY() {
return this.mScroller.getCurrY();
}
@Deprecated
public int getFinalX() {
return this.mScroller.getFinalX();
}
@Deprecated
public int getFinalY() {
return this.mScroller.getFinalY();
}
@Deprecated
public float getCurrVelocity() {
return this.mScroller.getCurrVelocity();
}
@Deprecated
public boolean computeScrollOffset() {
return this.mScroller.computeScrollOffset();
}
@Deprecated
public void startScroll(int i, int i2, int i3, int i4) {
this.mScroller.startScroll(i, i2, i3, i4);
}
@Deprecated
public void startScroll(int i, int i2, int i3, int i4, int i5) {
this.mScroller.startScroll(i, i2, i3, i4, i5);
}
@Deprecated
public void fling(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
this.mScroller.fling(i, i2, i3, i4, i5, i6, i7, i8);
}
@Deprecated
public void fling(int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10) {
this.mScroller.fling(i, i2, i3, i4, i5, i6, i7, i8, i9, i10);
}
@Deprecated
public boolean springBack(int i, int i2, int i3, int i4, int i5, int i6) {
return this.mScroller.springBack(i, i2, i3, i4, i5, i6);
}
@Deprecated
public void abortAnimation() {
this.mScroller.abortAnimation();
}
@Deprecated
public void notifyHorizontalEdgeReached(int i, int i2, int i3) {
this.mScroller.notifyHorizontalEdgeReached(i, i2, i3);
}
@Deprecated
public void notifyVerticalEdgeReached(int i, int i2, int i3) {
this.mScroller.notifyVerticalEdgeReached(i, i2, i3);
}
@Deprecated
public boolean isOverScrolled() {
return this.mScroller.isOverScrolled();
}
}

View File

@@ -0,0 +1,595 @@
package androidx.core.widget;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.ColorStateList;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.icu.text.DecimalFormatSymbols;
import android.os.Build;
import android.text.Editable;
import android.text.PrecomputedText;
import android.text.TextDirectionHeuristic;
import android.text.TextDirectionHeuristics;
import android.text.TextPaint;
import android.text.method.PasswordTransformationMethod;
import android.util.TypedValue;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.annotation.DrawableRes;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.annotation.ReplaceWith;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.annotation.StyleRes;
import androidx.core.text.PrecomputedTextCompat;
import androidx.core.util.Preconditions;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
/* loaded from: classes.dex */
public final class TextViewCompat {
public static final int AUTO_SIZE_TEXT_TYPE_NONE = 0;
public static final int AUTO_SIZE_TEXT_TYPE_UNIFORM = 1;
@Retention(RetentionPolicy.SOURCE)
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public @interface AutoSizeTextType {
}
private TextViewCompat() {
}
@ReplaceWith(expression = "textView.setCompoundDrawablesRelative(start, top, end, bottom)")
@Deprecated
public static void setCompoundDrawablesRelative(@NonNull TextView textView, @Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
textView.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
}
@ReplaceWith(expression = "textView.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom)")
@Deprecated
public static void setCompoundDrawablesRelativeWithIntrinsicBounds(@NonNull TextView textView, @Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
textView.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
}
@ReplaceWith(expression = "textView.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom)")
@Deprecated
public static void setCompoundDrawablesRelativeWithIntrinsicBounds(@NonNull TextView textView, @DrawableRes int i, @DrawableRes int i2, @DrawableRes int i3, @DrawableRes int i4) {
textView.setCompoundDrawablesRelativeWithIntrinsicBounds(i, i2, i3, i4);
}
@ReplaceWith(expression = "textView.getMaxLines()")
@Deprecated
public static int getMaxLines(@NonNull TextView textView) {
return textView.getMaxLines();
}
@ReplaceWith(expression = "textView.getMinLines()")
@Deprecated
public static int getMinLines(@NonNull TextView textView) {
return textView.getMinLines();
}
public static void setTextAppearance(@NonNull TextView textView, @StyleRes int i) {
textView.setTextAppearance(i);
}
@NonNull
@ReplaceWith(expression = "textView.getCompoundDrawablesRelative()")
@Deprecated
public static Drawable[] getCompoundDrawablesRelative(@NonNull TextView textView) {
return textView.getCompoundDrawablesRelative();
}
/* JADX WARN: Multi-variable type inference failed */
public static void setAutoSizeTextTypeWithDefaults(@NonNull TextView textView, int i) {
if (Build.VERSION.SDK_INT >= 27) {
Api26Impl.setAutoSizeTextTypeWithDefaults(textView, i);
} else if (textView instanceof AutoSizeableTextView) {
((AutoSizeableTextView) textView).setAutoSizeTextTypeWithDefaults(i);
}
}
/* JADX WARN: Multi-variable type inference failed */
public static void setAutoSizeTextTypeUniformWithConfiguration(@NonNull TextView textView, int i, int i2, int i3, int i4) throws IllegalArgumentException {
if (Build.VERSION.SDK_INT >= 27) {
Api26Impl.setAutoSizeTextTypeUniformWithConfiguration(textView, i, i2, i3, i4);
} else if (textView instanceof AutoSizeableTextView) {
((AutoSizeableTextView) textView).setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
}
}
/* JADX WARN: Multi-variable type inference failed */
public static void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull TextView textView, @NonNull int[] iArr, int i) throws IllegalArgumentException {
if (Build.VERSION.SDK_INT >= 27) {
Api26Impl.setAutoSizeTextTypeUniformWithPresetSizes(textView, iArr, i);
} else if (textView instanceof AutoSizeableTextView) {
((AutoSizeableTextView) textView).setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
}
}
/* JADX WARN: Multi-variable type inference failed */
public static int getAutoSizeTextType(@NonNull TextView textView) {
if (Build.VERSION.SDK_INT >= 27) {
return Api26Impl.getAutoSizeTextType(textView);
}
if (textView instanceof AutoSizeableTextView) {
return ((AutoSizeableTextView) textView).getAutoSizeTextType();
}
return 0;
}
/* JADX WARN: Multi-variable type inference failed */
public static int getAutoSizeStepGranularity(@NonNull TextView textView) {
if (Build.VERSION.SDK_INT >= 27) {
return Api26Impl.getAutoSizeStepGranularity(textView);
}
if (textView instanceof AutoSizeableTextView) {
return ((AutoSizeableTextView) textView).getAutoSizeStepGranularity();
}
return -1;
}
/* JADX WARN: Multi-variable type inference failed */
public static int getAutoSizeMinTextSize(@NonNull TextView textView) {
if (Build.VERSION.SDK_INT >= 27) {
return Api26Impl.getAutoSizeMinTextSize(textView);
}
if (textView instanceof AutoSizeableTextView) {
return ((AutoSizeableTextView) textView).getAutoSizeMinTextSize();
}
return -1;
}
/* JADX WARN: Multi-variable type inference failed */
public static int getAutoSizeMaxTextSize(@NonNull TextView textView) {
if (Build.VERSION.SDK_INT >= 27) {
return Api26Impl.getAutoSizeMaxTextSize(textView);
}
if (textView instanceof AutoSizeableTextView) {
return ((AutoSizeableTextView) textView).getAutoSizeMaxTextSize();
}
return -1;
}
/* JADX WARN: Multi-variable type inference failed */
@NonNull
public static int[] getAutoSizeTextAvailableSizes(@NonNull TextView textView) {
if (Build.VERSION.SDK_INT >= 27) {
return Api26Impl.getAutoSizeTextAvailableSizes(textView);
}
return textView instanceof AutoSizeableTextView ? ((AutoSizeableTextView) textView).getAutoSizeTextAvailableSizes() : new int[0];
}
@ReplaceWith(expression = "textView.setCustomSelectionActionModeCallback(callback)")
@Deprecated
public static void setCustomSelectionActionModeCallback(@NonNull TextView textView, @NonNull ActionMode.Callback callback) {
textView.setCustomSelectionActionModeCallback(wrapCustomSelectionActionModeCallback(textView, callback));
}
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public static ActionMode.Callback wrapCustomSelectionActionModeCallback(@NonNull TextView textView, @Nullable ActionMode.Callback callback) {
return (Build.VERSION.SDK_INT > 27 || (callback instanceof OreoCallback) || callback == null) ? callback : new OreoCallback(callback, textView);
}
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public static ActionMode.Callback unwrapCustomSelectionActionModeCallback(@Nullable ActionMode.Callback callback) {
return callback instanceof OreoCallback ? ((OreoCallback) callback).getWrappedCallback() : callback;
}
@RequiresApi(26)
public static class OreoCallback implements ActionMode.Callback {
private static final int MENU_ITEM_ORDER_PROCESS_TEXT_INTENT_ACTIONS_START = 100;
private final ActionMode.Callback mCallback;
private boolean mCanUseMenuBuilderReferences;
private boolean mInitializedMenuBuilderReferences = false;
private Class<?> mMenuBuilderClass;
private Method mMenuBuilderRemoveItemAtMethod;
private final TextView mTextView;
@NonNull
public ActionMode.Callback getWrappedCallback() {
return this.mCallback;
}
public OreoCallback(ActionMode.Callback callback, TextView textView) {
this.mCallback = callback;
this.mTextView = textView;
}
@Override // android.view.ActionMode.Callback
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
return this.mCallback.onCreateActionMode(actionMode, menu);
}
@Override // android.view.ActionMode.Callback
public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
recomputeProcessTextMenuItems(menu);
return this.mCallback.onPrepareActionMode(actionMode, menu);
}
@Override // android.view.ActionMode.Callback
public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
return this.mCallback.onActionItemClicked(actionMode, menuItem);
}
@Override // android.view.ActionMode.Callback
public void onDestroyActionMode(ActionMode actionMode) {
this.mCallback.onDestroyActionMode(actionMode);
}
private void recomputeProcessTextMenuItems(Menu menu) {
Context context = this.mTextView.getContext();
PackageManager packageManager = context.getPackageManager();
if (!this.mInitializedMenuBuilderReferences) {
this.mInitializedMenuBuilderReferences = true;
try {
Class<?> cls = Class.forName("com.android.internal.view.menu.MenuBuilder");
this.mMenuBuilderClass = cls;
this.mMenuBuilderRemoveItemAtMethod = cls.getDeclaredMethod("removeItemAt", Integer.TYPE);
this.mCanUseMenuBuilderReferences = true;
} catch (ClassNotFoundException | NoSuchMethodException unused) {
this.mMenuBuilderClass = null;
this.mMenuBuilderRemoveItemAtMethod = null;
this.mCanUseMenuBuilderReferences = false;
}
}
try {
Method declaredMethod = (this.mCanUseMenuBuilderReferences && this.mMenuBuilderClass.isInstance(menu)) ? this.mMenuBuilderRemoveItemAtMethod : menu.getClass().getDeclaredMethod("removeItemAt", Integer.TYPE);
for (int size = menu.size() - 1; size >= 0; size--) {
MenuItem item = menu.getItem(size);
if (item.getIntent() != null && "android.intent.action.PROCESS_TEXT".equals(item.getIntent().getAction())) {
declaredMethod.invoke(menu, Integer.valueOf(size));
}
}
List<ResolveInfo> supportedActivities = getSupportedActivities(context, packageManager);
for (int i = 0; i < supportedActivities.size(); i++) {
ResolveInfo resolveInfo = supportedActivities.get(i);
menu.add(0, 0, i + 100, resolveInfo.loadLabel(packageManager)).setIntent(createProcessTextIntentForResolveInfo(resolveInfo, this.mTextView)).setShowAsAction(1);
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException unused2) {
}
}
private List<ResolveInfo> getSupportedActivities(Context context, PackageManager packageManager) {
ArrayList arrayList = new ArrayList();
if (!(context instanceof Activity)) {
return arrayList;
}
for (ResolveInfo resolveInfo : packageManager.queryIntentActivities(createProcessTextIntent(), 0)) {
if (isSupportedActivity(resolveInfo, context)) {
arrayList.add(resolveInfo);
}
}
return arrayList;
}
private boolean isSupportedActivity(ResolveInfo resolveInfo, Context context) {
if (context.getPackageName().equals(resolveInfo.activityInfo.packageName)) {
return true;
}
ActivityInfo activityInfo = resolveInfo.activityInfo;
if (!activityInfo.exported) {
return false;
}
String str = activityInfo.permission;
return str == null || context.checkSelfPermission(str) == 0;
}
private Intent createProcessTextIntentForResolveInfo(ResolveInfo resolveInfo, TextView textView) {
Intent putExtra = createProcessTextIntent().putExtra("android.intent.extra.PROCESS_TEXT_READONLY", !isEditable(textView));
ActivityInfo activityInfo = resolveInfo.activityInfo;
return putExtra.setClassName(activityInfo.packageName, activityInfo.name);
}
private boolean isEditable(TextView textView) {
return (textView instanceof Editable) && textView.onCheckIsTextEditor() && textView.isEnabled();
}
private Intent createProcessTextIntent() {
return new Intent().setAction("android.intent.action.PROCESS_TEXT").setType("text/plain");
}
}
public static void setFirstBaselineToTopHeight(@NonNull TextView textView, @IntRange(from = 0) @Px int i) {
int i2;
Preconditions.checkArgumentNonnegative(i);
if (Build.VERSION.SDK_INT >= 28) {
Api28Impl.setFirstBaselineToTopHeight(textView, i);
return;
}
Paint.FontMetricsInt fontMetricsInt = textView.getPaint().getFontMetricsInt();
if (textView.getIncludeFontPadding()) {
i2 = fontMetricsInt.top;
} else {
i2 = fontMetricsInt.ascent;
}
if (i > Math.abs(i2)) {
textView.setPadding(textView.getPaddingLeft(), i + i2, textView.getPaddingRight(), textView.getPaddingBottom());
}
}
public static void setLastBaselineToBottomHeight(@NonNull TextView textView, @IntRange(from = 0) @Px int i) {
int i2;
Preconditions.checkArgumentNonnegative(i);
Paint.FontMetricsInt fontMetricsInt = textView.getPaint().getFontMetricsInt();
if (textView.getIncludeFontPadding()) {
i2 = fontMetricsInt.bottom;
} else {
i2 = fontMetricsInt.descent;
}
if (i > Math.abs(i2)) {
textView.setPadding(textView.getPaddingLeft(), textView.getPaddingTop(), textView.getPaddingRight(), i - i2);
}
}
public static int getFirstBaselineToTopHeight(@NonNull TextView textView) {
return textView.getPaddingTop() - textView.getPaint().getFontMetricsInt().top;
}
public static int getLastBaselineToBottomHeight(@NonNull TextView textView) {
return textView.getPaddingBottom() + textView.getPaint().getFontMetricsInt().bottom;
}
public static void setLineHeight(@NonNull TextView textView, @IntRange(from = 0) @Px int i) {
Preconditions.checkArgumentNonnegative(i);
if (i != textView.getPaint().getFontMetricsInt(null)) {
textView.setLineSpacing(i - r0, 1.0f);
}
}
public static void setLineHeight(@NonNull TextView textView, int i, @FloatRange(from = 0.0d) float f) {
if (Build.VERSION.SDK_INT >= 34) {
Api34Impl.setLineHeight(textView, i, f);
} else {
setLineHeight(textView, Math.round(TypedValue.applyDimension(i, f, textView.getResources().getDisplayMetrics())));
}
}
@NonNull
public static PrecomputedTextCompat.Params getTextMetricsParams(@NonNull TextView textView) {
if (Build.VERSION.SDK_INT >= 28) {
return new PrecomputedTextCompat.Params(Api28Impl.getTextMetricsParams(textView));
}
PrecomputedTextCompat.Params.Builder builder = new PrecomputedTextCompat.Params.Builder(new TextPaint(textView.getPaint()));
builder.setBreakStrategy(Api23Impl.getBreakStrategy(textView));
builder.setHyphenationFrequency(Api23Impl.getHyphenationFrequency(textView));
builder.setTextDirection(getTextDirectionHeuristic(textView));
return builder.build();
}
public static void setTextMetricsParams(@NonNull TextView textView, @NonNull PrecomputedTextCompat.Params params) {
textView.setTextDirection(getTextDirection(params.getTextDirection()));
textView.getPaint().set(params.getTextPaint());
Api23Impl.setBreakStrategy(textView, params.getBreakStrategy());
Api23Impl.setHyphenationFrequency(textView, params.getHyphenationFrequency());
}
public static void setPrecomputedText(@NonNull TextView textView, @NonNull PrecomputedTextCompat precomputedTextCompat) {
if (Build.VERSION.SDK_INT >= 29) {
textView.setText(Api28Impl.castToCharSequence(precomputedTextCompat.getPrecomputedText()));
} else {
if (!getTextMetricsParams(textView).equalsWithoutTextDirection(precomputedTextCompat.getParams())) {
throw new IllegalArgumentException("Given text can not be applied to TextView.");
}
textView.setText(precomputedTextCompat);
}
}
private static TextDirectionHeuristic getTextDirectionHeuristic(@NonNull TextView textView) {
if (textView.getTransformationMethod() instanceof PasswordTransformationMethod) {
return TextDirectionHeuristics.LTR;
}
if (Build.VERSION.SDK_INT >= 28 && (textView.getInputType() & 15) == 3) {
byte directionality = Character.getDirectionality(Api28Impl.getDigitStrings(Api24Impl.getInstance(textView.getTextLocale()))[0].codePointAt(0));
if (directionality == 1 || directionality == 2) {
return TextDirectionHeuristics.RTL;
}
return TextDirectionHeuristics.LTR;
}
boolean z = textView.getLayoutDirection() == 1;
switch (textView.getTextDirection()) {
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
default:
if (!z) {
break;
} else {
break;
}
}
return TextDirectionHeuristics.LTR;
}
private static int getTextDirection(@NonNull TextDirectionHeuristic textDirectionHeuristic) {
TextDirectionHeuristic textDirectionHeuristic2;
TextDirectionHeuristic textDirectionHeuristic3 = TextDirectionHeuristics.FIRSTSTRONG_RTL;
if (textDirectionHeuristic == textDirectionHeuristic3 || textDirectionHeuristic == (textDirectionHeuristic2 = TextDirectionHeuristics.FIRSTSTRONG_LTR)) {
return 1;
}
if (textDirectionHeuristic == TextDirectionHeuristics.ANYRTL_LTR) {
return 2;
}
if (textDirectionHeuristic == TextDirectionHeuristics.LTR) {
return 3;
}
if (textDirectionHeuristic == TextDirectionHeuristics.RTL) {
return 4;
}
if (textDirectionHeuristic == TextDirectionHeuristics.LOCALE) {
return 5;
}
if (textDirectionHeuristic == textDirectionHeuristic2) {
return 6;
}
return textDirectionHeuristic == textDirectionHeuristic3 ? 7 : 1;
}
public static void setCompoundDrawableTintList(@NonNull TextView textView, @Nullable ColorStateList colorStateList) {
Preconditions.checkNotNull(textView);
Api23Impl.setCompoundDrawableTintList(textView, colorStateList);
}
@Nullable
public static ColorStateList getCompoundDrawableTintList(@NonNull TextView textView) {
Preconditions.checkNotNull(textView);
return Api23Impl.getCompoundDrawableTintList(textView);
}
public static void setCompoundDrawableTintMode(@NonNull TextView textView, @Nullable PorterDuff.Mode mode) {
Preconditions.checkNotNull(textView);
Api23Impl.setCompoundDrawableTintMode(textView, mode);
}
@Nullable
public static PorterDuff.Mode getCompoundDrawableTintMode(@NonNull TextView textView) {
Preconditions.checkNotNull(textView);
return Api23Impl.getCompoundDrawableTintMode(textView);
}
@RequiresApi(26)
public static class Api26Impl {
private Api26Impl() {
}
public static void setAutoSizeTextTypeWithDefaults(TextView textView, int i) {
textView.setAutoSizeTextTypeWithDefaults(i);
}
public static void setAutoSizeTextTypeUniformWithConfiguration(TextView textView, int i, int i2, int i3, int i4) {
textView.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
}
public static void setAutoSizeTextTypeUniformWithPresetSizes(TextView textView, int[] iArr, int i) {
textView.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
}
public static int getAutoSizeTextType(TextView textView) {
return textView.getAutoSizeTextType();
}
public static int getAutoSizeStepGranularity(TextView textView) {
return textView.getAutoSizeStepGranularity();
}
public static int getAutoSizeMinTextSize(TextView textView) {
return textView.getAutoSizeMinTextSize();
}
public static int getAutoSizeMaxTextSize(TextView textView) {
return textView.getAutoSizeMaxTextSize();
}
public static int[] getAutoSizeTextAvailableSizes(TextView textView) {
return textView.getAutoSizeTextAvailableSizes();
}
}
@RequiresApi(28)
public static class Api28Impl {
public static CharSequence castToCharSequence(PrecomputedText precomputedText) {
return precomputedText;
}
private Api28Impl() {
}
public static void setFirstBaselineToTopHeight(TextView textView, int i) {
textView.setFirstBaselineToTopHeight(i);
}
public static PrecomputedText.Params getTextMetricsParams(TextView textView) {
return textView.getTextMetricsParams();
}
public static String[] getDigitStrings(DecimalFormatSymbols decimalFormatSymbols) {
return decimalFormatSymbols.getDigitStrings();
}
}
@RequiresApi(23)
public static class Api23Impl {
private Api23Impl() {
}
public static int getBreakStrategy(TextView textView) {
return textView.getBreakStrategy();
}
public static void setBreakStrategy(TextView textView, int i) {
textView.setBreakStrategy(i);
}
public static int getHyphenationFrequency(TextView textView) {
return textView.getHyphenationFrequency();
}
public static void setHyphenationFrequency(TextView textView, int i) {
textView.setHyphenationFrequency(i);
}
public static PorterDuff.Mode getCompoundDrawableTintMode(TextView textView) {
return textView.getCompoundDrawableTintMode();
}
public static ColorStateList getCompoundDrawableTintList(TextView textView) {
return textView.getCompoundDrawableTintList();
}
public static void setCompoundDrawableTintList(TextView textView, ColorStateList colorStateList) {
textView.setCompoundDrawableTintList(colorStateList);
}
public static void setCompoundDrawableTintMode(TextView textView, PorterDuff.Mode mode) {
textView.setCompoundDrawableTintMode(mode);
}
}
@RequiresApi(24)
public static class Api24Impl {
private Api24Impl() {
}
public static DecimalFormatSymbols getInstance(Locale locale) {
return DecimalFormatSymbols.getInstance(locale);
}
}
@RequiresApi(34)
public static class Api34Impl {
private Api34Impl() {
}
public static void setLineHeight(@NonNull TextView textView, int i, @FloatRange(from = 0.0d) float f) {
textView.setLineHeight(i, f);
}
}
}

View File

@@ -0,0 +1,34 @@
package androidx.core.widget;
import android.text.Editable;
import android.text.TextWatcher;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function4;
/* loaded from: classes.dex */
public final class TextViewKt$addTextChangedListener$textWatcher$1 implements TextWatcher {
final /* synthetic */ Function1 $afterTextChanged;
final /* synthetic */ Function4 $beforeTextChanged;
final /* synthetic */ Function4 $onTextChanged;
public TextViewKt$addTextChangedListener$textWatcher$1(Function1 function1, Function4 function4, Function4 function42) {
this.$afterTextChanged = function1;
this.$beforeTextChanged = function4;
this.$onTextChanged = function42;
}
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
this.$afterTextChanged.invoke(editable);
}
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
this.$beforeTextChanged.invoke(charSequence, Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3));
}
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
this.$onTextChanged.invoke(charSequence, Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3));
}
}

View File

@@ -0,0 +1,118 @@
package androidx.core.widget;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.TextView;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function4;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nTextView.kt\nKotlin\n*S Kotlin\n*F\n+ 1 TextView.kt\nandroidx/core/widget/TextViewKt\n*L\n1#1,88:1\n55#1,12:89\n84#1,3:101\n55#1,12:104\n84#1,3:116\n55#1,12:119\n84#1,3:131\n*S KotlinDebug\n*F\n+ 1 TextView.kt\nandroidx/core/widget/TextViewKt\n*L\n30#1:89,12\n30#1:101,3\n39#1:104,12\n39#1:116,3\n48#1:119,12\n48#1:131,3\n*E\n"})
/* loaded from: classes.dex */
public final class TextViewKt {
public static final TextWatcher addTextChangedListener(TextView textView, Function4 function4, Function4 function42, Function1 function1) {
TextViewKt$addTextChangedListener$textWatcher$1 textViewKt$addTextChangedListener$textWatcher$1 = new TextViewKt$addTextChangedListener$textWatcher$1(function1, function4, function42);
textView.addTextChangedListener(textViewKt$addTextChangedListener$textWatcher$1);
return textViewKt$addTextChangedListener$textWatcher$1;
}
public static /* synthetic */ TextWatcher addTextChangedListener$default(TextView textView, Function4 function4, Function4 function42, Function1 function1, int i, Object obj) {
if ((i & 1) != 0) {
function4 = new Function4() { // from class: androidx.core.widget.TextViewKt$addTextChangedListener$1
public final void invoke(CharSequence charSequence, int i2, int i3, int i4) {
}
@Override // kotlin.jvm.functions.Function4
public /* bridge */ /* synthetic */ Object invoke(Object obj2, Object obj3, Object obj4, Object obj5) {
invoke((CharSequence) obj2, ((Number) obj3).intValue(), ((Number) obj4).intValue(), ((Number) obj5).intValue());
return Unit.INSTANCE;
}
};
}
if ((i & 2) != 0) {
function42 = new Function4() { // from class: androidx.core.widget.TextViewKt$addTextChangedListener$2
public final void invoke(CharSequence charSequence, int i2, int i3, int i4) {
}
@Override // kotlin.jvm.functions.Function4
public /* bridge */ /* synthetic */ Object invoke(Object obj2, Object obj3, Object obj4, Object obj5) {
invoke((CharSequence) obj2, ((Number) obj3).intValue(), ((Number) obj4).intValue(), ((Number) obj5).intValue());
return Unit.INSTANCE;
}
};
}
if ((i & 4) != 0) {
function1 = new Function1() { // from class: androidx.core.widget.TextViewKt$addTextChangedListener$3
public final void invoke(Editable editable) {
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Object invoke(Object obj2) {
invoke((Editable) obj2);
return Unit.INSTANCE;
}
};
}
TextViewKt$addTextChangedListener$textWatcher$1 textViewKt$addTextChangedListener$textWatcher$1 = new TextViewKt$addTextChangedListener$textWatcher$1(function1, function4, function42);
textView.addTextChangedListener(textViewKt$addTextChangedListener$textWatcher$1);
return textViewKt$addTextChangedListener$textWatcher$1;
}
public static final TextWatcher doAfterTextChanged(TextView textView, final Function1 function1) {
TextWatcher textWatcher = new TextWatcher() { // from class: androidx.core.widget.TextViewKt$doAfterTextChanged$$inlined$addTextChangedListener$default$1
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
Function1.this.invoke(editable);
}
};
textView.addTextChangedListener(textWatcher);
return textWatcher;
}
public static final TextWatcher doBeforeTextChanged(TextView textView, final Function4 function4) {
TextWatcher textWatcher = new TextWatcher() { // from class: androidx.core.widget.TextViewKt$doBeforeTextChanged$$inlined$addTextChangedListener$default$1
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
}
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
Function4.this.invoke(charSequence, Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3));
}
};
textView.addTextChangedListener(textWatcher);
return textWatcher;
}
public static final TextWatcher doOnTextChanged(TextView textView, final Function4 function4) {
TextWatcher textWatcher = new TextWatcher() { // from class: androidx.core.widget.TextViewKt$doOnTextChanged$$inlined$addTextChangedListener$default$1
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
}
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
Function4.this.invoke(charSequence, Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3));
}
};
textView.addTextChangedListener(textWatcher);
return textWatcher;
}
}

View File

@@ -0,0 +1,70 @@
package androidx.core.widget;
import android.content.ClipData;
import android.content.Context;
import android.text.Editable;
import android.text.Selection;
import android.text.Spanned;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.ContentInfoCompat;
import androidx.core.view.OnReceiveContentListener;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class TextViewOnReceiveContentListener implements OnReceiveContentListener {
private static final String LOG_TAG = "ReceiveContent";
@Override // androidx.core.view.OnReceiveContentListener
@Nullable
public ContentInfoCompat onReceiveContent(@NonNull View view, @NonNull ContentInfoCompat contentInfoCompat) {
if (Log.isLoggable(LOG_TAG, 3)) {
StringBuilder sb = new StringBuilder();
sb.append("onReceive: ");
sb.append(contentInfoCompat);
}
if (contentInfoCompat.getSource() == 2) {
return contentInfoCompat;
}
ClipData clip = contentInfoCompat.getClip();
int flags = contentInfoCompat.getFlags();
TextView textView = (TextView) view;
Editable editable = (Editable) textView.getText();
Context context = textView.getContext();
boolean z = false;
for (int i = 0; i < clip.getItemCount(); i++) {
CharSequence coerceToText = coerceToText(context, clip.getItemAt(i), flags);
if (coerceToText != null) {
if (!z) {
replaceSelection(editable, coerceToText);
z = true;
} else {
editable.insert(Selection.getSelectionEnd(editable), "\n");
editable.insert(Selection.getSelectionEnd(editable), coerceToText);
}
}
}
return null;
}
private static CharSequence coerceToText(@NonNull Context context, @NonNull ClipData.Item item, int i) {
if ((i & 1) != 0) {
CharSequence coerceToText = item.coerceToText(context);
return coerceToText instanceof Spanned ? coerceToText.toString() : coerceToText;
}
return item.coerceToStyledText(context);
}
private static void replaceSelection(@NonNull Editable editable, @NonNull CharSequence charSequence) {
int selectionStart = Selection.getSelectionStart(editable);
int selectionEnd = Selection.getSelectionEnd(editable);
int max = Math.max(0, Math.min(selectionStart, selectionEnd));
int max2 = Math.max(0, Math.max(selectionStart, selectionEnd));
Selection.setSelection(editable, max2);
editable.replace(max, max2, charSequence);
}
}

View File

@@ -0,0 +1,20 @@
package androidx.core.widget;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public interface TintableCheckedTextView {
@Nullable
ColorStateList getSupportCheckMarkTintList();
@Nullable
PorterDuff.Mode getSupportCheckMarkTintMode();
void setSupportCheckMarkTintList(@Nullable ColorStateList colorStateList);
void setSupportCheckMarkTintMode(@Nullable PorterDuff.Mode mode);
}

View File

@@ -0,0 +1,18 @@
package androidx.core.widget;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import androidx.annotation.Nullable;
/* loaded from: classes.dex */
public interface TintableCompoundButton {
@Nullable
ColorStateList getSupportButtonTintList();
@Nullable
PorterDuff.Mode getSupportButtonTintMode();
void setSupportButtonTintList(@Nullable ColorStateList colorStateList);
void setSupportButtonTintMode(@Nullable PorterDuff.Mode mode);
}

View File

@@ -0,0 +1,18 @@
package androidx.core.widget;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import androidx.annotation.Nullable;
/* loaded from: classes.dex */
public interface TintableCompoundDrawablesView {
@Nullable
ColorStateList getSupportCompoundDrawablesTintList();
@Nullable
PorterDuff.Mode getSupportCompoundDrawablesTintMode();
void setSupportCompoundDrawablesTintList(@Nullable ColorStateList colorStateList);
void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode mode);
}

View File

@@ -0,0 +1,20 @@
package androidx.core.widget;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public interface TintableImageSourceView {
@Nullable
ColorStateList getSupportImageTintList();
@Nullable
PorterDuff.Mode getSupportImageTintMode();
void setSupportImageTintList(@Nullable ColorStateList colorStateList);
void setSupportImageTintMode(@Nullable PorterDuff.Mode mode);
}