ADD week 5

This commit is contained in:
2025-03-31 16:33:42 +02:00
parent 86f265f22d
commit bf645048e6
4927 changed files with 544053 additions and 0 deletions

View File

@ -0,0 +1,205 @@
package androidx.core.view;
import android.os.Bundle;
import android.text.style.ClickableSpan;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeProvider;
import androidx.core.R;
import androidx.core.view.accessibility.AccessibilityClickableSpanCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
import androidx.core.view.accessibility.AccessibilityNodeProviderCompat;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.List;
/* loaded from: classes.dex */
public class AccessibilityDelegateCompat {
private static final View.AccessibilityDelegate DEFAULT_DELEGATE = new View.AccessibilityDelegate();
private final View.AccessibilityDelegate mBridge;
private final View.AccessibilityDelegate mOriginalDelegate;
View.AccessibilityDelegate getBridge() {
return this.mBridge;
}
static final class AccessibilityDelegateAdapter extends View.AccessibilityDelegate {
final AccessibilityDelegateCompat mCompat;
AccessibilityDelegateAdapter(AccessibilityDelegateCompat accessibilityDelegateCompat) {
this.mCompat = accessibilityDelegateCompat;
}
@Override // android.view.View.AccessibilityDelegate
public boolean dispatchPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
return this.mCompat.dispatchPopulateAccessibilityEvent(view, accessibilityEvent);
}
@Override // android.view.View.AccessibilityDelegate
public void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
this.mCompat.onInitializeAccessibilityEvent(view, accessibilityEvent);
}
@Override // android.view.View.AccessibilityDelegate
public void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfo accessibilityNodeInfo) {
AccessibilityNodeInfoCompat wrap = AccessibilityNodeInfoCompat.wrap(accessibilityNodeInfo);
wrap.setScreenReaderFocusable(ViewCompat.isScreenReaderFocusable(view));
wrap.setHeading(ViewCompat.isAccessibilityHeading(view));
wrap.setPaneTitle(ViewCompat.getAccessibilityPaneTitle(view));
wrap.setStateDescription(ViewCompat.getStateDescription(view));
this.mCompat.onInitializeAccessibilityNodeInfo(view, wrap);
wrap.addSpansToExtras(accessibilityNodeInfo.getText(), view);
List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> actionList = AccessibilityDelegateCompat.getActionList(view);
for (int i = 0; i < actionList.size(); i++) {
wrap.addAction(actionList.get(i));
}
}
@Override // android.view.View.AccessibilityDelegate
public void onPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
this.mCompat.onPopulateAccessibilityEvent(view, accessibilityEvent);
}
@Override // android.view.View.AccessibilityDelegate
public boolean onRequestSendAccessibilityEvent(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
return this.mCompat.onRequestSendAccessibilityEvent(viewGroup, view, accessibilityEvent);
}
@Override // android.view.View.AccessibilityDelegate
public void sendAccessibilityEvent(View view, int i) {
this.mCompat.sendAccessibilityEvent(view, i);
}
@Override // android.view.View.AccessibilityDelegate
public void sendAccessibilityEventUnchecked(View view, AccessibilityEvent accessibilityEvent) {
this.mCompat.sendAccessibilityEventUnchecked(view, accessibilityEvent);
}
@Override // android.view.View.AccessibilityDelegate
public AccessibilityNodeProvider getAccessibilityNodeProvider(View view) {
AccessibilityNodeProviderCompat accessibilityNodeProvider = this.mCompat.getAccessibilityNodeProvider(view);
if (accessibilityNodeProvider != null) {
return (AccessibilityNodeProvider) accessibilityNodeProvider.getProvider();
}
return null;
}
@Override // android.view.View.AccessibilityDelegate
public boolean performAccessibilityAction(View view, int i, Bundle bundle) {
return this.mCompat.performAccessibilityAction(view, i, bundle);
}
}
public AccessibilityDelegateCompat() {
this(DEFAULT_DELEGATE);
}
public AccessibilityDelegateCompat(View.AccessibilityDelegate accessibilityDelegate) {
this.mOriginalDelegate = accessibilityDelegate;
this.mBridge = new AccessibilityDelegateAdapter(this);
}
public void sendAccessibilityEvent(View view, int i) {
this.mOriginalDelegate.sendAccessibilityEvent(view, i);
}
public void sendAccessibilityEventUnchecked(View view, AccessibilityEvent accessibilityEvent) {
this.mOriginalDelegate.sendAccessibilityEventUnchecked(view, accessibilityEvent);
}
public boolean dispatchPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
return this.mOriginalDelegate.dispatchPopulateAccessibilityEvent(view, accessibilityEvent);
}
public void onPopulateAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
this.mOriginalDelegate.onPopulateAccessibilityEvent(view, accessibilityEvent);
}
public void onInitializeAccessibilityEvent(View view, AccessibilityEvent accessibilityEvent) {
this.mOriginalDelegate.onInitializeAccessibilityEvent(view, accessibilityEvent);
}
public void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
this.mOriginalDelegate.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfoCompat.unwrap());
}
public boolean onRequestSendAccessibilityEvent(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
return this.mOriginalDelegate.onRequestSendAccessibilityEvent(viewGroup, view, accessibilityEvent);
}
public AccessibilityNodeProviderCompat getAccessibilityNodeProvider(View view) {
AccessibilityNodeProvider accessibilityNodeProvider = Api16Impl.getAccessibilityNodeProvider(this.mOriginalDelegate, view);
if (accessibilityNodeProvider != null) {
return new AccessibilityNodeProviderCompat(accessibilityNodeProvider);
}
return null;
}
public boolean performAccessibilityAction(View view, int i, Bundle bundle) {
List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> actionList = getActionList(view);
boolean z = false;
int i2 = 0;
while (true) {
if (i2 >= actionList.size()) {
break;
}
AccessibilityNodeInfoCompat.AccessibilityActionCompat accessibilityActionCompat = actionList.get(i2);
if (accessibilityActionCompat.getId() == i) {
z = accessibilityActionCompat.perform(view, bundle);
break;
}
i2++;
}
if (!z) {
z = Api16Impl.performAccessibilityAction(this.mOriginalDelegate, view, i, bundle);
}
return (z || i != R.id.accessibility_action_clickable_span || bundle == null) ? z : performClickableSpanAction(bundle.getInt(AccessibilityClickableSpanCompat.SPAN_ID, -1), view);
}
private boolean performClickableSpanAction(int i, View view) {
WeakReference weakReference;
SparseArray sparseArray = (SparseArray) view.getTag(R.id.tag_accessibility_clickable_spans);
if (sparseArray == null || (weakReference = (WeakReference) sparseArray.get(i)) == null) {
return false;
}
ClickableSpan clickableSpan = (ClickableSpan) weakReference.get();
if (!isSpanStillValid(clickableSpan, view)) {
return false;
}
clickableSpan.onClick(view);
return true;
}
private boolean isSpanStillValid(ClickableSpan clickableSpan, View view) {
if (clickableSpan != null) {
ClickableSpan[] clickableSpans = AccessibilityNodeInfoCompat.getClickableSpans(view.createAccessibilityNodeInfo().getText());
for (int i = 0; clickableSpans != null && i < clickableSpans.length; i++) {
if (clickableSpan.equals(clickableSpans[i])) {
return true;
}
}
}
return false;
}
static List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> getActionList(View view) {
List<AccessibilityNodeInfoCompat.AccessibilityActionCompat> list = (List) view.getTag(R.id.tag_accessibility_actions);
return list == null ? Collections.emptyList() : list;
}
static class Api16Impl {
private Api16Impl() {
}
static AccessibilityNodeProvider getAccessibilityNodeProvider(View.AccessibilityDelegate accessibilityDelegate, View view) {
return accessibilityDelegate.getAccessibilityNodeProvider(view);
}
static boolean performAccessibilityAction(View.AccessibilityDelegate accessibilityDelegate, View view, int i, Bundle bundle) {
return accessibilityDelegate.performAccessibilityAction(view, i, bundle);
}
}
}

View File

@ -0,0 +1,86 @@
package androidx.core.view;
import android.content.Context;
import android.util.Log;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
/* loaded from: classes.dex */
public abstract class ActionProvider {
private static final String TAG = "ActionProvider(support)";
private final Context mContext;
private SubUiVisibilityListener mSubUiVisibilityListener;
private VisibilityListener mVisibilityListener;
public interface SubUiVisibilityListener {
void onSubUiVisibilityChanged(boolean z);
}
public interface VisibilityListener {
void onActionProviderVisibilityChanged(boolean z);
}
public Context getContext() {
return this.mContext;
}
public boolean hasSubMenu() {
return false;
}
public boolean isVisible() {
return true;
}
public abstract View onCreateActionView();
public boolean onPerformDefaultAction() {
return false;
}
public void onPrepareSubMenu(SubMenu subMenu) {
}
public boolean overridesItemVisibility() {
return false;
}
public void reset() {
this.mVisibilityListener = null;
this.mSubUiVisibilityListener = null;
}
public void setSubUiVisibilityListener(SubUiVisibilityListener subUiVisibilityListener) {
this.mSubUiVisibilityListener = subUiVisibilityListener;
}
public ActionProvider(Context context) {
this.mContext = context;
}
public View onCreateActionView(MenuItem menuItem) {
return onCreateActionView();
}
public void refreshVisibility() {
if (this.mVisibilityListener == null || !overridesItemVisibility()) {
return;
}
this.mVisibilityListener.onActionProviderVisibilityChanged(isVisible());
}
public void subUiVisibilityChanged(boolean z) {
SubUiVisibilityListener subUiVisibilityListener = this.mSubUiVisibilityListener;
if (subUiVisibilityListener != null) {
subUiVisibilityListener.onSubUiVisibilityChanged(z);
}
}
public void setVisibilityListener(VisibilityListener visibilityListener) {
if (this.mVisibilityListener != null && visibilityListener != null) {
Log.w(TAG, "setVisibilityListener: Setting a new ActionProvider.VisibilityListener when one is already set. Are you reusing this " + getClass().getSimpleName() + " instance while it is still in use somewhere else?");
}
this.mVisibilityListener = visibilityListener;
}
}

View File

@ -0,0 +1,23 @@
package androidx.core.view;
import android.view.View;
import kotlin.Metadata;
import kotlin.jvm.JvmStatic;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: View.kt */
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J \u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0007¨\u0006\u000b"}, d2 = {"Landroidx/core/view/Api16Impl;", "", "()V", "postOnAnimationDelayed", "", "view", "Landroid/view/View;", "action", "Ljava/lang/Runnable;", "delayInMillis", "", "core-ktx_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
final class Api16Impl {
public static final Api16Impl INSTANCE = new Api16Impl();
private Api16Impl() {
}
@JvmStatic
public static final void postOnAnimationDelayed(View view, Runnable action, long delayInMillis) {
Intrinsics.checkNotNullParameter(view, "view");
Intrinsics.checkNotNullParameter(action, "action");
view.postOnAnimationDelayed(action, delayInMillis);
}
}

View File

@ -0,0 +1,471 @@
package androidx.core.view;
import android.content.ClipData;
import android.content.ClipDescription;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Pair;
import android.view.ContentInfo;
import androidx.core.util.HalfKt$$ExternalSyntheticApiModelOutline0;
import androidx.core.util.Preconditions;
import androidx.core.util.Predicate;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/* loaded from: classes.dex */
public final class ContentInfoCompat {
public static final int FLAG_CONVERT_TO_PLAIN_TEXT = 1;
public static final int SOURCE_APP = 0;
public static final int SOURCE_AUTOFILL = 4;
public static final int SOURCE_CLIPBOARD = 1;
public static final int SOURCE_DRAG_AND_DROP = 3;
public static final int SOURCE_INPUT_METHOD = 2;
public static final int SOURCE_PROCESS_TEXT = 5;
private final Compat mCompat;
private interface BuilderCompat {
ContentInfoCompat build();
void setClip(ClipData clipData);
void setExtras(Bundle bundle);
void setFlags(int i);
void setLinkUri(Uri uri);
void setSource(int i);
}
private interface Compat {
ClipData getClip();
Bundle getExtras();
int getFlags();
Uri getLinkUri();
int getSource();
ContentInfo getWrapped();
}
@Retention(RetentionPolicy.SOURCE)
public @interface Flags {
}
@Retention(RetentionPolicy.SOURCE)
public @interface Source {
}
static String sourceToString(int i) {
return i != 0 ? i != 1 ? i != 2 ? i != 3 ? i != 4 ? i != 5 ? String.valueOf(i) : "SOURCE_PROCESS_TEXT" : "SOURCE_AUTOFILL" : "SOURCE_DRAG_AND_DROP" : "SOURCE_INPUT_METHOD" : "SOURCE_CLIPBOARD" : "SOURCE_APP";
}
static String flagsToString(int i) {
return (i & 1) != 0 ? "FLAG_CONVERT_TO_PLAIN_TEXT" : String.valueOf(i);
}
ContentInfoCompat(Compat compat) {
this.mCompat = compat;
}
public static ContentInfoCompat toContentInfoCompat(ContentInfo contentInfo) {
return new ContentInfoCompat(new Compat31Impl(contentInfo));
}
public ContentInfo toContentInfo() {
return HalfKt$$ExternalSyntheticApiModelOutline0.m(Objects.requireNonNull(this.mCompat.getWrapped()));
}
public String toString() {
return this.mCompat.toString();
}
public ClipData getClip() {
return this.mCompat.getClip();
}
public int getSource() {
return this.mCompat.getSource();
}
public int getFlags() {
return this.mCompat.getFlags();
}
public Uri getLinkUri() {
return this.mCompat.getLinkUri();
}
public Bundle getExtras() {
return this.mCompat.getExtras();
}
public Pair<ContentInfoCompat, ContentInfoCompat> partition(Predicate<ClipData.Item> predicate) {
ClipData clip = this.mCompat.getClip();
if (clip.getItemCount() == 1) {
boolean test = predicate.test(clip.getItemAt(0));
return Pair.create(test ? this : null, test ? null : this);
}
Pair<ClipData, ClipData> partition = partition(clip, predicate);
if (partition.first == null) {
return Pair.create(null, this);
}
if (partition.second == null) {
return Pair.create(this, null);
}
return Pair.create(new Builder(this).setClip((ClipData) partition.first).build(), new Builder(this).setClip((ClipData) partition.second).build());
}
static Pair<ClipData, ClipData> partition(ClipData clipData, Predicate<ClipData.Item> predicate) {
ArrayList arrayList = null;
ArrayList arrayList2 = null;
for (int i = 0; i < clipData.getItemCount(); i++) {
ClipData.Item itemAt = clipData.getItemAt(i);
if (predicate.test(itemAt)) {
if (arrayList == null) {
arrayList = new ArrayList();
}
arrayList.add(itemAt);
} else {
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
arrayList2.add(itemAt);
}
}
if (arrayList == null) {
return Pair.create(null, clipData);
}
if (arrayList2 == null) {
return Pair.create(clipData, null);
}
return Pair.create(buildClipData(clipData.getDescription(), arrayList), buildClipData(clipData.getDescription(), arrayList2));
}
static ClipData buildClipData(ClipDescription clipDescription, List<ClipData.Item> list) {
ClipData clipData = new ClipData(new ClipDescription(clipDescription), list.get(0));
for (int i = 1; i < list.size(); i++) {
clipData.addItem(list.get(i));
}
return clipData;
}
public static Pair<ContentInfo, ContentInfo> partition(ContentInfo contentInfo, java.util.function.Predicate<ClipData.Item> predicate) {
return Api31Impl.partition(contentInfo, predicate);
}
private static final class Api31Impl {
private Api31Impl() {
}
public static Pair<ContentInfo, ContentInfo> partition(ContentInfo contentInfo, final java.util.function.Predicate<ClipData.Item> predicate) {
ClipData clip = contentInfo.getClip();
if (clip.getItemCount() == 1) {
boolean test = predicate.test(clip.getItemAt(0));
ContentInfo contentInfo2 = test ? contentInfo : null;
if (test) {
contentInfo = null;
}
return Pair.create(contentInfo2, contentInfo);
}
Objects.requireNonNull(predicate);
Pair<ClipData, ClipData> partition = ContentInfoCompat.partition(clip, (Predicate<ClipData.Item>) new Predicate() { // from class: androidx.core.view.ContentInfoCompat$Api31Impl$$ExternalSyntheticLambda0
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate and(Predicate predicate2) {
return Predicate.CC.$default$and(this, predicate2);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate negate() {
return Predicate.CC.$default$negate(this);
}
@Override // androidx.core.util.Predicate
public /* synthetic */ Predicate or(Predicate predicate2) {
return Predicate.CC.$default$or(this, predicate2);
}
@Override // androidx.core.util.Predicate
public final boolean test(Object obj) {
return predicate.test((ClipData.Item) obj);
}
});
if (partition.first == null) {
return Pair.create(null, contentInfo);
}
if (partition.second == null) {
return Pair.create(contentInfo, null);
}
return Pair.create(new ContentInfo.Builder(contentInfo).setClip((ClipData) partition.first).build(), new ContentInfo.Builder(contentInfo).setClip((ClipData) partition.second).build());
}
}
private static final class CompatImpl implements Compat {
private final ClipData mClip;
private final Bundle mExtras;
private final int mFlags;
private final Uri mLinkUri;
private final int mSource;
@Override // androidx.core.view.ContentInfoCompat.Compat
public ClipData getClip() {
return this.mClip;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public Bundle getExtras() {
return this.mExtras;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public int getFlags() {
return this.mFlags;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public Uri getLinkUri() {
return this.mLinkUri;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public int getSource() {
return this.mSource;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public ContentInfo getWrapped() {
return null;
}
CompatImpl(BuilderCompatImpl builderCompatImpl) {
this.mClip = (ClipData) Preconditions.checkNotNull(builderCompatImpl.mClip);
this.mSource = Preconditions.checkArgumentInRange(builderCompatImpl.mSource, 0, 5, "source");
this.mFlags = Preconditions.checkFlagsArgument(builderCompatImpl.mFlags, 1);
this.mLinkUri = builderCompatImpl.mLinkUri;
this.mExtras = builderCompatImpl.mExtras;
}
public String toString() {
String str;
StringBuilder sb = new StringBuilder("ContentInfoCompat{clip=");
sb.append(this.mClip.getDescription());
sb.append(", source=");
sb.append(ContentInfoCompat.sourceToString(this.mSource));
sb.append(", flags=");
sb.append(ContentInfoCompat.flagsToString(this.mFlags));
if (this.mLinkUri == null) {
str = "";
} else {
str = ", hasLinkUri(" + this.mLinkUri.toString().length() + ")";
}
sb.append(str);
sb.append(this.mExtras != null ? ", hasExtras" : "");
sb.append("}");
return sb.toString();
}
}
private static final class Compat31Impl implements Compat {
private final ContentInfo mWrapped;
@Override // androidx.core.view.ContentInfoCompat.Compat
public ContentInfo getWrapped() {
return this.mWrapped;
}
Compat31Impl(ContentInfo contentInfo) {
this.mWrapped = HalfKt$$ExternalSyntheticApiModelOutline0.m(Preconditions.checkNotNull(contentInfo));
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public ClipData getClip() {
ClipData clip;
clip = this.mWrapped.getClip();
return clip;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public int getSource() {
int source;
source = this.mWrapped.getSource();
return source;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public int getFlags() {
int flags;
flags = this.mWrapped.getFlags();
return flags;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public Uri getLinkUri() {
Uri linkUri;
linkUri = this.mWrapped.getLinkUri();
return linkUri;
}
@Override // androidx.core.view.ContentInfoCompat.Compat
public Bundle getExtras() {
Bundle extras;
extras = this.mWrapped.getExtras();
return extras;
}
public String toString() {
return "ContentInfoCompat{" + this.mWrapped + "}";
}
}
public static final class Builder {
private final BuilderCompat mBuilderCompat;
public Builder(ContentInfoCompat contentInfoCompat) {
if (Build.VERSION.SDK_INT >= 31) {
this.mBuilderCompat = new BuilderCompat31Impl(contentInfoCompat);
} else {
this.mBuilderCompat = new BuilderCompatImpl(contentInfoCompat);
}
}
public Builder(ClipData clipData, int i) {
if (Build.VERSION.SDK_INT >= 31) {
this.mBuilderCompat = new BuilderCompat31Impl(clipData, i);
} else {
this.mBuilderCompat = new BuilderCompatImpl(clipData, i);
}
}
public Builder setClip(ClipData clipData) {
this.mBuilderCompat.setClip(clipData);
return this;
}
public Builder setSource(int i) {
this.mBuilderCompat.setSource(i);
return this;
}
public Builder setFlags(int i) {
this.mBuilderCompat.setFlags(i);
return this;
}
public Builder setLinkUri(Uri uri) {
this.mBuilderCompat.setLinkUri(uri);
return this;
}
public Builder setExtras(Bundle bundle) {
this.mBuilderCompat.setExtras(bundle);
return this;
}
public ContentInfoCompat build() {
return this.mBuilderCompat.build();
}
}
private static final class BuilderCompatImpl implements BuilderCompat {
ClipData mClip;
Bundle mExtras;
int mFlags;
Uri mLinkUri;
int mSource;
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setClip(ClipData clipData) {
this.mClip = clipData;
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setExtras(Bundle bundle) {
this.mExtras = bundle;
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setFlags(int i) {
this.mFlags = i;
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setLinkUri(Uri uri) {
this.mLinkUri = uri;
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setSource(int i) {
this.mSource = i;
}
BuilderCompatImpl(ClipData clipData, int i) {
this.mClip = clipData;
this.mSource = i;
}
BuilderCompatImpl(ContentInfoCompat contentInfoCompat) {
this.mClip = contentInfoCompat.getClip();
this.mSource = contentInfoCompat.getSource();
this.mFlags = contentInfoCompat.getFlags();
this.mLinkUri = contentInfoCompat.getLinkUri();
this.mExtras = contentInfoCompat.getExtras();
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public ContentInfoCompat build() {
return new ContentInfoCompat(new CompatImpl(this));
}
}
private static final class BuilderCompat31Impl implements BuilderCompat {
private final ContentInfo.Builder mPlatformBuilder;
BuilderCompat31Impl(ClipData clipData, int i) {
this.mPlatformBuilder = HalfKt$$ExternalSyntheticApiModelOutline0.m(clipData, i);
}
BuilderCompat31Impl(ContentInfoCompat contentInfoCompat) {
HalfKt$$ExternalSyntheticApiModelOutline0.m151m();
this.mPlatformBuilder = HalfKt$$ExternalSyntheticApiModelOutline0.m140m(contentInfoCompat.toContentInfo());
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setClip(ClipData clipData) {
this.mPlatformBuilder.setClip(clipData);
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setSource(int i) {
this.mPlatformBuilder.setSource(i);
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setFlags(int i) {
this.mPlatformBuilder.setFlags(i);
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setLinkUri(Uri uri) {
this.mPlatformBuilder.setLinkUri(uri);
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public void setExtras(Bundle bundle) {
this.mPlatformBuilder.setExtras(bundle);
}
@Override // androidx.core.view.ContentInfoCompat.BuilderCompat
public ContentInfoCompat build() {
ContentInfo build;
build = this.mPlatformBuilder.build();
return new ContentInfoCompat(new Compat31Impl(build));
}
}
}

View File

@ -0,0 +1,228 @@
package androidx.core.view;
import android.app.UiModeManager;
import android.content.Context;
import android.graphics.Point;
import android.os.Build;
import android.text.TextUtils;
import android.view.Display;
import androidx.core.util.Preconditions;
/* loaded from: classes.dex */
public final class DisplayCompat {
private static final int DISPLAY_SIZE_4K_HEIGHT = 2160;
private static final int DISPLAY_SIZE_4K_WIDTH = 3840;
private DisplayCompat() {
}
public static ModeCompat getMode(Context context, Display display) {
if (Build.VERSION.SDK_INT >= 23) {
return Api23Impl.getMode(context, display);
}
return new ModeCompat(getDisplaySize(context, display));
}
private static Point getDisplaySize(Context context, Display display) {
Point currentDisplaySizeFromWorkarounds = getCurrentDisplaySizeFromWorkarounds(context, display);
if (currentDisplaySizeFromWorkarounds != null) {
return currentDisplaySizeFromWorkarounds;
}
Point point = new Point();
Api17Impl.getRealSize(display, point);
return point;
}
public static ModeCompat[] getSupportedModes(Context context, Display display) {
return Build.VERSION.SDK_INT >= 23 ? Api23Impl.getSupportedModes(context, display) : new ModeCompat[]{getMode(context, display)};
}
private static Point parseDisplaySize(String str) throws NumberFormatException {
String[] split = str.trim().split("x", -1);
if (split.length == 2) {
int parseInt = Integer.parseInt(split[0]);
int parseInt2 = Integer.parseInt(split[1]);
if (parseInt > 0 && parseInt2 > 0) {
return new Point(parseInt, parseInt2);
}
}
throw new NumberFormatException();
}
private static String getSystemProperty(String str) {
try {
Class<?> cls = Class.forName("android.os.SystemProperties");
return (String) cls.getMethod("get", String.class).invoke(cls, str);
} catch (Exception unused) {
return null;
}
}
private static boolean isTv(Context context) {
UiModeManager uiModeManager = (UiModeManager) context.getSystemService("uimode");
return uiModeManager != null && uiModeManager.getCurrentModeType() == 4;
}
private static Point parsePhysicalDisplaySizeFromSystemProperties(String str, Display display) {
if (display.getDisplayId() != 0) {
return null;
}
String systemProperty = getSystemProperty(str);
if (!TextUtils.isEmpty(systemProperty) && systemProperty != null) {
try {
return parseDisplaySize(systemProperty);
} catch (NumberFormatException unused) {
}
}
return null;
}
static Point getCurrentDisplaySizeFromWorkarounds(Context context, Display display) {
Point parsePhysicalDisplaySizeFromSystemProperties;
if (Build.VERSION.SDK_INT < 28) {
parsePhysicalDisplaySizeFromSystemProperties = parsePhysicalDisplaySizeFromSystemProperties("sys.display-size", display);
} else {
parsePhysicalDisplaySizeFromSystemProperties = parsePhysicalDisplaySizeFromSystemProperties("vendor.display-size", display);
}
if (parsePhysicalDisplaySizeFromSystemProperties != null) {
return parsePhysicalDisplaySizeFromSystemProperties;
}
if (isSonyBravia4kTv(context) && isCurrentModeTheLargestMode(display)) {
return new Point(DISPLAY_SIZE_4K_WIDTH, DISPLAY_SIZE_4K_HEIGHT);
}
return null;
}
private static boolean isSonyBravia4kTv(Context context) {
return isTv(context) && "Sony".equals(Build.MANUFACTURER) && Build.MODEL.startsWith("BRAVIA") && context.getPackageManager().hasSystemFeature("com.sony.dtv.hardware.panel.qfhd");
}
static boolean isCurrentModeTheLargestMode(Display display) {
if (Build.VERSION.SDK_INT >= 23) {
return Api23Impl.isCurrentModeTheLargestMode(display);
}
return true;
}
static class Api23Impl {
private Api23Impl() {
}
static ModeCompat getMode(Context context, Display display) {
Display.Mode mode = display.getMode();
Point currentDisplaySizeFromWorkarounds = DisplayCompat.getCurrentDisplaySizeFromWorkarounds(context, display);
if (currentDisplaySizeFromWorkarounds == null || physicalSizeEquals(mode, currentDisplaySizeFromWorkarounds)) {
return new ModeCompat(mode, true);
}
return new ModeCompat(mode, currentDisplaySizeFromWorkarounds);
}
public static ModeCompat[] getSupportedModes(Context context, Display display) {
ModeCompat modeCompat;
Display.Mode[] supportedModes = display.getSupportedModes();
ModeCompat[] modeCompatArr = new ModeCompat[supportedModes.length];
Display.Mode mode = display.getMode();
Point currentDisplaySizeFromWorkarounds = DisplayCompat.getCurrentDisplaySizeFromWorkarounds(context, display);
if (currentDisplaySizeFromWorkarounds == null || physicalSizeEquals(mode, currentDisplaySizeFromWorkarounds)) {
for (int i = 0; i < supportedModes.length; i++) {
modeCompatArr[i] = new ModeCompat(supportedModes[i], physicalSizeEquals(supportedModes[i], mode));
}
} else {
for (int i2 = 0; i2 < supportedModes.length; i2++) {
if (physicalSizeEquals(supportedModes[i2], mode)) {
modeCompat = new ModeCompat(supportedModes[i2], currentDisplaySizeFromWorkarounds);
} else {
modeCompat = new ModeCompat(supportedModes[i2], false);
}
modeCompatArr[i2] = modeCompat;
}
}
return modeCompatArr;
}
static boolean isCurrentModeTheLargestMode(Display display) {
Display.Mode mode = display.getMode();
for (Display.Mode mode2 : display.getSupportedModes()) {
if (mode.getPhysicalHeight() < mode2.getPhysicalHeight() || mode.getPhysicalWidth() < mode2.getPhysicalWidth()) {
return false;
}
}
return true;
}
static boolean physicalSizeEquals(Display.Mode mode, Point point) {
return (mode.getPhysicalWidth() == point.x && mode.getPhysicalHeight() == point.y) || (mode.getPhysicalWidth() == point.y && mode.getPhysicalHeight() == point.x);
}
static boolean physicalSizeEquals(Display.Mode mode, Display.Mode mode2) {
return mode.getPhysicalWidth() == mode2.getPhysicalWidth() && mode.getPhysicalHeight() == mode2.getPhysicalHeight();
}
}
static class Api17Impl {
private Api17Impl() {
}
static void getRealSize(Display display, Point point) {
display.getRealSize(point);
}
}
public static final class ModeCompat {
private final boolean mIsNative;
private final Display.Mode mMode;
private final Point mPhysicalSize;
@Deprecated
public boolean isNative() {
return this.mIsNative;
}
public Display.Mode toMode() {
return this.mMode;
}
ModeCompat(Point point) {
Preconditions.checkNotNull(point, "physicalSize == null");
this.mPhysicalSize = point;
this.mMode = null;
this.mIsNative = true;
}
ModeCompat(Display.Mode mode, boolean z) {
Preconditions.checkNotNull(mode, "mode == null, can't wrap a null reference");
this.mPhysicalSize = new Point(Api23Impl.getPhysicalWidth(mode), Api23Impl.getPhysicalHeight(mode));
this.mMode = mode;
this.mIsNative = z;
}
ModeCompat(Display.Mode mode, Point point) {
Preconditions.checkNotNull(mode, "mode == null, can't wrap a null reference");
Preconditions.checkNotNull(point, "physicalSize == null");
this.mPhysicalSize = point;
this.mMode = mode;
this.mIsNative = true;
}
public int getPhysicalWidth() {
return this.mPhysicalSize.x;
}
public int getPhysicalHeight() {
return this.mPhysicalSize.y;
}
static class Api23Impl {
private Api23Impl() {
}
static int getPhysicalWidth(Display.Mode mode) {
return mode.getPhysicalWidth();
}
static int getPhysicalHeight(Display.Mode mode) {
return mode.getPhysicalHeight();
}
}
}
}

View File

@ -0,0 +1,182 @@
package androidx.core.view;
import android.graphics.Rect;
import android.os.Build;
import android.view.DisplayCutout;
import androidx.core.graphics.Insets;
import androidx.core.util.ObjectsCompat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/* loaded from: classes.dex */
public final class DisplayCutoutCompat {
private final DisplayCutout mDisplayCutout;
DisplayCutout unwrap() {
return this.mDisplayCutout;
}
public DisplayCutoutCompat(Rect rect, List<Rect> list) {
this(Build.VERSION.SDK_INT >= 28 ? Api28Impl.createDisplayCutout(rect, list) : null);
}
public DisplayCutoutCompat(Insets insets, Rect rect, Rect rect2, Rect rect3, Rect rect4, Insets insets2) {
this(constructDisplayCutout(insets, rect, rect2, rect3, rect4, insets2));
}
private static DisplayCutout constructDisplayCutout(Insets insets, Rect rect, Rect rect2, Rect rect3, Rect rect4, Insets insets2) {
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.createDisplayCutout(insets.toPlatformInsets(), rect, rect2, rect3, rect4, insets2.toPlatformInsets());
}
if (Build.VERSION.SDK_INT >= 29) {
return Api29Impl.createDisplayCutout(insets.toPlatformInsets(), rect, rect2, rect3, rect4);
}
if (Build.VERSION.SDK_INT < 28) {
return null;
}
Rect rect5 = new Rect(insets.left, insets.top, insets.right, insets.bottom);
ArrayList arrayList = new ArrayList();
if (rect != null) {
arrayList.add(rect);
}
if (rect2 != null) {
arrayList.add(rect2);
}
if (rect3 != null) {
arrayList.add(rect3);
}
if (rect4 != null) {
arrayList.add(rect4);
}
return Api28Impl.createDisplayCutout(rect5, arrayList);
}
private DisplayCutoutCompat(DisplayCutout displayCutout) {
this.mDisplayCutout = displayCutout;
}
public int getSafeInsetTop() {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getSafeInsetTop(this.mDisplayCutout);
}
return 0;
}
public int getSafeInsetBottom() {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getSafeInsetBottom(this.mDisplayCutout);
}
return 0;
}
public int getSafeInsetLeft() {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getSafeInsetLeft(this.mDisplayCutout);
}
return 0;
}
public int getSafeInsetRight() {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getSafeInsetRight(this.mDisplayCutout);
}
return 0;
}
public List<Rect> getBoundingRects() {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getBoundingRects(this.mDisplayCutout);
}
return Collections.emptyList();
}
public Insets getWaterfallInsets() {
if (Build.VERSION.SDK_INT >= 30) {
return Insets.toCompatInsets(Api30Impl.getWaterfallInsets(this.mDisplayCutout));
}
return Insets.NONE;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return ObjectsCompat.equals(this.mDisplayCutout, ((DisplayCutoutCompat) obj).mDisplayCutout);
}
public int hashCode() {
int hashCode;
DisplayCutout displayCutout = this.mDisplayCutout;
if (displayCutout == null) {
return 0;
}
hashCode = displayCutout.hashCode();
return hashCode;
}
public String toString() {
return "DisplayCutoutCompat{" + this.mDisplayCutout + "}";
}
static DisplayCutoutCompat wrap(DisplayCutout displayCutout) {
if (displayCutout == null) {
return null;
}
return new DisplayCutoutCompat(displayCutout);
}
static class Api28Impl {
private Api28Impl() {
}
static DisplayCutout createDisplayCutout(Rect rect, List<Rect> list) {
return new DisplayCutout(rect, list);
}
static int getSafeInsetTop(DisplayCutout displayCutout) {
return displayCutout.getSafeInsetTop();
}
static int getSafeInsetBottom(DisplayCutout displayCutout) {
return displayCutout.getSafeInsetBottom();
}
static int getSafeInsetLeft(DisplayCutout displayCutout) {
return displayCutout.getSafeInsetLeft();
}
static int getSafeInsetRight(DisplayCutout displayCutout) {
return displayCutout.getSafeInsetRight();
}
static List<Rect> getBoundingRects(DisplayCutout displayCutout) {
return displayCutout.getBoundingRects();
}
}
static class Api30Impl {
private Api30Impl() {
}
static DisplayCutout createDisplayCutout(android.graphics.Insets insets, Rect rect, Rect rect2, Rect rect3, Rect rect4, android.graphics.Insets insets2) {
return new DisplayCutout(insets, rect, rect2, rect3, rect4, insets2);
}
static android.graphics.Insets getWaterfallInsets(DisplayCutout displayCutout) {
return displayCutout.getWaterfallInsets();
}
}
static class Api29Impl {
private Api29Impl() {
}
static DisplayCutout createDisplayCutout(android.graphics.Insets insets, Rect rect, Rect rect2, Rect rect3, Rect rect4) {
return new DisplayCutout(insets, rect, rect2, rect3, rect4);
}
}
}

View File

@ -0,0 +1,42 @@
package androidx.core.view;
import android.app.Activity;
import android.os.Build;
import android.view.DragAndDropPermissions;
import android.view.DragEvent;
/* loaded from: classes.dex */
public final class DragAndDropPermissionsCompat {
private final DragAndDropPermissions mDragAndDropPermissions;
private DragAndDropPermissionsCompat(DragAndDropPermissions dragAndDropPermissions) {
this.mDragAndDropPermissions = dragAndDropPermissions;
}
public static DragAndDropPermissionsCompat request(Activity activity, DragEvent dragEvent) {
DragAndDropPermissions requestDragAndDropPermissions;
if (Build.VERSION.SDK_INT < 24 || (requestDragAndDropPermissions = Api24Impl.requestDragAndDropPermissions(activity, dragEvent)) == null) {
return null;
}
return new DragAndDropPermissionsCompat(requestDragAndDropPermissions);
}
public void release() {
if (Build.VERSION.SDK_INT >= 24) {
Api24Impl.release(this.mDragAndDropPermissions);
}
}
static class Api24Impl {
private Api24Impl() {
}
static DragAndDropPermissions requestDragAndDropPermissions(Activity activity, DragEvent dragEvent) {
return activity.requestDragAndDropPermissions(dragEvent);
}
static void release(DragAndDropPermissions dragAndDropPermissions) {
dragAndDropPermissions.release();
}
}
}

View File

@ -0,0 +1,115 @@
package androidx.core.view;
import android.graphics.Point;
import android.view.MotionEvent;
import android.view.View;
/* loaded from: classes.dex */
public class DragStartHelper {
private boolean mDragging;
private int mLastTouchX;
private int mLastTouchY;
private final OnDragStartListener mListener;
private final View.OnLongClickListener mLongClickListener = new View.OnLongClickListener() { // from class: androidx.core.view.DragStartHelper$$ExternalSyntheticLambda0
@Override // android.view.View.OnLongClickListener
public final boolean onLongClick(View view) {
return DragStartHelper.this.onLongClick(view);
}
};
private final View.OnTouchListener mTouchListener = new View.OnTouchListener() { // from class: androidx.core.view.DragStartHelper$$ExternalSyntheticLambda1
@Override // android.view.View.OnTouchListener
public final boolean onTouch(View view, MotionEvent motionEvent) {
return DragStartHelper.this.onTouch(view, motionEvent);
}
};
private final View mView;
public interface OnDragStartListener {
boolean onDragStart(View view, DragStartHelper dragStartHelper);
}
public DragStartHelper(View view, OnDragStartListener onDragStartListener) {
this.mView = view;
this.mListener = onDragStartListener;
}
public void attach() {
this.mView.setOnLongClickListener(this.mLongClickListener);
this.mView.setOnTouchListener(this.mTouchListener);
}
public void detach() {
this.mView.setOnLongClickListener(null);
this.mView.setOnTouchListener(null);
}
/* JADX WARN: Code restructure failed: missing block: B:8:0x0018, code lost:
if (r2 != 3) goto L28;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public boolean onTouch(android.view.View r7, android.view.MotionEvent r8) {
/*
r6 = this;
float r0 = r8.getX()
int r0 = (int) r0
float r1 = r8.getY()
int r1 = (int) r1
int r2 = r8.getAction()
r3 = 0
if (r2 == 0) goto L49
r4 = 1
if (r2 == r4) goto L46
r5 = 2
if (r2 == r5) goto L1b
r7 = 3
if (r2 == r7) goto L46
goto L4d
L1b:
r2 = 8194(0x2002, float:1.1482E-41)
boolean r2 = androidx.core.view.MotionEventCompat.isFromSource(r8, r2)
if (r2 == 0) goto L4d
int r8 = r8.getButtonState()
r8 = r8 & r4
if (r8 != 0) goto L2b
goto L4d
L2b:
boolean r8 = r6.mDragging
if (r8 == 0) goto L30
goto L4d
L30:
int r8 = r6.mLastTouchX
if (r8 != r0) goto L39
int r8 = r6.mLastTouchY
if (r8 != r1) goto L39
goto L4d
L39:
r6.mLastTouchX = r0
r6.mLastTouchY = r1
androidx.core.view.DragStartHelper$OnDragStartListener r8 = r6.mListener
boolean r7 = r8.onDragStart(r7, r6)
r6.mDragging = r7
return r7
L46:
r6.mDragging = r3
goto L4d
L49:
r6.mLastTouchX = r0
r6.mLastTouchY = r1
L4d:
return r3
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.view.DragStartHelper.onTouch(android.view.View, android.view.MotionEvent):boolean");
}
public boolean onLongClick(View view) {
return this.mListener.onDragStart(view, this);
}
public void getTouchPosition(Point point) {
point.set(this.mLastTouchX, this.mLastTouchY);
}
}

View File

@ -0,0 +1,245 @@
package androidx.core.view;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.ViewConfiguration;
/* loaded from: classes.dex */
public final class GestureDetectorCompat {
private final GestureDetectorCompatImpl mImpl;
interface GestureDetectorCompatImpl {
boolean isLongpressEnabled();
boolean onTouchEvent(MotionEvent motionEvent);
void setIsLongpressEnabled(boolean z);
void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener onDoubleTapListener);
}
static class GestureDetectorCompatImplBase implements GestureDetectorCompatImpl {
private static final int LONG_PRESS = 2;
private static final int SHOW_PRESS = 1;
private static final int TAP = 3;
private boolean mAlwaysInBiggerTapRegion;
private boolean mAlwaysInTapRegion;
MotionEvent mCurrentDownEvent;
boolean mDeferConfirmSingleTap;
GestureDetector.OnDoubleTapListener mDoubleTapListener;
private int mDoubleTapSlopSquare;
private float mDownFocusX;
private float mDownFocusY;
private final Handler mHandler;
private boolean mInLongPress;
private boolean mIsDoubleTapping;
private boolean mIsLongpressEnabled;
private float mLastFocusX;
private float mLastFocusY;
final GestureDetector.OnGestureListener mListener;
private int mMaximumFlingVelocity;
private int mMinimumFlingVelocity;
private MotionEvent mPreviousUpEvent;
boolean mStillDown;
private int mTouchSlopSquare;
private VelocityTracker mVelocityTracker;
private static final int TAP_TIMEOUT = ViewConfiguration.getTapTimeout();
private static final int DOUBLE_TAP_TIMEOUT = ViewConfiguration.getDoubleTapTimeout();
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
public boolean isLongpressEnabled() {
return this.mIsLongpressEnabled;
}
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
public void setIsLongpressEnabled(boolean z) {
this.mIsLongpressEnabled = z;
}
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener onDoubleTapListener) {
this.mDoubleTapListener = onDoubleTapListener;
}
private class GestureHandler extends Handler {
GestureHandler() {
}
GestureHandler(Handler handler) {
super(handler.getLooper());
}
@Override // android.os.Handler
public void handleMessage(Message message) {
int i = message.what;
if (i == 1) {
GestureDetectorCompatImplBase.this.mListener.onShowPress(GestureDetectorCompatImplBase.this.mCurrentDownEvent);
return;
}
if (i == 2) {
GestureDetectorCompatImplBase.this.dispatchLongPress();
return;
}
if (i == 3) {
if (GestureDetectorCompatImplBase.this.mDoubleTapListener != null) {
if (!GestureDetectorCompatImplBase.this.mStillDown) {
GestureDetectorCompatImplBase.this.mDoubleTapListener.onSingleTapConfirmed(GestureDetectorCompatImplBase.this.mCurrentDownEvent);
return;
} else {
GestureDetectorCompatImplBase.this.mDeferConfirmSingleTap = true;
return;
}
}
return;
}
throw new RuntimeException("Unknown message " + message);
}
}
GestureDetectorCompatImplBase(Context context, GestureDetector.OnGestureListener onGestureListener, Handler handler) {
if (handler != null) {
this.mHandler = new GestureHandler(handler);
} else {
this.mHandler = new GestureHandler();
}
this.mListener = onGestureListener;
if (onGestureListener instanceof GestureDetector.OnDoubleTapListener) {
setOnDoubleTapListener((GestureDetector.OnDoubleTapListener) onGestureListener);
}
init(context);
}
private void init(Context context) {
if (context == null) {
throw new IllegalArgumentException("Context must not be null");
}
if (this.mListener == null) {
throw new IllegalArgumentException("OnGestureListener must not be null");
}
this.mIsLongpressEnabled = true;
ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
int scaledTouchSlop = viewConfiguration.getScaledTouchSlop();
int scaledDoubleTapSlop = viewConfiguration.getScaledDoubleTapSlop();
this.mMinimumFlingVelocity = viewConfiguration.getScaledMinimumFlingVelocity();
this.mMaximumFlingVelocity = viewConfiguration.getScaledMaximumFlingVelocity();
this.mTouchSlopSquare = scaledTouchSlop * scaledTouchSlop;
this.mDoubleTapSlopSquare = scaledDoubleTapSlop * scaledDoubleTapSlop;
}
/* JADX WARN: Removed duplicated region for block: B:114:0x0205 */
/* JADX WARN: Removed duplicated region for block: B:117:0x021c */
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public boolean onTouchEvent(android.view.MotionEvent r13) {
/*
Method dump skipped, instructions count: 590
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImplBase.onTouchEvent(android.view.MotionEvent):boolean");
}
private void cancel() {
this.mHandler.removeMessages(1);
this.mHandler.removeMessages(2);
this.mHandler.removeMessages(3);
this.mVelocityTracker.recycle();
this.mVelocityTracker = null;
this.mIsDoubleTapping = false;
this.mStillDown = false;
this.mAlwaysInTapRegion = false;
this.mAlwaysInBiggerTapRegion = false;
this.mDeferConfirmSingleTap = false;
if (this.mInLongPress) {
this.mInLongPress = false;
}
}
private void cancelTaps() {
this.mHandler.removeMessages(1);
this.mHandler.removeMessages(2);
this.mHandler.removeMessages(3);
this.mIsDoubleTapping = false;
this.mAlwaysInTapRegion = false;
this.mAlwaysInBiggerTapRegion = false;
this.mDeferConfirmSingleTap = false;
if (this.mInLongPress) {
this.mInLongPress = false;
}
}
private boolean isConsideredDoubleTap(MotionEvent motionEvent, MotionEvent motionEvent2, MotionEvent motionEvent3) {
if (!this.mAlwaysInBiggerTapRegion || motionEvent3.getEventTime() - motionEvent2.getEventTime() > DOUBLE_TAP_TIMEOUT) {
return false;
}
int x = ((int) motionEvent.getX()) - ((int) motionEvent3.getX());
int y = ((int) motionEvent.getY()) - ((int) motionEvent3.getY());
return (x * x) + (y * y) < this.mDoubleTapSlopSquare;
}
void dispatchLongPress() {
this.mHandler.removeMessages(3);
this.mDeferConfirmSingleTap = false;
this.mInLongPress = true;
this.mListener.onLongPress(this.mCurrentDownEvent);
}
}
static class GestureDetectorCompatImplJellybeanMr2 implements GestureDetectorCompatImpl {
private final GestureDetector mDetector;
GestureDetectorCompatImplJellybeanMr2(Context context, GestureDetector.OnGestureListener onGestureListener, Handler handler) {
this.mDetector = new GestureDetector(context, onGestureListener, handler);
}
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
public boolean isLongpressEnabled() {
return this.mDetector.isLongpressEnabled();
}
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
public boolean onTouchEvent(MotionEvent motionEvent) {
return this.mDetector.onTouchEvent(motionEvent);
}
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
public void setIsLongpressEnabled(boolean z) {
this.mDetector.setIsLongpressEnabled(z);
}
@Override // androidx.core.view.GestureDetectorCompat.GestureDetectorCompatImpl
public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener onDoubleTapListener) {
this.mDetector.setOnDoubleTapListener(onDoubleTapListener);
}
}
public GestureDetectorCompat(Context context, GestureDetector.OnGestureListener onGestureListener) {
this(context, onGestureListener, null);
}
public GestureDetectorCompat(Context context, GestureDetector.OnGestureListener onGestureListener, Handler handler) {
this.mImpl = new GestureDetectorCompatImplJellybeanMr2(context, onGestureListener, handler);
}
public boolean isLongpressEnabled() {
return this.mImpl.isLongpressEnabled();
}
public boolean onTouchEvent(MotionEvent motionEvent) {
return this.mImpl.onTouchEvent(motionEvent);
}
public void setIsLongpressEnabled(boolean z) {
this.mImpl.setIsLongpressEnabled(z);
}
public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener onDoubleTapListener) {
this.mImpl.setOnDoubleTapListener(onDoubleTapListener);
}
}

View File

@ -0,0 +1,48 @@
package androidx.core.view;
import android.graphics.Rect;
import android.view.Gravity;
/* loaded from: classes.dex */
public final class GravityCompat {
public static final int END = 8388613;
public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = 8388615;
public static final int RELATIVE_LAYOUT_DIRECTION = 8388608;
public static final int START = 8388611;
public static void apply(int i, int i2, int i3, Rect rect, Rect rect2, int i4) {
Api17Impl.apply(i, i2, i3, rect, rect2, i4);
}
public static void apply(int i, int i2, int i3, Rect rect, int i4, int i5, Rect rect2, int i6) {
Api17Impl.apply(i, i2, i3, rect, i4, i5, rect2, i6);
}
public static void applyDisplay(int i, Rect rect, Rect rect2, int i2) {
Api17Impl.applyDisplay(i, rect, rect2, i2);
}
public static int getAbsoluteGravity(int i, int i2) {
return Gravity.getAbsoluteGravity(i, i2);
}
private GravityCompat() {
}
static class Api17Impl {
private Api17Impl() {
}
static void apply(int i, int i2, int i3, Rect rect, Rect rect2, int i4) {
Gravity.apply(i, i2, i3, rect, rect2, i4);
}
static void apply(int i, int i2, int i3, Rect rect, int i4, int i5, Rect rect2, int i6) {
Gravity.apply(i, i2, i3, rect, i4, i5, rect2, i6);
}
static void applyDisplay(int i, Rect rect, Rect rect2, int i2) {
Gravity.applyDisplay(i, rect, rect2, i2);
}
}
}

View File

@ -0,0 +1,29 @@
package androidx.core.view;
/* loaded from: classes.dex */
public final class InputDeviceCompat {
public static final int SOURCE_ANY = -256;
public static final int SOURCE_CLASS_BUTTON = 1;
public static final int SOURCE_CLASS_JOYSTICK = 16;
public static final int SOURCE_CLASS_MASK = 255;
public static final int SOURCE_CLASS_NONE = 0;
public static final int SOURCE_CLASS_POINTER = 2;
public static final int SOURCE_CLASS_POSITION = 8;
public static final int SOURCE_CLASS_TRACKBALL = 4;
public static final int SOURCE_DPAD = 513;
public static final int SOURCE_GAMEPAD = 1025;
public static final int SOURCE_HDMI = 33554433;
public static final int SOURCE_JOYSTICK = 16777232;
public static final int SOURCE_KEYBOARD = 257;
public static final int SOURCE_MOUSE = 8194;
public static final int SOURCE_ROTARY_ENCODER = 4194304;
public static final int SOURCE_STYLUS = 16386;
public static final int SOURCE_TOUCHPAD = 1048584;
public static final int SOURCE_TOUCHSCREEN = 4098;
public static final int SOURCE_TOUCH_NAVIGATION = 2097152;
public static final int SOURCE_TRACKBALL = 65540;
public static final int SOURCE_UNKNOWN = 0;
private InputDeviceCompat() {
}
}

View File

@ -0,0 +1,126 @@
package androidx.core.view;
import android.app.ActionBar;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Build;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public class KeyEventDispatcher {
private static boolean sActionBarFieldsFetched = false;
private static Method sActionBarOnMenuKeyMethod = null;
private static boolean sDialogFieldsFetched = false;
private static Field sDialogKeyListenerField;
public interface Component {
boolean superDispatchKeyEvent(KeyEvent keyEvent);
}
private KeyEventDispatcher() {
}
public static boolean dispatchBeforeHierarchy(View view, KeyEvent keyEvent) {
return ViewCompat.dispatchUnhandledKeyEventBeforeHierarchy(view, keyEvent);
}
public static boolean dispatchKeyEvent(Component component, View view, Window.Callback callback, KeyEvent keyEvent) {
if (component == null) {
return false;
}
if (Build.VERSION.SDK_INT >= 28) {
return component.superDispatchKeyEvent(keyEvent);
}
if (callback instanceof Activity) {
return activitySuperDispatchKeyEventPre28((Activity) callback, keyEvent);
}
if (callback instanceof Dialog) {
return dialogSuperDispatchKeyEventPre28((Dialog) callback, keyEvent);
}
return (view != null && ViewCompat.dispatchUnhandledKeyEventBeforeCallback(view, keyEvent)) || component.superDispatchKeyEvent(keyEvent);
}
private static boolean actionBarOnMenuKeyEventPre28(ActionBar actionBar, KeyEvent keyEvent) {
if (!sActionBarFieldsFetched) {
try {
sActionBarOnMenuKeyMethod = actionBar.getClass().getMethod("onMenuKeyEvent", KeyEvent.class);
} catch (NoSuchMethodException unused) {
}
sActionBarFieldsFetched = true;
}
Method method = sActionBarOnMenuKeyMethod;
if (method != null) {
try {
Object invoke = method.invoke(actionBar, keyEvent);
if (invoke == null) {
return false;
}
return ((Boolean) invoke).booleanValue();
} catch (IllegalAccessException | InvocationTargetException unused2) {
}
}
return false;
}
private static boolean activitySuperDispatchKeyEventPre28(Activity activity, KeyEvent keyEvent) {
activity.onUserInteraction();
Window window = activity.getWindow();
if (window.hasFeature(8)) {
ActionBar actionBar = activity.getActionBar();
if (keyEvent.getKeyCode() == 82 && actionBar != null && actionBarOnMenuKeyEventPre28(actionBar, keyEvent)) {
return true;
}
}
if (window.superDispatchKeyEvent(keyEvent)) {
return true;
}
View decorView = window.getDecorView();
if (ViewCompat.dispatchUnhandledKeyEventBeforeCallback(decorView, keyEvent)) {
return true;
}
return keyEvent.dispatch(activity, decorView != null ? decorView.getKeyDispatcherState() : null, activity);
}
private static DialogInterface.OnKeyListener getDialogKeyListenerPre28(Dialog dialog) {
if (!sDialogFieldsFetched) {
try {
Field declaredField = Dialog.class.getDeclaredField("mOnKeyListener");
sDialogKeyListenerField = declaredField;
declaredField.setAccessible(true);
} catch (NoSuchFieldException unused) {
}
sDialogFieldsFetched = true;
}
Field field = sDialogKeyListenerField;
if (field == null) {
return null;
}
try {
return (DialogInterface.OnKeyListener) field.get(dialog);
} catch (IllegalAccessException unused2) {
return null;
}
}
private static boolean dialogSuperDispatchKeyEventPre28(Dialog dialog, KeyEvent keyEvent) {
DialogInterface.OnKeyListener dialogKeyListenerPre28 = getDialogKeyListenerPre28(dialog);
if (dialogKeyListenerPre28 != null && dialogKeyListenerPre28.onKey(dialog, keyEvent.getKeyCode(), keyEvent)) {
return true;
}
Window window = dialog.getWindow();
if (window.superDispatchKeyEvent(keyEvent)) {
return true;
}
View decorView = window.getDecorView();
if (ViewCompat.dispatchUnhandledKeyEventBeforeCallback(decorView, keyEvent)) {
return true;
}
return keyEvent.dispatch(dialog, decorView != null ? decorView.getKeyDispatcherState() : null, dialog);
}
}

View File

@ -0,0 +1,79 @@
package androidx.core.view;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import java.lang.reflect.Field;
/* loaded from: classes.dex */
public final class LayoutInflaterCompat {
private static final String TAG = "LayoutInflaterCompatHC";
private static boolean sCheckedField;
private static Field sLayoutInflaterFactory2Field;
static class Factory2Wrapper implements LayoutInflater.Factory2 {
final LayoutInflaterFactory mDelegateFactory;
Factory2Wrapper(LayoutInflaterFactory layoutInflaterFactory) {
this.mDelegateFactory = layoutInflaterFactory;
}
@Override // android.view.LayoutInflater.Factory
public View onCreateView(String str, Context context, AttributeSet attributeSet) {
return this.mDelegateFactory.onCreateView(null, str, context, attributeSet);
}
@Override // android.view.LayoutInflater.Factory2
public View onCreateView(View view, String str, Context context, AttributeSet attributeSet) {
return this.mDelegateFactory.onCreateView(view, str, context, attributeSet);
}
public String toString() {
return getClass().getName() + "{" + this.mDelegateFactory + "}";
}
}
private static void forceSetFactory2(LayoutInflater layoutInflater, LayoutInflater.Factory2 factory2) {
if (!sCheckedField) {
try {
Field declaredField = LayoutInflater.class.getDeclaredField("mFactory2");
sLayoutInflaterFactory2Field = declaredField;
declaredField.setAccessible(true);
} catch (NoSuchFieldException e) {
Log.e(TAG, "forceSetFactory2 Could not find field 'mFactory2' on class " + LayoutInflater.class.getName() + "; inflation may have unexpected results.", e);
}
sCheckedField = true;
}
Field field = sLayoutInflaterFactory2Field;
if (field != null) {
try {
field.set(layoutInflater, factory2);
} catch (IllegalAccessException e2) {
Log.e(TAG, "forceSetFactory2 could not set the Factory2 on LayoutInflater " + layoutInflater + "; inflation may have unexpected results.", e2);
}
}
}
private LayoutInflaterCompat() {
}
@Deprecated
public static void setFactory(LayoutInflater layoutInflater, LayoutInflaterFactory layoutInflaterFactory) {
layoutInflater.setFactory2(new Factory2Wrapper(layoutInflaterFactory));
}
public static void setFactory2(LayoutInflater layoutInflater, LayoutInflater.Factory2 factory2) {
layoutInflater.setFactory2(factory2);
}
@Deprecated
public static LayoutInflaterFactory getFactory(LayoutInflater layoutInflater) {
LayoutInflater.Factory factory = layoutInflater.getFactory();
if (factory instanceof Factory2Wrapper) {
return ((Factory2Wrapper) factory).mDelegateFactory;
}
return null;
}
}

View File

@ -0,0 +1,11 @@
package androidx.core.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
@Deprecated
/* loaded from: classes.dex */
public interface LayoutInflaterFactory {
View onCreateView(View view, String str, Context context, AttributeSet attributeSet);
}

View File

@ -0,0 +1,82 @@
package androidx.core.view;
import android.view.ViewGroup;
/* loaded from: classes.dex */
public final class MarginLayoutParamsCompat {
public static int getMarginStart(ViewGroup.MarginLayoutParams marginLayoutParams) {
return Api17Impl.getMarginStart(marginLayoutParams);
}
public static int getMarginEnd(ViewGroup.MarginLayoutParams marginLayoutParams) {
return Api17Impl.getMarginEnd(marginLayoutParams);
}
public static void setMarginStart(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
Api17Impl.setMarginStart(marginLayoutParams, i);
}
public static void setMarginEnd(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
Api17Impl.setMarginEnd(marginLayoutParams, i);
}
public static boolean isMarginRelative(ViewGroup.MarginLayoutParams marginLayoutParams) {
return Api17Impl.isMarginRelative(marginLayoutParams);
}
public static int getLayoutDirection(ViewGroup.MarginLayoutParams marginLayoutParams) {
int layoutDirection = Api17Impl.getLayoutDirection(marginLayoutParams);
if (layoutDirection == 0 || layoutDirection == 1) {
return layoutDirection;
}
return 0;
}
public static void setLayoutDirection(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
Api17Impl.setLayoutDirection(marginLayoutParams, i);
}
public static void resolveLayoutDirection(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
Api17Impl.resolveLayoutDirection(marginLayoutParams, i);
}
private MarginLayoutParamsCompat() {
}
static class Api17Impl {
private Api17Impl() {
}
static int getMarginStart(ViewGroup.MarginLayoutParams marginLayoutParams) {
return marginLayoutParams.getMarginStart();
}
static int getMarginEnd(ViewGroup.MarginLayoutParams marginLayoutParams) {
return marginLayoutParams.getMarginEnd();
}
static void setMarginStart(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
marginLayoutParams.setMarginStart(i);
}
static void setMarginEnd(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
marginLayoutParams.setMarginEnd(i);
}
static boolean isMarginRelative(ViewGroup.MarginLayoutParams marginLayoutParams) {
return marginLayoutParams.isMarginRelative();
}
static int getLayoutDirection(ViewGroup.MarginLayoutParams marginLayoutParams) {
return marginLayoutParams.getLayoutDirection();
}
static void setLayoutDirection(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
marginLayoutParams.setLayoutDirection(i);
}
static void resolveLayoutDirection(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
marginLayoutParams.resolveLayoutDirection(i);
}
}
}

View File

@ -0,0 +1,34 @@
package androidx.core.view;
import android.os.Build;
import android.view.Menu;
import android.view.MenuItem;
import androidx.core.internal.view.SupportMenu;
/* loaded from: classes.dex */
public final class MenuCompat {
@Deprecated
public static void setShowAsAction(MenuItem menuItem, int i) {
menuItem.setShowAsAction(i);
}
public static void setGroupDividerEnabled(Menu menu, boolean z) {
if (menu instanceof SupportMenu) {
((SupportMenu) menu).setGroupDividerEnabled(z);
} else if (Build.VERSION.SDK_INT >= 28) {
Api28Impl.setGroupDividerEnabled(menu, z);
}
}
private MenuCompat() {
}
static class Api28Impl {
private Api28Impl() {
}
static void setGroupDividerEnabled(Menu menu, boolean z) {
menu.setGroupDividerEnabled(z);
}
}
}

View File

@ -0,0 +1,17 @@
package androidx.core.view;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
/* loaded from: classes.dex */
public interface MenuHost {
void addMenuProvider(MenuProvider menuProvider);
void addMenuProvider(MenuProvider menuProvider, LifecycleOwner lifecycleOwner);
void addMenuProvider(MenuProvider menuProvider, LifecycleOwner lifecycleOwner, Lifecycle.State state);
void invalidateMenu();
void removeMenuProvider(MenuProvider menuProvider);
}

View File

@ -0,0 +1,134 @@
package androidx.core.view;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
/* loaded from: classes.dex */
public class MenuHostHelper {
private final Runnable mOnInvalidateMenuCallback;
private final CopyOnWriteArrayList<MenuProvider> mMenuProviders = new CopyOnWriteArrayList<>();
private final Map<MenuProvider, LifecycleContainer> mProviderToLifecycleContainers = new HashMap();
public MenuHostHelper(Runnable runnable) {
this.mOnInvalidateMenuCallback = runnable;
}
public void onPrepareMenu(Menu menu) {
Iterator<MenuProvider> it = this.mMenuProviders.iterator();
while (it.hasNext()) {
it.next().onPrepareMenu(menu);
}
}
public void onCreateMenu(Menu menu, MenuInflater menuInflater) {
Iterator<MenuProvider> it = this.mMenuProviders.iterator();
while (it.hasNext()) {
it.next().onCreateMenu(menu, menuInflater);
}
}
public boolean onMenuItemSelected(MenuItem menuItem) {
Iterator<MenuProvider> it = this.mMenuProviders.iterator();
while (it.hasNext()) {
if (it.next().onMenuItemSelected(menuItem)) {
return true;
}
}
return false;
}
public void onMenuClosed(Menu menu) {
Iterator<MenuProvider> it = this.mMenuProviders.iterator();
while (it.hasNext()) {
it.next().onMenuClosed(menu);
}
}
public void addMenuProvider(MenuProvider menuProvider) {
this.mMenuProviders.add(menuProvider);
this.mOnInvalidateMenuCallback.run();
}
public void addMenuProvider(final MenuProvider menuProvider, LifecycleOwner lifecycleOwner) {
addMenuProvider(menuProvider);
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
LifecycleContainer remove = this.mProviderToLifecycleContainers.remove(menuProvider);
if (remove != null) {
remove.clearObservers();
}
this.mProviderToLifecycleContainers.put(menuProvider, new LifecycleContainer(lifecycle, new LifecycleEventObserver() { // from class: androidx.core.view.MenuHostHelper$$ExternalSyntheticLambda0
@Override // androidx.lifecycle.LifecycleEventObserver
public final void onStateChanged(LifecycleOwner lifecycleOwner2, Lifecycle.Event event) {
MenuHostHelper.this.m159lambda$addMenuProvider$0$androidxcoreviewMenuHostHelper(menuProvider, lifecycleOwner2, event);
}
}));
}
/* renamed from: lambda$addMenuProvider$0$androidx-core-view-MenuHostHelper, reason: not valid java name */
/* synthetic */ void m159lambda$addMenuProvider$0$androidxcoreviewMenuHostHelper(MenuProvider menuProvider, LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
if (event == Lifecycle.Event.ON_DESTROY) {
removeMenuProvider(menuProvider);
}
}
public void addMenuProvider(final MenuProvider menuProvider, LifecycleOwner lifecycleOwner, final Lifecycle.State state) {
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
LifecycleContainer remove = this.mProviderToLifecycleContainers.remove(menuProvider);
if (remove != null) {
remove.clearObservers();
}
this.mProviderToLifecycleContainers.put(menuProvider, new LifecycleContainer(lifecycle, new LifecycleEventObserver() { // from class: androidx.core.view.MenuHostHelper$$ExternalSyntheticLambda1
@Override // androidx.lifecycle.LifecycleEventObserver
public final void onStateChanged(LifecycleOwner lifecycleOwner2, Lifecycle.Event event) {
MenuHostHelper.this.m160lambda$addMenuProvider$1$androidxcoreviewMenuHostHelper(state, menuProvider, lifecycleOwner2, event);
}
}));
}
/* renamed from: lambda$addMenuProvider$1$androidx-core-view-MenuHostHelper, reason: not valid java name */
/* synthetic */ void m160lambda$addMenuProvider$1$androidxcoreviewMenuHostHelper(Lifecycle.State state, MenuProvider menuProvider, LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
if (event == Lifecycle.Event.upTo(state)) {
addMenuProvider(menuProvider);
return;
}
if (event == Lifecycle.Event.ON_DESTROY) {
removeMenuProvider(menuProvider);
} else if (event == Lifecycle.Event.downFrom(state)) {
this.mMenuProviders.remove(menuProvider);
this.mOnInvalidateMenuCallback.run();
}
}
public void removeMenuProvider(MenuProvider menuProvider) {
this.mMenuProviders.remove(menuProvider);
LifecycleContainer remove = this.mProviderToLifecycleContainers.remove(menuProvider);
if (remove != null) {
remove.clearObservers();
}
this.mOnInvalidateMenuCallback.run();
}
private static class LifecycleContainer {
final Lifecycle mLifecycle;
private LifecycleEventObserver mObserver;
LifecycleContainer(Lifecycle lifecycle, LifecycleEventObserver lifecycleEventObserver) {
this.mLifecycle = lifecycle;
this.mObserver = lifecycleEventObserver;
lifecycle.addObserver(lifecycleEventObserver);
}
void clearObservers() {
this.mLifecycle.removeObserver(this.mObserver);
this.mObserver = null;
}
}
}

View File

@ -0,0 +1,278 @@
package androidx.core.view;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.os.Build;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import androidx.core.internal.view.SupportMenuItem;
/* loaded from: classes.dex */
public final class MenuItemCompat {
@Deprecated
public static final int SHOW_AS_ACTION_ALWAYS = 2;
@Deprecated
public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8;
@Deprecated
public static final int SHOW_AS_ACTION_IF_ROOM = 1;
@Deprecated
public static final int SHOW_AS_ACTION_NEVER = 0;
@Deprecated
public static final int SHOW_AS_ACTION_WITH_TEXT = 4;
private static final String TAG = "MenuItemCompat";
@Deprecated
public interface OnActionExpandListener {
boolean onMenuItemActionCollapse(MenuItem menuItem);
boolean onMenuItemActionExpand(MenuItem menuItem);
}
@Deprecated
public static void setShowAsAction(MenuItem menuItem, int i) {
menuItem.setShowAsAction(i);
}
@Deprecated
public static MenuItem setActionView(MenuItem menuItem, View view) {
return menuItem.setActionView(view);
}
@Deprecated
public static MenuItem setActionView(MenuItem menuItem, int i) {
return menuItem.setActionView(i);
}
@Deprecated
public static View getActionView(MenuItem menuItem) {
return menuItem.getActionView();
}
public static MenuItem setActionProvider(MenuItem menuItem, ActionProvider actionProvider) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).setSupportActionProvider(actionProvider);
}
Log.w(TAG, "setActionProvider: item does not implement SupportMenuItem; ignoring");
return menuItem;
}
public static ActionProvider getActionProvider(MenuItem menuItem) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).getSupportActionProvider();
}
Log.w(TAG, "getActionProvider: item does not implement SupportMenuItem; returning null");
return null;
}
@Deprecated
public static boolean expandActionView(MenuItem menuItem) {
return menuItem.expandActionView();
}
@Deprecated
public static boolean collapseActionView(MenuItem menuItem) {
return menuItem.collapseActionView();
}
@Deprecated
public static boolean isActionViewExpanded(MenuItem menuItem) {
return menuItem.isActionViewExpanded();
}
@Deprecated
public static MenuItem setOnActionExpandListener(MenuItem menuItem, final OnActionExpandListener onActionExpandListener) {
return menuItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() { // from class: androidx.core.view.MenuItemCompat.1
@Override // android.view.MenuItem.OnActionExpandListener
public boolean onMenuItemActionExpand(MenuItem menuItem2) {
return OnActionExpandListener.this.onMenuItemActionExpand(menuItem2);
}
@Override // android.view.MenuItem.OnActionExpandListener
public boolean onMenuItemActionCollapse(MenuItem menuItem2) {
return OnActionExpandListener.this.onMenuItemActionCollapse(menuItem2);
}
});
}
public static void setContentDescription(MenuItem menuItem, CharSequence charSequence) {
if (menuItem instanceof SupportMenuItem) {
((SupportMenuItem) menuItem).setContentDescription(charSequence);
} else if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.setContentDescription(menuItem, charSequence);
}
}
public static CharSequence getContentDescription(MenuItem menuItem) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).getContentDescription();
}
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getContentDescription(menuItem);
}
return null;
}
public static void setTooltipText(MenuItem menuItem, CharSequence charSequence) {
if (menuItem instanceof SupportMenuItem) {
((SupportMenuItem) menuItem).setTooltipText(charSequence);
} else if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.setTooltipText(menuItem, charSequence);
}
}
public static CharSequence getTooltipText(MenuItem menuItem) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).getTooltipText();
}
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getTooltipText(menuItem);
}
return null;
}
public static void setShortcut(MenuItem menuItem, char c, char c2, int i, int i2) {
if (menuItem instanceof SupportMenuItem) {
((SupportMenuItem) menuItem).setShortcut(c, c2, i, i2);
} else if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.setShortcut(menuItem, c, c2, i, i2);
}
}
public static void setNumericShortcut(MenuItem menuItem, char c, int i) {
if (menuItem instanceof SupportMenuItem) {
((SupportMenuItem) menuItem).setNumericShortcut(c, i);
} else if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.setNumericShortcut(menuItem, c, i);
}
}
public static int getNumericModifiers(MenuItem menuItem) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).getNumericModifiers();
}
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getNumericModifiers(menuItem);
}
return 0;
}
public static void setAlphabeticShortcut(MenuItem menuItem, char c, int i) {
if (menuItem instanceof SupportMenuItem) {
((SupportMenuItem) menuItem).setAlphabeticShortcut(c, i);
} else if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.setAlphabeticShortcut(menuItem, c, i);
}
}
public static int getAlphabeticModifiers(MenuItem menuItem) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).getAlphabeticModifiers();
}
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getAlphabeticModifiers(menuItem);
}
return 0;
}
public static void setIconTintList(MenuItem menuItem, ColorStateList colorStateList) {
if (menuItem instanceof SupportMenuItem) {
((SupportMenuItem) menuItem).setIconTintList(colorStateList);
} else if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.setIconTintList(menuItem, colorStateList);
}
}
public static ColorStateList getIconTintList(MenuItem menuItem) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).getIconTintList();
}
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getIconTintList(menuItem);
}
return null;
}
public static void setIconTintMode(MenuItem menuItem, PorterDuff.Mode mode) {
if (menuItem instanceof SupportMenuItem) {
((SupportMenuItem) menuItem).setIconTintMode(mode);
} else if (Build.VERSION.SDK_INT >= 26) {
Api26Impl.setIconTintMode(menuItem, mode);
}
}
public static PorterDuff.Mode getIconTintMode(MenuItem menuItem) {
if (menuItem instanceof SupportMenuItem) {
return ((SupportMenuItem) menuItem).getIconTintMode();
}
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getIconTintMode(menuItem);
}
return null;
}
private MenuItemCompat() {
}
static class Api26Impl {
private Api26Impl() {
}
static MenuItem setContentDescription(MenuItem menuItem, CharSequence charSequence) {
return menuItem.setContentDescription(charSequence);
}
static CharSequence getContentDescription(MenuItem menuItem) {
return menuItem.getContentDescription();
}
static MenuItem setTooltipText(MenuItem menuItem, CharSequence charSequence) {
return menuItem.setTooltipText(charSequence);
}
static CharSequence getTooltipText(MenuItem menuItem) {
return menuItem.getTooltipText();
}
static MenuItem setShortcut(MenuItem menuItem, char c, char c2, int i, int i2) {
return menuItem.setShortcut(c, c2, i, i2);
}
static MenuItem setNumericShortcut(MenuItem menuItem, char c, int i) {
return menuItem.setNumericShortcut(c, i);
}
static int getNumericModifiers(MenuItem menuItem) {
return menuItem.getNumericModifiers();
}
static MenuItem setAlphabeticShortcut(MenuItem menuItem, char c, int i) {
return menuItem.setAlphabeticShortcut(c, i);
}
static int getAlphabeticModifiers(MenuItem menuItem) {
return menuItem.getAlphabeticModifiers();
}
static MenuItem setIconTintList(MenuItem menuItem, ColorStateList colorStateList) {
return menuItem.setIconTintList(colorStateList);
}
static ColorStateList getIconTintList(MenuItem menuItem) {
return menuItem.getIconTintList();
}
static MenuItem setIconTintMode(MenuItem menuItem, PorterDuff.Mode mode) {
return menuItem.setIconTintMode(mode);
}
static PorterDuff.Mode getIconTintMode(MenuItem menuItem) {
return menuItem.getIconTintMode();
}
}
}

View File

@ -0,0 +1,58 @@
package androidx.core.view;
import android.view.Menu;
import android.view.MenuItem;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMutableIterator;
/* compiled from: Menu.kt */
@Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0010)\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\t\u0010\u0005\u001a\u00020\u0006H\u0096\u0002J\t\u0010\u0007\u001a\u00020\u0002H\u0096\u0002J\b\u0010\b\u001a\u00020\tH\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"androidx/core/view/MenuKt$iterator$1", "", "Landroid/view/MenuItem;", "index", "", "hasNext", "", "next", "remove", "", "core-ktx_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class MenuKt$iterator$1 implements Iterator<MenuItem>, KMutableIterator {
final /* synthetic */ Menu $this_iterator;
private int index;
MenuKt$iterator$1(Menu menu) {
this.$this_iterator = menu;
}
@Override // java.util.Iterator
public boolean hasNext() {
return this.index < this.$this_iterator.size();
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // java.util.Iterator
public MenuItem next() {
Menu menu = this.$this_iterator;
int i = this.index;
this.index = i + 1;
MenuItem item = menu.getItem(i);
if (item != null) {
return item;
}
throw new IndexOutOfBoundsException();
}
@Override // java.util.Iterator
public void remove() {
Unit unit;
Menu menu = this.$this_iterator;
int i = this.index - 1;
this.index = i;
MenuItem item = menu.getItem(i);
if (item != null) {
Intrinsics.checkNotNullExpressionValue(item, "getItem(index)");
menu.removeItem(item.getItemId());
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
throw new IndexOutOfBoundsException();
}
}
}

View File

@ -0,0 +1,109 @@
package androidx.core.view;
import android.view.Menu;
import android.view.MenuItem;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
/* compiled from: Menu.kt */
@Metadata(d1 = {"\u0000D\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010)\n\u0002\b\u0003\u001a\u0015\u0010\n\u001a\u00020\u000b*\u00020\u00032\u0006\u0010\f\u001a\u00020\u0002H\u0086\u0002\u001a3\u0010\r\u001a\u00020\u000e*\u00020\u00032!\u0010\u000f\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0011\u0012\b\b\u0012\u0012\u0004\b\b(\f\u0012\u0004\u0012\u00020\u000e0\u0010H\u0086\\u0001\u0000\u001aH\u0010\u0013\u001a\u00020\u000e*\u00020\u000326\u0010\u000f\u001a2\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\u0011\u0012\b\b\u0012\u0012\u0004\b\b(\u0015\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0011\u0012\b\b\u0012\u0012\u0004\b\b(\f\u0012\u0004\u0012\u00020\u000e0\u0014H\u0086\\u0001\u0000\u001a\u0015\u0010\u0016\u001a\u00020\u0002*\u00020\u00032\u0006\u0010\u0015\u001a\u00020\u0007H\u0086\n\u001a\r\u0010\u0017\u001a\u00020\u000b*\u00020\u0003H\u0086\b\u001a\r\u0010\u0018\u001a\u00020\u000b*\u00020\u0003H\u0086\b\u001a\u0013\u0010\u0019\u001a\b\u0012\u0004\u0012\u00020\u00020\u001a*\u00020\u0003H\u0086\u0002\u001a\u0015\u0010\u001b\u001a\u00020\u000e*\u00020\u00032\u0006\u0010\f\u001a\u00020\u0002H\u0086\n\u001a\u0015\u0010\u001c\u001a\u00020\u000e*\u00020\u00032\u0006\u0010\u0015\u001a\u00020\u0007H\u0086\b\"\u001b\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001*\u00020\u00038F¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005\"\u0016\u0010\u0006\u001a\u00020\u0007*\u00020\u00038Æ\u0002¢\u0006\u0006\u001a\u0004\b\b\u0010\t\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u001d"}, d2 = {"children", "Lkotlin/sequences/Sequence;", "Landroid/view/MenuItem;", "Landroid/view/Menu;", "getChildren", "(Landroid/view/Menu;)Lkotlin/sequences/Sequence;", "size", "", "getSize", "(Landroid/view/Menu;)I", "contains", "", "item", "forEach", "", "action", "Lkotlin/Function1;", "Lkotlin/ParameterName;", "name", "forEachIndexed", "Lkotlin/Function2;", "index", "get", "isEmpty", "isNotEmpty", "iterator", "", "minusAssign", "removeItemAt", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class MenuKt {
public static final MenuItem get(Menu menu, int i) {
Intrinsics.checkNotNullParameter(menu, "<this>");
MenuItem item = menu.getItem(i);
Intrinsics.checkNotNullExpressionValue(item, "getItem(index)");
return item;
}
public static final boolean contains(Menu menu, MenuItem item) {
Intrinsics.checkNotNullParameter(menu, "<this>");
Intrinsics.checkNotNullParameter(item, "item");
int size = menu.size();
for (int i = 0; i < size; i++) {
if (Intrinsics.areEqual(menu.getItem(i), item)) {
return true;
}
}
return false;
}
public static final void minusAssign(Menu menu, MenuItem item) {
Intrinsics.checkNotNullParameter(menu, "<this>");
Intrinsics.checkNotNullParameter(item, "item");
menu.removeItem(item.getItemId());
}
public static final int getSize(Menu menu) {
Intrinsics.checkNotNullParameter(menu, "<this>");
return menu.size();
}
public static final boolean isEmpty(Menu menu) {
Intrinsics.checkNotNullParameter(menu, "<this>");
return menu.size() == 0;
}
public static final boolean isNotEmpty(Menu menu) {
Intrinsics.checkNotNullParameter(menu, "<this>");
return menu.size() != 0;
}
public static final void forEach(Menu menu, Function1<? super MenuItem, Unit> action) {
Intrinsics.checkNotNullParameter(menu, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
int size = menu.size();
for (int i = 0; i < size; i++) {
MenuItem item = menu.getItem(i);
Intrinsics.checkNotNullExpressionValue(item, "getItem(index)");
action.invoke(item);
}
}
public static final void forEachIndexed(Menu menu, Function2<? super Integer, ? super MenuItem, Unit> action) {
Intrinsics.checkNotNullParameter(menu, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
int size = menu.size();
for (int i = 0; i < size; i++) {
Integer valueOf = Integer.valueOf(i);
MenuItem item = menu.getItem(i);
Intrinsics.checkNotNullExpressionValue(item, "getItem(index)");
action.invoke(valueOf, item);
}
}
public static final Iterator<MenuItem> iterator(Menu menu) {
Intrinsics.checkNotNullParameter(menu, "<this>");
return new MenuKt$iterator$1(menu);
}
public static final void removeItemAt(Menu menu, int i) {
Unit unit;
Intrinsics.checkNotNullParameter(menu, "<this>");
MenuItem item = menu.getItem(i);
if (item != null) {
menu.removeItem(item.getItemId());
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
throw new IndexOutOfBoundsException();
}
}
public static final Sequence<MenuItem> getChildren(final Menu menu) {
Intrinsics.checkNotNullParameter(menu, "<this>");
return new Sequence<MenuItem>() { // from class: androidx.core.view.MenuKt$children$1
@Override // kotlin.sequences.Sequence
public Iterator<MenuItem> iterator() {
return MenuKt.iterator(menu);
}
};
}
}

View File

@ -0,0 +1,26 @@
package androidx.core.view;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
/* loaded from: classes.dex */
public interface MenuProvider {
/* renamed from: androidx.core.view.MenuProvider$-CC, reason: invalid class name */
public final /* synthetic */ class CC {
public static void $default$onMenuClosed(MenuProvider _this, Menu menu) {
}
public static void $default$onPrepareMenu(MenuProvider _this, Menu menu) {
}
}
void onCreateMenu(Menu menu, MenuInflater menuInflater);
void onMenuClosed(Menu menu);
boolean onMenuItemSelected(MenuItem menuItem);
void onPrepareMenu(Menu menu);
}

View File

@ -0,0 +1,228 @@
package androidx.core.view;
import android.view.MotionEvent;
/* loaded from: classes.dex */
public final class MotionEventCompat {
@Deprecated
public static final int ACTION_HOVER_ENTER = 9;
@Deprecated
public static final int ACTION_HOVER_EXIT = 10;
@Deprecated
public static final int ACTION_HOVER_MOVE = 7;
@Deprecated
public static final int ACTION_MASK = 255;
@Deprecated
public static final int ACTION_POINTER_DOWN = 5;
@Deprecated
public static final int ACTION_POINTER_INDEX_MASK = 65280;
@Deprecated
public static final int ACTION_POINTER_INDEX_SHIFT = 8;
@Deprecated
public static final int ACTION_POINTER_UP = 6;
@Deprecated
public static final int ACTION_SCROLL = 8;
@Deprecated
public static final int AXIS_BRAKE = 23;
@Deprecated
public static final int AXIS_DISTANCE = 24;
@Deprecated
public static final int AXIS_GAS = 22;
@Deprecated
public static final int AXIS_GENERIC_1 = 32;
@Deprecated
public static final int AXIS_GENERIC_10 = 41;
@Deprecated
public static final int AXIS_GENERIC_11 = 42;
@Deprecated
public static final int AXIS_GENERIC_12 = 43;
@Deprecated
public static final int AXIS_GENERIC_13 = 44;
@Deprecated
public static final int AXIS_GENERIC_14 = 45;
@Deprecated
public static final int AXIS_GENERIC_15 = 46;
@Deprecated
public static final int AXIS_GENERIC_16 = 47;
@Deprecated
public static final int AXIS_GENERIC_2 = 33;
@Deprecated
public static final int AXIS_GENERIC_3 = 34;
@Deprecated
public static final int AXIS_GENERIC_4 = 35;
@Deprecated
public static final int AXIS_GENERIC_5 = 36;
@Deprecated
public static final int AXIS_GENERIC_6 = 37;
@Deprecated
public static final int AXIS_GENERIC_7 = 38;
@Deprecated
public static final int AXIS_GENERIC_8 = 39;
@Deprecated
public static final int AXIS_GENERIC_9 = 40;
@Deprecated
public static final int AXIS_HAT_X = 15;
@Deprecated
public static final int AXIS_HAT_Y = 16;
@Deprecated
public static final int AXIS_HSCROLL = 10;
@Deprecated
public static final int AXIS_LTRIGGER = 17;
@Deprecated
public static final int AXIS_ORIENTATION = 8;
@Deprecated
public static final int AXIS_PRESSURE = 2;
public static final int AXIS_RELATIVE_X = 27;
public static final int AXIS_RELATIVE_Y = 28;
@Deprecated
public static final int AXIS_RTRIGGER = 18;
@Deprecated
public static final int AXIS_RUDDER = 20;
@Deprecated
public static final int AXIS_RX = 12;
@Deprecated
public static final int AXIS_RY = 13;
@Deprecated
public static final int AXIS_RZ = 14;
public static final int AXIS_SCROLL = 26;
@Deprecated
public static final int AXIS_SIZE = 3;
@Deprecated
public static final int AXIS_THROTTLE = 19;
@Deprecated
public static final int AXIS_TILT = 25;
@Deprecated
public static final int AXIS_TOOL_MAJOR = 6;
@Deprecated
public static final int AXIS_TOOL_MINOR = 7;
@Deprecated
public static final int AXIS_TOUCH_MAJOR = 4;
@Deprecated
public static final int AXIS_TOUCH_MINOR = 5;
@Deprecated
public static final int AXIS_VSCROLL = 9;
@Deprecated
public static final int AXIS_WHEEL = 21;
@Deprecated
public static final int AXIS_X = 0;
@Deprecated
public static final int AXIS_Y = 1;
@Deprecated
public static final int AXIS_Z = 11;
@Deprecated
public static final int BUTTON_PRIMARY = 1;
@Deprecated
public static int getActionMasked(MotionEvent motionEvent) {
return motionEvent.getActionMasked();
}
@Deprecated
public static int getActionIndex(MotionEvent motionEvent) {
return motionEvent.getActionIndex();
}
@Deprecated
public static int findPointerIndex(MotionEvent motionEvent, int i) {
return motionEvent.findPointerIndex(i);
}
@Deprecated
public static int getPointerId(MotionEvent motionEvent, int i) {
return motionEvent.getPointerId(i);
}
@Deprecated
public static float getX(MotionEvent motionEvent, int i) {
return motionEvent.getX(i);
}
@Deprecated
public static float getY(MotionEvent motionEvent, int i) {
return motionEvent.getY(i);
}
@Deprecated
public static int getPointerCount(MotionEvent motionEvent) {
return motionEvent.getPointerCount();
}
@Deprecated
public static int getSource(MotionEvent motionEvent) {
return motionEvent.getSource();
}
public static boolean isFromSource(MotionEvent motionEvent, int i) {
return (motionEvent.getSource() & i) == i;
}
@Deprecated
public static float getAxisValue(MotionEvent motionEvent, int i) {
return motionEvent.getAxisValue(i);
}
@Deprecated
public static float getAxisValue(MotionEvent motionEvent, int i, int i2) {
return motionEvent.getAxisValue(i, i2);
}
@Deprecated
public static int getButtonState(MotionEvent motionEvent) {
return motionEvent.getButtonState();
}
private MotionEventCompat() {
}
}

View File

@ -0,0 +1,22 @@
package androidx.core.view;
/* loaded from: classes.dex */
public interface NestedScrollingChild {
boolean dispatchNestedFling(float f, float f2, boolean z);
boolean dispatchNestedPreFling(float f, float f2);
boolean dispatchNestedPreScroll(int i, int i2, int[] iArr, int[] iArr2);
boolean dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr);
boolean hasNestedScrollingParent();
boolean isNestedScrollingEnabled();
void setNestedScrollingEnabled(boolean z);
boolean startNestedScroll(int i);
void stopNestedScroll();
}

View File

@ -0,0 +1,14 @@
package androidx.core.view;
/* loaded from: classes.dex */
public interface NestedScrollingChild2 extends NestedScrollingChild {
boolean dispatchNestedPreScroll(int i, int i2, int[] iArr, int[] iArr2, int i3);
boolean dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr, int i5);
boolean hasNestedScrollingParent(int i);
boolean startNestedScroll(int i, int i2);
void stopNestedScroll(int i);
}

View File

@ -0,0 +1,6 @@
package androidx.core.view;
/* loaded from: classes.dex */
public interface NestedScrollingChild3 extends NestedScrollingChild2 {
void dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr, int i5, int[] iArr2);
}

View File

@ -0,0 +1,218 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewParent;
/* loaded from: classes.dex */
public class NestedScrollingChildHelper {
private boolean mIsNestedScrollingEnabled;
private ViewParent mNestedScrollingParentNonTouch;
private ViewParent mNestedScrollingParentTouch;
private int[] mTempNestedScrollConsumed;
private final View mView;
private ViewParent getNestedScrollingParentForType(int i) {
if (i == 0) {
return this.mNestedScrollingParentTouch;
}
if (i != 1) {
return null;
}
return this.mNestedScrollingParentNonTouch;
}
private int[] getTempNestedScrollConsumed() {
if (this.mTempNestedScrollConsumed == null) {
this.mTempNestedScrollConsumed = new int[2];
}
return this.mTempNestedScrollConsumed;
}
private void setNestedScrollingParentForType(int i, ViewParent viewParent) {
if (i == 0) {
this.mNestedScrollingParentTouch = viewParent;
} else {
if (i != 1) {
return;
}
this.mNestedScrollingParentNonTouch = viewParent;
}
}
public boolean isNestedScrollingEnabled() {
return this.mIsNestedScrollingEnabled;
}
public NestedScrollingChildHelper(View view) {
this.mView = view;
}
public void setNestedScrollingEnabled(boolean z) {
if (this.mIsNestedScrollingEnabled) {
ViewCompat.stopNestedScroll(this.mView);
}
this.mIsNestedScrollingEnabled = z;
}
public boolean hasNestedScrollingParent() {
return hasNestedScrollingParent(0);
}
public boolean hasNestedScrollingParent(int i) {
return getNestedScrollingParentForType(i) != null;
}
public boolean startNestedScroll(int i) {
return startNestedScroll(i, 0);
}
public boolean startNestedScroll(int i, int i2) {
if (hasNestedScrollingParent(i2)) {
return true;
}
if (!isNestedScrollingEnabled()) {
return false;
}
View view = this.mView;
for (ViewParent parent = this.mView.getParent(); parent != null; parent = parent.getParent()) {
if (ViewParentCompat.onStartNestedScroll(parent, view, this.mView, i, i2)) {
setNestedScrollingParentForType(i2, parent);
ViewParentCompat.onNestedScrollAccepted(parent, view, this.mView, i, i2);
return true;
}
if (parent instanceof View) {
view = (View) parent;
}
}
return false;
}
public void stopNestedScroll() {
stopNestedScroll(0);
}
public void stopNestedScroll(int i) {
ViewParent nestedScrollingParentForType = getNestedScrollingParentForType(i);
if (nestedScrollingParentForType != null) {
ViewParentCompat.onStopNestedScroll(nestedScrollingParentForType, this.mView, i);
setNestedScrollingParentForType(i, null);
}
}
public boolean dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr) {
return dispatchNestedScrollInternal(i, i2, i3, i4, iArr, 0, null);
}
public boolean dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr, int i5) {
return dispatchNestedScrollInternal(i, i2, i3, i4, iArr, i5, null);
}
public void dispatchNestedScroll(int i, int i2, int i3, int i4, int[] iArr, int i5, int[] iArr2) {
dispatchNestedScrollInternal(i, i2, i3, i4, iArr, i5, iArr2);
}
private boolean dispatchNestedScrollInternal(int i, int i2, int i3, int i4, int[] iArr, int i5, int[] iArr2) {
ViewParent nestedScrollingParentForType;
int i6;
int i7;
int[] iArr3;
if (!isNestedScrollingEnabled() || (nestedScrollingParentForType = getNestedScrollingParentForType(i5)) == null) {
return false;
}
if (i == 0 && i2 == 0 && i3 == 0 && i4 == 0) {
if (iArr != null) {
iArr[0] = 0;
iArr[1] = 0;
}
return false;
}
if (iArr != null) {
this.mView.getLocationInWindow(iArr);
i6 = iArr[0];
i7 = iArr[1];
} else {
i6 = 0;
i7 = 0;
}
if (iArr2 == null) {
int[] tempNestedScrollConsumed = getTempNestedScrollConsumed();
tempNestedScrollConsumed[0] = 0;
tempNestedScrollConsumed[1] = 0;
iArr3 = tempNestedScrollConsumed;
} else {
iArr3 = iArr2;
}
ViewParentCompat.onNestedScroll(nestedScrollingParentForType, this.mView, i, i2, i3, i4, i5, iArr3);
if (iArr != null) {
this.mView.getLocationInWindow(iArr);
iArr[0] = iArr[0] - i6;
iArr[1] = iArr[1] - i7;
}
return true;
}
public boolean dispatchNestedPreScroll(int i, int i2, int[] iArr, int[] iArr2) {
return dispatchNestedPreScroll(i, i2, iArr, iArr2, 0);
}
public boolean dispatchNestedPreScroll(int i, int i2, int[] iArr, int[] iArr2, int i3) {
ViewParent nestedScrollingParentForType;
int i4;
int i5;
if (!isNestedScrollingEnabled() || (nestedScrollingParentForType = getNestedScrollingParentForType(i3)) == null) {
return false;
}
if (i == 0 && i2 == 0) {
if (iArr2 == null) {
return false;
}
iArr2[0] = 0;
iArr2[1] = 0;
return false;
}
if (iArr2 != null) {
this.mView.getLocationInWindow(iArr2);
i4 = iArr2[0];
i5 = iArr2[1];
} else {
i4 = 0;
i5 = 0;
}
if (iArr == null) {
iArr = getTempNestedScrollConsumed();
}
iArr[0] = 0;
iArr[1] = 0;
ViewParentCompat.onNestedPreScroll(nestedScrollingParentForType, this.mView, i, i2, iArr, i3);
if (iArr2 != null) {
this.mView.getLocationInWindow(iArr2);
iArr2[0] = iArr2[0] - i4;
iArr2[1] = iArr2[1] - i5;
}
return (iArr[0] == 0 && iArr[1] == 0) ? false : true;
}
public boolean dispatchNestedFling(float f, float f2, boolean z) {
ViewParent nestedScrollingParentForType;
if (!isNestedScrollingEnabled() || (nestedScrollingParentForType = getNestedScrollingParentForType(0)) == null) {
return false;
}
return ViewParentCompat.onNestedFling(nestedScrollingParentForType, this.mView, f, f2, z);
}
public boolean dispatchNestedPreFling(float f, float f2) {
ViewParent nestedScrollingParentForType;
if (!isNestedScrollingEnabled() || (nestedScrollingParentForType = getNestedScrollingParentForType(0)) == null) {
return false;
}
return ViewParentCompat.onNestedPreFling(nestedScrollingParentForType, this.mView, f, f2);
}
public void onDetachedFromWindow() {
ViewCompat.stopNestedScroll(this.mView);
}
public void onStopNestedScroll(View view) {
ViewCompat.stopNestedScroll(this.mView);
}
}

View File

@ -0,0 +1,22 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public interface NestedScrollingParent {
int getNestedScrollAxes();
boolean onNestedFling(View view, float f, float f2, boolean z);
boolean onNestedPreFling(View view, float f, float f2);
void onNestedPreScroll(View view, int i, int i2, int[] iArr);
void onNestedScroll(View view, int i, int i2, int i3, int i4);
void onNestedScrollAccepted(View view, View view2, int i);
boolean onStartNestedScroll(View view, View view2, int i);
void onStopNestedScroll(View view);
}

View File

@ -0,0 +1,16 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public interface NestedScrollingParent2 extends NestedScrollingParent {
void onNestedPreScroll(View view, int i, int i2, int[] iArr, int i3);
void onNestedScroll(View view, int i, int i2, int i3, int i4, int i5);
void onNestedScrollAccepted(View view, View view2, int i, int i2);
boolean onStartNestedScroll(View view, View view2, int i, int i2);
void onStopNestedScroll(View view, int i);
}

View File

@ -0,0 +1,8 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public interface NestedScrollingParent3 extends NestedScrollingParent2 {
void onNestedScroll(View view, int i, int i2, int i3, int i4, int i5, int[] iArr);
}

View File

@ -0,0 +1,41 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewGroup;
/* loaded from: classes.dex */
public class NestedScrollingParentHelper {
private int mNestedScrollAxesNonTouch;
private int mNestedScrollAxesTouch;
public int getNestedScrollAxes() {
return this.mNestedScrollAxesTouch | this.mNestedScrollAxesNonTouch;
}
public void onNestedScrollAccepted(View view, View view2, int i, int i2) {
if (i2 == 1) {
this.mNestedScrollAxesNonTouch = i;
} else {
this.mNestedScrollAxesTouch = i;
}
}
public void onStopNestedScroll(View view, int i) {
if (i == 1) {
this.mNestedScrollAxesNonTouch = 0;
} else {
this.mNestedScrollAxesTouch = 0;
}
}
public NestedScrollingParentHelper(ViewGroup viewGroup) {
}
public void onNestedScrollAccepted(View view, View view2, int i) {
onNestedScrollAccepted(view, view2, i, 0);
}
public void onStopNestedScroll(View view) {
onStopNestedScroll(view, 0);
}
}

View File

@ -0,0 +1,8 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public interface OnApplyWindowInsetsListener {
WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat windowInsetsCompat);
}

View File

@ -0,0 +1,8 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public interface OnReceiveContentListener {
ContentInfoCompat onReceiveContent(View view, ContentInfoCompat contentInfoCompat);
}

View File

@ -0,0 +1,6 @@
package androidx.core.view;
/* loaded from: classes.dex */
public interface OnReceiveContentViewBehavior {
ContentInfoCompat onReceiveContent(ContentInfoCompat contentInfoCompat);
}

View File

@ -0,0 +1,56 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewTreeObserver;
/* loaded from: classes.dex */
public final class OneShotPreDrawListener implements ViewTreeObserver.OnPreDrawListener, View.OnAttachStateChangeListener {
private final Runnable mRunnable;
private final View mView;
private ViewTreeObserver mViewTreeObserver;
private OneShotPreDrawListener(View view, Runnable runnable) {
this.mView = view;
this.mViewTreeObserver = view.getViewTreeObserver();
this.mRunnable = runnable;
}
public static OneShotPreDrawListener add(View view, Runnable runnable) {
if (view == null) {
throw new NullPointerException("view == null");
}
if (runnable == null) {
throw new NullPointerException("runnable == null");
}
OneShotPreDrawListener oneShotPreDrawListener = new OneShotPreDrawListener(view, runnable);
view.getViewTreeObserver().addOnPreDrawListener(oneShotPreDrawListener);
view.addOnAttachStateChangeListener(oneShotPreDrawListener);
return oneShotPreDrawListener;
}
@Override // android.view.ViewTreeObserver.OnPreDrawListener
public boolean onPreDraw() {
removeListener();
this.mRunnable.run();
return true;
}
public void removeListener() {
if (this.mViewTreeObserver.isAlive()) {
this.mViewTreeObserver.removeOnPreDrawListener(this);
} else {
this.mView.getViewTreeObserver().removeOnPreDrawListener(this);
}
this.mView.removeOnAttachStateChangeListener(this);
}
@Override // android.view.View.OnAttachStateChangeListener
public void onViewAttachedToWindow(View view) {
this.mViewTreeObserver = view.getViewTreeObserver();
}
@Override // android.view.View.OnAttachStateChangeListener
public void onViewDetachedFromWindow(View view) {
removeListener();
}
}

View File

@ -0,0 +1,81 @@
package androidx.core.view;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.os.Build;
import android.view.PointerIcon;
/* loaded from: classes.dex */
public final class PointerIconCompat {
public static final int TYPE_ALIAS = 1010;
public static final int TYPE_ALL_SCROLL = 1013;
public static final int TYPE_ARROW = 1000;
public static final int TYPE_CELL = 1006;
public static final int TYPE_CONTEXT_MENU = 1001;
public static final int TYPE_COPY = 1011;
public static final int TYPE_CROSSHAIR = 1007;
public static final int TYPE_DEFAULT = 1000;
public static final int TYPE_GRAB = 1020;
public static final int TYPE_GRABBING = 1021;
public static final int TYPE_HAND = 1002;
public static final int TYPE_HELP = 1003;
public static final int TYPE_HORIZONTAL_DOUBLE_ARROW = 1014;
public static final int TYPE_NO_DROP = 1012;
public static final int TYPE_NULL = 0;
public static final int TYPE_TEXT = 1008;
public static final int TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW = 1017;
public static final int TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW = 1016;
public static final int TYPE_VERTICAL_DOUBLE_ARROW = 1015;
public static final int TYPE_VERTICAL_TEXT = 1009;
public static final int TYPE_WAIT = 1004;
public static final int TYPE_ZOOM_IN = 1018;
public static final int TYPE_ZOOM_OUT = 1019;
private final PointerIcon mPointerIcon;
public Object getPointerIcon() {
return this.mPointerIcon;
}
private PointerIconCompat(PointerIcon pointerIcon) {
this.mPointerIcon = pointerIcon;
}
public static PointerIconCompat getSystemIcon(Context context, int i) {
if (Build.VERSION.SDK_INT >= 24) {
return new PointerIconCompat(Api24Impl.getSystemIcon(context, i));
}
return new PointerIconCompat(null);
}
public static PointerIconCompat create(Bitmap bitmap, float f, float f2) {
if (Build.VERSION.SDK_INT >= 24) {
return new PointerIconCompat(Api24Impl.create(bitmap, f, f2));
}
return new PointerIconCompat(null);
}
public static PointerIconCompat load(Resources resources, int i) {
if (Build.VERSION.SDK_INT >= 24) {
return new PointerIconCompat(Api24Impl.load(resources, i));
}
return new PointerIconCompat(null);
}
static class Api24Impl {
private Api24Impl() {
}
static PointerIcon getSystemIcon(Context context, int i) {
return PointerIcon.getSystemIcon(context, i);
}
static PointerIcon create(Bitmap bitmap, float f, float f2) {
return PointerIcon.create(bitmap, f, f2);
}
static PointerIcon load(Resources resources, int i) {
return PointerIcon.load(resources, i);
}
}
}

View File

@ -0,0 +1,40 @@
package androidx.core.view;
import android.view.ScaleGestureDetector;
/* loaded from: classes.dex */
public final class ScaleGestureDetectorCompat {
private ScaleGestureDetectorCompat() {
}
@Deprecated
public static void setQuickScaleEnabled(Object obj, boolean z) {
setQuickScaleEnabled((ScaleGestureDetector) obj, z);
}
public static void setQuickScaleEnabled(ScaleGestureDetector scaleGestureDetector, boolean z) {
Api19Impl.setQuickScaleEnabled(scaleGestureDetector, z);
}
@Deprecated
public static boolean isQuickScaleEnabled(Object obj) {
return isQuickScaleEnabled((ScaleGestureDetector) obj);
}
public static boolean isQuickScaleEnabled(ScaleGestureDetector scaleGestureDetector) {
return Api19Impl.isQuickScaleEnabled(scaleGestureDetector);
}
static class Api19Impl {
private Api19Impl() {
}
static void setQuickScaleEnabled(ScaleGestureDetector scaleGestureDetector, boolean z) {
scaleGestureDetector.setQuickScaleEnabled(z);
}
static boolean isQuickScaleEnabled(ScaleGestureDetector scaleGestureDetector) {
return scaleGestureDetector.isQuickScaleEnabled();
}
}
}

View File

@ -0,0 +1,16 @@
package androidx.core.view;
/* loaded from: classes.dex */
public interface ScrollingView {
int computeHorizontalScrollExtent();
int computeHorizontalScrollOffset();
int computeHorizontalScrollRange();
int computeVerticalScrollExtent();
int computeVerticalScrollOffset();
int computeVerticalScrollRange();
}

View File

@ -0,0 +1,15 @@
package androidx.core.view;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
/* loaded from: classes.dex */
public interface TintableBackgroundView {
ColorStateList getSupportBackgroundTintList();
PorterDuff.Mode getSupportBackgroundTintMode();
void setSupportBackgroundTintList(ColorStateList colorStateList);
void setSupportBackgroundTintMode(PorterDuff.Mode mode);
}

View File

@ -0,0 +1,20 @@
package androidx.core.view;
import android.view.VelocityTracker;
@Deprecated
/* loaded from: classes.dex */
public final class VelocityTrackerCompat {
@Deprecated
public static float getXVelocity(VelocityTracker velocityTracker, int i) {
return velocityTracker.getXVelocity(i);
}
@Deprecated
public static float getYVelocity(VelocityTracker velocityTracker, int i) {
return velocityTracker.getYVelocity(i);
}
private VelocityTrackerCompat() {
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,111 @@
package androidx.core.view;
import android.R;
import android.content.Context;
import android.content.res.Resources;
import android.os.Build;
import android.util.Log;
import android.util.TypedValue;
import android.view.ViewConfiguration;
import java.lang.reflect.Method;
/* loaded from: classes.dex */
public final class ViewConfigurationCompat {
private static final String TAG = "ViewConfigCompat";
private static Method sGetScaledScrollFactorMethod;
static {
if (Build.VERSION.SDK_INT == 25) {
try {
sGetScaledScrollFactorMethod = ViewConfiguration.class.getDeclaredMethod("getScaledScrollFactor", new Class[0]);
} catch (Exception unused) {
Log.i(TAG, "Could not find method getScaledScrollFactor() on ViewConfiguration");
}
}
}
@Deprecated
public static int getScaledPagingTouchSlop(ViewConfiguration viewConfiguration) {
return viewConfiguration.getScaledPagingTouchSlop();
}
@Deprecated
public static boolean hasPermanentMenuKey(ViewConfiguration viewConfiguration) {
return viewConfiguration.hasPermanentMenuKey();
}
public static float getScaledHorizontalScrollFactor(ViewConfiguration viewConfiguration, Context context) {
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getScaledHorizontalScrollFactor(viewConfiguration);
}
return getLegacyScrollFactor(viewConfiguration, context);
}
public static float getScaledVerticalScrollFactor(ViewConfiguration viewConfiguration, Context context) {
if (Build.VERSION.SDK_INT >= 26) {
return Api26Impl.getScaledVerticalScrollFactor(viewConfiguration);
}
return getLegacyScrollFactor(viewConfiguration, context);
}
private static float getLegacyScrollFactor(ViewConfiguration viewConfiguration, Context context) {
Method method;
if (Build.VERSION.SDK_INT >= 25 && (method = sGetScaledScrollFactorMethod) != null) {
try {
return ((Integer) method.invoke(viewConfiguration, new Object[0])).intValue();
} catch (Exception unused) {
Log.i(TAG, "Could not find method getScaledScrollFactor() on ViewConfiguration");
}
}
TypedValue typedValue = new TypedValue();
if (context.getTheme().resolveAttribute(R.attr.listPreferredItemHeight, typedValue, true)) {
return typedValue.getDimension(context.getResources().getDisplayMetrics());
}
return 0.0f;
}
public static int getScaledHoverSlop(ViewConfiguration viewConfiguration) {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.getScaledHoverSlop(viewConfiguration);
}
return viewConfiguration.getScaledTouchSlop() / 2;
}
public static boolean shouldShowMenuShortcutsWhenKeyboardPresent(ViewConfiguration viewConfiguration, Context context) {
if (Build.VERSION.SDK_INT >= 28) {
return Api28Impl.shouldShowMenuShortcutsWhenKeyboardPresent(viewConfiguration);
}
Resources resources = context.getResources();
int identifier = resources.getIdentifier("config_showMenuShortcutsWhenKeyboardPresent", "bool", "android");
return identifier != 0 && resources.getBoolean(identifier);
}
private ViewConfigurationCompat() {
}
static class Api26Impl {
private Api26Impl() {
}
static float getScaledHorizontalScrollFactor(ViewConfiguration viewConfiguration) {
return viewConfiguration.getScaledHorizontalScrollFactor();
}
static float getScaledVerticalScrollFactor(ViewConfiguration viewConfiguration) {
return viewConfiguration.getScaledVerticalScrollFactor();
}
}
static class Api28Impl {
private Api28Impl() {
}
static int getScaledHoverSlop(ViewConfiguration viewConfiguration) {
return viewConfiguration.getScaledHoverSlop();
}
static boolean shouldShowMenuShortcutsWhenKeyboardPresent(ViewConfiguration viewConfiguration) {
return viewConfiguration.shouldShowMenuShortcutsWhenKeyboardPresent();
}
}
}

View File

@ -0,0 +1,74 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
/* loaded from: classes.dex */
public final class ViewGroupCompat {
public static final int LAYOUT_MODE_CLIP_BOUNDS = 0;
public static final int LAYOUT_MODE_OPTICAL_BOUNDS = 1;
private ViewGroupCompat() {
}
@Deprecated
public static boolean onRequestSendAccessibilityEvent(ViewGroup viewGroup, View view, AccessibilityEvent accessibilityEvent) {
return viewGroup.onRequestSendAccessibilityEvent(view, accessibilityEvent);
}
@Deprecated
public static void setMotionEventSplittingEnabled(ViewGroup viewGroup, boolean z) {
viewGroup.setMotionEventSplittingEnabled(z);
}
public static int getLayoutMode(ViewGroup viewGroup) {
return Api18Impl.getLayoutMode(viewGroup);
}
public static void setLayoutMode(ViewGroup viewGroup, int i) {
Api18Impl.setLayoutMode(viewGroup, i);
}
public static void setTransitionGroup(ViewGroup viewGroup, boolean z) {
Api21Impl.setTransitionGroup(viewGroup, z);
}
public static boolean isTransitionGroup(ViewGroup viewGroup) {
return Api21Impl.isTransitionGroup(viewGroup);
}
public static int getNestedScrollAxes(ViewGroup viewGroup) {
return Api21Impl.getNestedScrollAxes(viewGroup);
}
static class Api18Impl {
private Api18Impl() {
}
static int getLayoutMode(ViewGroup viewGroup) {
return viewGroup.getLayoutMode();
}
static void setLayoutMode(ViewGroup viewGroup, int i) {
viewGroup.setLayoutMode(i);
}
}
static class Api21Impl {
private Api21Impl() {
}
static void setTransitionGroup(ViewGroup viewGroup, boolean z) {
viewGroup.setTransitionGroup(z);
}
static boolean isTransitionGroup(ViewGroup viewGroup) {
return viewGroup.isTransitionGroup();
}
static int getNestedScrollAxes(ViewGroup viewGroup) {
return viewGroup.getNestedScrollAxes();
}
}
}

View File

@ -0,0 +1,164 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewGroup;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlin.sequences.SequenceScope;
/* compiled from: ViewGroup.kt */
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\u008a@"}, d2 = {"Lkotlin/sequences/SequenceScope;", "Landroid/view/View;", "", "<anonymous>"}, k = 3, mv = {1, 7, 1})
@DebugMetadata(c = "androidx.core.view.ViewGroupKt$descendants$1", f = "ViewGroup.kt", i = {0, 0, 0, 0, 1, 1, 1}, l = {119, 121}, m = "invokeSuspend", n = {"$this$sequence", "$this$forEach$iv", "child", "index$iv", "$this$sequence", "$this$forEach$iv", "index$iv"}, s = {"L$0", "L$1", "L$2", "I$0", "L$0", "L$1", "I$0"})
/* loaded from: classes.dex */
final class ViewGroupKt$descendants$1 extends RestrictedSuspendLambda implements Function2<SequenceScope<? super View>, Continuation<? super Unit>, Object> {
final /* synthetic */ ViewGroup $this_descendants;
int I$0;
int I$1;
private /* synthetic */ Object L$0;
Object L$1;
Object L$2;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
ViewGroupKt$descendants$1(ViewGroup viewGroup, Continuation<? super ViewGroupKt$descendants$1> continuation) {
super(2, continuation);
this.$this_descendants = viewGroup;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
ViewGroupKt$descendants$1 viewGroupKt$descendants$1 = new ViewGroupKt$descendants$1(this.$this_descendants, continuation);
viewGroupKt$descendants$1.L$0 = obj;
return viewGroupKt$descendants$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(SequenceScope<? super View> sequenceScope, Continuation<? super Unit> continuation) {
return ((ViewGroupKt$descendants$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
/* JADX WARN: Removed duplicated region for block: B:16:0x0075 */
/* JADX WARN: Removed duplicated region for block: B:20:0x0098 */
/* JADX WARN: Removed duplicated region for block: B:21:0x00a1 */
/* JADX WARN: Removed duplicated region for block: B:9:0x004e */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:19:0x008f -> B:6:0x0091). Please report as a decompilation issue!!! */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:20:0x0098 -> B:7:0x009c). Please report as a decompilation issue!!! */
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.lang.Object invokeSuspend(java.lang.Object r12) {
/*
r11 = this;
java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r1 = r11.label
r2 = 2
r3 = 1
if (r1 == 0) goto L3d
if (r1 == r3) goto L28
if (r1 != r2) goto L20
int r1 = r11.I$1
int r4 = r11.I$0
java.lang.Object r5 = r11.L$1
android.view.ViewGroup r5 = (android.view.ViewGroup) r5
java.lang.Object r6 = r11.L$0
kotlin.sequences.SequenceScope r6 = (kotlin.sequences.SequenceScope) r6
kotlin.ResultKt.throwOnFailure(r12)
r12 = r11
goto L91
L20:
java.lang.IllegalStateException r12 = new java.lang.IllegalStateException
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
r12.<init>(r0)
throw r12
L28:
int r1 = r11.I$1
int r4 = r11.I$0
java.lang.Object r5 = r11.L$2
android.view.View r5 = (android.view.View) r5
java.lang.Object r6 = r11.L$1
android.view.ViewGroup r6 = (android.view.ViewGroup) r6
java.lang.Object r7 = r11.L$0
kotlin.sequences.SequenceScope r7 = (kotlin.sequences.SequenceScope) r7
kotlin.ResultKt.throwOnFailure(r12)
r12 = r11
goto L71
L3d:
kotlin.ResultKt.throwOnFailure(r12)
java.lang.Object r12 = r11.L$0
kotlin.sequences.SequenceScope r12 = (kotlin.sequences.SequenceScope) r12
android.view.ViewGroup r1 = r11.$this_descendants
int r4 = r1.getChildCount()
r5 = 0
r6 = r11
L4c:
if (r5 >= r4) goto La1
android.view.View r7 = r1.getChildAt(r5)
java.lang.String r8 = "getChildAt(index)"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r7, r8)
r6.L$0 = r12
r6.L$1 = r1
r6.L$2 = r7
r6.I$0 = r5
r6.I$1 = r4
r6.label = r3
java.lang.Object r8 = r12.yield(r7, r6)
if (r8 != r0) goto L6a
return r0
L6a:
r9 = r7
r7 = r12
r12 = r6
r6 = r1
r1 = r4
r4 = r5
r5 = r9
L71:
boolean r8 = r5 instanceof android.view.ViewGroup
if (r8 == 0) goto L98
android.view.ViewGroup r5 = (android.view.ViewGroup) r5
kotlin.sequences.Sequence r5 = androidx.core.view.ViewGroupKt.getDescendants(r5)
r12.L$0 = r7
r12.L$1 = r6
r8 = 0
r12.L$2 = r8
r12.I$0 = r4
r12.I$1 = r1
r12.label = r2
java.lang.Object r5 = r7.yieldAll(r5, r12)
if (r5 != r0) goto L8f
return r0
L8f:
r5 = r6
r6 = r7
L91:
r9 = r6
r6 = r12
r12 = r9
r10 = r5
r5 = r1
r1 = r10
goto L9c
L98:
r5 = r1
r1 = r6
r6 = r12
r12 = r7
L9c:
int r4 = r4 + r3
r9 = r5
r5 = r4
r4 = r9
goto L4c
La1:
kotlin.Unit r12 = kotlin.Unit.INSTANCE
return r12
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.view.ViewGroupKt$descendants$1.invokeSuspend(java.lang.Object):java.lang.Object");
}
}

View File

@ -0,0 +1,45 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewGroup;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.jvm.internal.markers.KMutableIterator;
/* compiled from: ViewGroup.kt */
@Metadata(d1 = {"\u0000#\n\u0000\n\u0002\u0010)\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\t\u0010\u0005\u001a\u00020\u0006H\u0096\u0002J\t\u0010\u0007\u001a\u00020\u0002H\u0096\u0002J\b\u0010\b\u001a\u00020\tH\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"androidx/core/view/ViewGroupKt$iterator$1", "", "Landroid/view/View;", "index", "", "hasNext", "", "next", "remove", "", "core-ktx_release"}, k = 1, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class ViewGroupKt$iterator$1 implements Iterator<View>, KMutableIterator {
final /* synthetic */ ViewGroup $this_iterator;
private int index;
ViewGroupKt$iterator$1(ViewGroup viewGroup) {
this.$this_iterator = viewGroup;
}
@Override // java.util.Iterator
public boolean hasNext() {
return this.index < this.$this_iterator.getChildCount();
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // java.util.Iterator
public View next() {
ViewGroup viewGroup = this.$this_iterator;
int i = this.index;
this.index = i + 1;
View childAt = viewGroup.getChildAt(i);
if (childAt != null) {
return childAt;
}
throw new IndexOutOfBoundsException();
}
@Override // java.util.Iterator
public void remove() {
ViewGroup viewGroup = this.$this_iterator;
int i = this.index - 1;
this.index = i;
viewGroup.removeViewAt(i);
}
}

View File

@ -0,0 +1,164 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewGroup;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.ranges.IntRange;
import kotlin.ranges.RangesKt;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt;
/* compiled from: ViewGroup.kt */
@Metadata(d1 = {"\u0000T\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010)\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\t\u001a\u0015\u0010\u0010\u001a\u00020\u0011*\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u0002H\u0086\n\u001a3\u0010\u0013\u001a\u00020\u0014*\u00020\u00032!\u0010\u0015\u001a\u001d\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b(\u0012\u0012\u0004\u0012\u00020\u00140\u0016H\u0086\\u0001\u0000\u001aH\u0010\u0019\u001a\u00020\u0014*\u00020\u000326\u0010\u0015\u001a2\u0012\u0013\u0012\u00110\\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b(\u001b\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u0017\u0012\b\b\u0018\u0012\u0004\b\b(\u0012\u0012\u0004\u0012\u00020\u00140\u001aH\u0086\\u0001\u0000\u001a\u0015\u0010\u001c\u001a\u00020\u0002*\u00020\u00032\u0006\u0010\u001b\u001a\u00020\rH\u0086\u0002\u001a\r\u0010\u001d\u001a\u00020\u0011*\u00020\u0003H\u0086\b\u001a\r\u0010\u001e\u001a\u00020\u0011*\u00020\u0003H\u0086\b\u001a\u0013\u0010\u001f\u001a\b\u0012\u0004\u0012\u00020\u00020 *\u00020\u0003H\u0086\u0002\u001a\u0015\u0010!\u001a\u00020\u0014*\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u0002H\u0086\n\u001a\u0015\u0010\"\u001a\u00020\u0014*\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u0002H\u0086\n\u001a\u0017\u0010#\u001a\u00020\u0014*\u00020$2\b\b\u0001\u0010\f\u001a\u00020\rH\u0086\b\u001a5\u0010%\u001a\u00020\u0014*\u00020$2\b\b\u0003\u0010&\u001a\u00020\r2\b\b\u0003\u0010'\u001a\u00020\r2\b\b\u0003\u0010(\u001a\u00020\r2\b\b\u0003\u0010)\u001a\u00020\rH\u0086\b\u001a5\u0010*\u001a\u00020\u0014*\u00020$2\b\b\u0003\u0010+\u001a\u00020\r2\b\b\u0003\u0010'\u001a\u00020\r2\b\b\u0003\u0010,\u001a\u00020\r2\b\b\u0003\u0010)\u001a\u00020\rH\u0087\b\"\u001b\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001*\u00020\u00038F¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005\"\u001b\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001*\u00020\u00038F¢\u0006\u0006\u001a\u0004\b\u0007\u0010\u0005\"\u0016\u0010\b\u001a\u00020\t*\u00020\u00038Æ\u0002¢\u0006\u0006\u001a\u0004\b\n\u0010\u000b\"\u0016\u0010\f\u001a\u00020\r*\u00020\u00038Æ\u0002¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000f\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006-"}, d2 = {"children", "Lkotlin/sequences/Sequence;", "Landroid/view/View;", "Landroid/view/ViewGroup;", "getChildren", "(Landroid/view/ViewGroup;)Lkotlin/sequences/Sequence;", "descendants", "getDescendants", "indices", "Lkotlin/ranges/IntRange;", "getIndices", "(Landroid/view/ViewGroup;)Lkotlin/ranges/IntRange;", "size", "", "getSize", "(Landroid/view/ViewGroup;)I", "contains", "", "view", "forEach", "", "action", "Lkotlin/Function1;", "Lkotlin/ParameterName;", "name", "forEachIndexed", "Lkotlin/Function2;", "index", "get", "isEmpty", "isNotEmpty", "iterator", "", "minusAssign", "plusAssign", "setMargins", "Landroid/view/ViewGroup$MarginLayoutParams;", "updateMargins", "left", "top", "right", "bottom", "updateMarginsRelative", "start", "end", "core-ktx_release"}, k = 2, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
public final class ViewGroupKt {
public static final View get(ViewGroup viewGroup, int i) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
View childAt = viewGroup.getChildAt(i);
if (childAt != null) {
return childAt;
}
throw new IndexOutOfBoundsException("Index: " + i + ", Size: " + viewGroup.getChildCount());
}
public static final boolean contains(ViewGroup viewGroup, View view) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
Intrinsics.checkNotNullParameter(view, "view");
return viewGroup.indexOfChild(view) != -1;
}
public static final void plusAssign(ViewGroup viewGroup, View view) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
Intrinsics.checkNotNullParameter(view, "view");
viewGroup.addView(view);
}
public static final void minusAssign(ViewGroup viewGroup, View view) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
Intrinsics.checkNotNullParameter(view, "view");
viewGroup.removeView(view);
}
public static final int getSize(ViewGroup viewGroup) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
return viewGroup.getChildCount();
}
public static final boolean isEmpty(ViewGroup viewGroup) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
return viewGroup.getChildCount() == 0;
}
public static final boolean isNotEmpty(ViewGroup viewGroup) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
return viewGroup.getChildCount() != 0;
}
public static final void forEach(ViewGroup viewGroup, Function1<? super View, Unit> action) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
int childCount = viewGroup.getChildCount();
for (int i = 0; i < childCount; i++) {
View childAt = viewGroup.getChildAt(i);
Intrinsics.checkNotNullExpressionValue(childAt, "getChildAt(index)");
action.invoke(childAt);
}
}
public static final void forEachIndexed(ViewGroup viewGroup, Function2<? super Integer, ? super View, Unit> action) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
Intrinsics.checkNotNullParameter(action, "action");
int childCount = viewGroup.getChildCount();
for (int i = 0; i < childCount; i++) {
Integer valueOf = Integer.valueOf(i);
View childAt = viewGroup.getChildAt(i);
Intrinsics.checkNotNullExpressionValue(childAt, "getChildAt(index)");
action.invoke(valueOf, childAt);
}
}
public static final IntRange getIndices(ViewGroup viewGroup) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
return RangesKt.until(0, viewGroup.getChildCount());
}
public static final Iterator<View> iterator(ViewGroup viewGroup) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
return new ViewGroupKt$iterator$1(viewGroup);
}
public static final Sequence<View> getChildren(final ViewGroup viewGroup) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
return new Sequence<View>() { // from class: androidx.core.view.ViewGroupKt$children$1
@Override // kotlin.sequences.Sequence
public Iterator<View> iterator() {
return ViewGroupKt.iterator(viewGroup);
}
};
}
public static final Sequence<View> getDescendants(ViewGroup viewGroup) {
Intrinsics.checkNotNullParameter(viewGroup, "<this>");
return SequencesKt.sequence(new ViewGroupKt$descendants$1(viewGroup, null));
}
public static final void setMargins(ViewGroup.MarginLayoutParams marginLayoutParams, int i) {
Intrinsics.checkNotNullParameter(marginLayoutParams, "<this>");
marginLayoutParams.setMargins(i, i, i, i);
}
public static /* synthetic */ void updateMargins$default(ViewGroup.MarginLayoutParams marginLayoutParams, int i, int i2, int i3, int i4, int i5, Object obj) {
if ((i5 & 1) != 0) {
i = marginLayoutParams.leftMargin;
}
if ((i5 & 2) != 0) {
i2 = marginLayoutParams.topMargin;
}
if ((i5 & 4) != 0) {
i3 = marginLayoutParams.rightMargin;
}
if ((i5 & 8) != 0) {
i4 = marginLayoutParams.bottomMargin;
}
Intrinsics.checkNotNullParameter(marginLayoutParams, "<this>");
marginLayoutParams.setMargins(i, i2, i3, i4);
}
public static final void updateMargins(ViewGroup.MarginLayoutParams marginLayoutParams, int i, int i2, int i3, int i4) {
Intrinsics.checkNotNullParameter(marginLayoutParams, "<this>");
marginLayoutParams.setMargins(i, i2, i3, i4);
}
public static /* synthetic */ void updateMarginsRelative$default(ViewGroup.MarginLayoutParams marginLayoutParams, int i, int i2, int i3, int i4, int i5, Object obj) {
if ((i5 & 1) != 0) {
i = marginLayoutParams.getMarginStart();
}
if ((i5 & 2) != 0) {
i2 = marginLayoutParams.topMargin;
}
if ((i5 & 4) != 0) {
i3 = marginLayoutParams.getMarginEnd();
}
if ((i5 & 8) != 0) {
i4 = marginLayoutParams.bottomMargin;
}
Intrinsics.checkNotNullParameter(marginLayoutParams, "<this>");
marginLayoutParams.setMarginStart(i);
marginLayoutParams.topMargin = i2;
marginLayoutParams.setMarginEnd(i3);
marginLayoutParams.bottomMargin = i4;
}
public static final void updateMarginsRelative(ViewGroup.MarginLayoutParams marginLayoutParams, int i, int i2, int i3, int i4) {
Intrinsics.checkNotNullParameter(marginLayoutParams, "<this>");
marginLayoutParams.setMarginStart(i);
marginLayoutParams.topMargin = i2;
marginLayoutParams.setMarginEnd(i3);
marginLayoutParams.bottomMargin = i4;
}
}

View File

@ -0,0 +1,77 @@
package androidx.core.view;
import android.view.View;
import android.view.ViewGroup;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlin.sequences.SequenceScope;
/* compiled from: View.kt */
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\u008a@"}, d2 = {"Lkotlin/sequences/SequenceScope;", "Landroid/view/View;", "", "<anonymous>"}, k = 3, mv = {1, 7, 1})
@DebugMetadata(c = "androidx.core.view.ViewKt$allViews$1", f = "View.kt", i = {0}, l = {414, TypedValues.CycleType.TYPE_PATH_ROTATE}, m = "invokeSuspend", n = {"$this$sequence"}, s = {"L$0"})
/* loaded from: classes.dex */
final class ViewKt$allViews$1 extends RestrictedSuspendLambda implements Function2<SequenceScope<? super View>, Continuation<? super Unit>, Object> {
final /* synthetic */ View $this_allViews;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
ViewKt$allViews$1(View view, Continuation<? super ViewKt$allViews$1> continuation) {
super(2, continuation);
this.$this_allViews = view;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
ViewKt$allViews$1 viewKt$allViews$1 = new ViewKt$allViews$1(this.$this_allViews, continuation);
viewKt$allViews$1.L$0 = obj;
return viewKt$allViews$1;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(SequenceScope<? super View> sequenceScope, Continuation<? super Unit> continuation) {
return ((ViewKt$allViews$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
SequenceScope sequenceScope;
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
sequenceScope = (SequenceScope) this.L$0;
this.L$0 = sequenceScope;
this.label = 1;
if (sequenceScope.yield(this.$this_allViews, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
if (i == 2) {
ResultKt.throwOnFailure(obj);
return Unit.INSTANCE;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
sequenceScope = (SequenceScope) this.L$0;
ResultKt.throwOnFailure(obj);
}
View view = this.$this_allViews;
if (view instanceof ViewGroup) {
this.L$0 = null;
this.label = 2;
if (sequenceScope.yieldAll(ViewGroupKt.getDescendants((ViewGroup) view), this) == coroutine_suspended) {
return coroutine_suspended;
}
}
return Unit.INSTANCE;
}
}

View File

@ -0,0 +1,24 @@
package androidx.core.view;
import android.view.ViewParent;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.FunctionReferenceImpl;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: View.kt */
@Metadata(k = 3, mv = {1, 7, 1}, xi = 48)
/* loaded from: classes.dex */
/* synthetic */ class ViewKt$ancestors$1 extends FunctionReferenceImpl implements Function1<ViewParent, ViewParent> {
public static final ViewKt$ancestors$1 INSTANCE = new ViewKt$ancestors$1();
ViewKt$ancestors$1() {
super(1, ViewParent.class, "getParent", "getParent()Landroid/view/ViewParent;", 0);
}
@Override // kotlin.jvm.functions.Function1
public final ViewParent invoke(ViewParent p0) {
Intrinsics.checkNotNullParameter(p0, "p0");
return p0.getParent();
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,196 @@
package androidx.core.view;
import android.util.Log;
import android.view.View;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
/* loaded from: classes.dex */
public final class ViewParentCompat {
private static final String TAG = "ViewParentCompat";
private static int[] sTempNestedScrollConsumed;
private ViewParentCompat() {
}
@Deprecated
public static boolean requestSendAccessibilityEvent(ViewParent viewParent, View view, AccessibilityEvent accessibilityEvent) {
return viewParent.requestSendAccessibilityEvent(view, accessibilityEvent);
}
public static boolean onStartNestedScroll(ViewParent viewParent, View view, View view2, int i) {
return onStartNestedScroll(viewParent, view, view2, i, 0);
}
public static void onNestedScrollAccepted(ViewParent viewParent, View view, View view2, int i) {
onNestedScrollAccepted(viewParent, view, view2, i, 0);
}
public static void onStopNestedScroll(ViewParent viewParent, View view) {
onStopNestedScroll(viewParent, view, 0);
}
public static void onNestedScroll(ViewParent viewParent, View view, int i, int i2, int i3, int i4) {
onNestedScroll(viewParent, view, i, i2, i3, i4, 0, getTempNestedScrollConsumed());
}
public static void onNestedScroll(ViewParent viewParent, View view, int i, int i2, int i3, int i4, int i5) {
onNestedScroll(viewParent, view, i, i2, i3, i4, i5, getTempNestedScrollConsumed());
}
public static void onNestedPreScroll(ViewParent viewParent, View view, int i, int i2, int[] iArr) {
onNestedPreScroll(viewParent, view, i, i2, iArr, 0);
}
public static boolean onStartNestedScroll(ViewParent viewParent, View view, View view2, int i, int i2) {
if (viewParent instanceof NestedScrollingParent2) {
return ((NestedScrollingParent2) viewParent).onStartNestedScroll(view, view2, i, i2);
}
if (i2 != 0) {
return false;
}
try {
return Api21Impl.onStartNestedScroll(viewParent, view, view2, i);
} catch (AbstractMethodError e) {
Log.e(TAG, "ViewParent " + viewParent + " does not implement interface method onStartNestedScroll", e);
return false;
}
}
public static void onNestedScrollAccepted(ViewParent viewParent, View view, View view2, int i, int i2) {
if (viewParent instanceof NestedScrollingParent2) {
((NestedScrollingParent2) viewParent).onNestedScrollAccepted(view, view2, i, i2);
return;
}
if (i2 == 0) {
try {
Api21Impl.onNestedScrollAccepted(viewParent, view, view2, i);
} catch (AbstractMethodError e) {
Log.e(TAG, "ViewParent " + viewParent + " does not implement interface method onNestedScrollAccepted", e);
}
}
}
public static void onStopNestedScroll(ViewParent viewParent, View view, int i) {
if (viewParent instanceof NestedScrollingParent2) {
((NestedScrollingParent2) viewParent).onStopNestedScroll(view, i);
return;
}
if (i == 0) {
try {
Api21Impl.onStopNestedScroll(viewParent, view);
} catch (AbstractMethodError e) {
Log.e(TAG, "ViewParent " + viewParent + " does not implement interface method onStopNestedScroll", e);
}
}
}
public static void onNestedScroll(ViewParent viewParent, View view, int i, int i2, int i3, int i4, int i5, int[] iArr) {
if (viewParent instanceof NestedScrollingParent3) {
((NestedScrollingParent3) viewParent).onNestedScroll(view, i, i2, i3, i4, i5, iArr);
return;
}
iArr[0] = iArr[0] + i3;
iArr[1] = iArr[1] + i4;
if (viewParent instanceof NestedScrollingParent2) {
((NestedScrollingParent2) viewParent).onNestedScroll(view, i, i2, i3, i4, i5);
return;
}
if (i5 == 0) {
try {
Api21Impl.onNestedScroll(viewParent, view, i, i2, i3, i4);
} catch (AbstractMethodError e) {
Log.e(TAG, "ViewParent " + viewParent + " does not implement interface method onNestedScroll", e);
}
}
}
public static void onNestedPreScroll(ViewParent viewParent, View view, int i, int i2, int[] iArr, int i3) {
if (viewParent instanceof NestedScrollingParent2) {
((NestedScrollingParent2) viewParent).onNestedPreScroll(view, i, i2, iArr, i3);
return;
}
if (i3 == 0) {
try {
Api21Impl.onNestedPreScroll(viewParent, view, i, i2, iArr);
} catch (AbstractMethodError e) {
Log.e(TAG, "ViewParent " + viewParent + " does not implement interface method onNestedPreScroll", e);
}
}
}
public static boolean onNestedFling(ViewParent viewParent, View view, float f, float f2, boolean z) {
try {
return Api21Impl.onNestedFling(viewParent, view, f, f2, z);
} catch (AbstractMethodError e) {
Log.e(TAG, "ViewParent " + viewParent + " does not implement interface method onNestedFling", e);
return false;
}
}
public static boolean onNestedPreFling(ViewParent viewParent, View view, float f, float f2) {
try {
return Api21Impl.onNestedPreFling(viewParent, view, f, f2);
} catch (AbstractMethodError e) {
Log.e(TAG, "ViewParent " + viewParent + " does not implement interface method onNestedPreFling", e);
return false;
}
}
public static void notifySubtreeAccessibilityStateChanged(ViewParent viewParent, View view, View view2, int i) {
Api19Impl.notifySubtreeAccessibilityStateChanged(viewParent, view, view2, i);
}
private static int[] getTempNestedScrollConsumed() {
int[] iArr = sTempNestedScrollConsumed;
if (iArr == null) {
sTempNestedScrollConsumed = new int[2];
} else {
iArr[0] = 0;
iArr[1] = 0;
}
return sTempNestedScrollConsumed;
}
static class Api19Impl {
private Api19Impl() {
}
static void notifySubtreeAccessibilityStateChanged(ViewParent viewParent, View view, View view2, int i) {
viewParent.notifySubtreeAccessibilityStateChanged(view, view2, i);
}
}
static class Api21Impl {
private Api21Impl() {
}
static boolean onStartNestedScroll(ViewParent viewParent, View view, View view2, int i) {
return viewParent.onStartNestedScroll(view, view2, i);
}
static void onNestedScrollAccepted(ViewParent viewParent, View view, View view2, int i) {
viewParent.onNestedScrollAccepted(view, view2, i);
}
static void onStopNestedScroll(ViewParent viewParent, View view) {
viewParent.onStopNestedScroll(view);
}
static void onNestedScroll(ViewParent viewParent, View view, int i, int i2, int i3, int i4) {
viewParent.onNestedScroll(view, i, i2, i3, i4);
}
static void onNestedPreScroll(ViewParent viewParent, View view, int i, int i2, int[] iArr) {
viewParent.onNestedPreScroll(view, i, i2, iArr);
}
static boolean onNestedFling(ViewParent viewParent, View view, float f, float f2, boolean z) {
return viewParent.onNestedFling(view, f, f2, z);
}
static boolean onNestedPreFling(ViewParent viewParent, View view, float f, float f2) {
return viewParent.onNestedPreFling(view, f, f2);
}
}
}

View File

@ -0,0 +1,455 @@
package androidx.core.view;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.view.View;
import android.view.ViewPropertyAnimator;
import android.view.animation.Interpolator;
import java.lang.ref.WeakReference;
/* loaded from: classes.dex */
public final class ViewPropertyAnimatorCompat {
static final int LISTENER_TAG_ID = 2113929216;
private final WeakReference<View> mView;
Runnable mStartAction = null;
Runnable mEndAction = null;
int mOldLayerType = -1;
ViewPropertyAnimatorCompat(View view) {
this.mView = new WeakReference<>(view);
}
static class ViewPropertyAnimatorListenerApi14 implements ViewPropertyAnimatorListener {
boolean mAnimEndCalled;
ViewPropertyAnimatorCompat mVpa;
ViewPropertyAnimatorListenerApi14(ViewPropertyAnimatorCompat viewPropertyAnimatorCompat) {
this.mVpa = viewPropertyAnimatorCompat;
}
@Override // androidx.core.view.ViewPropertyAnimatorListener
public void onAnimationStart(View view) {
this.mAnimEndCalled = false;
if (this.mVpa.mOldLayerType > -1) {
view.setLayerType(2, null);
}
if (this.mVpa.mStartAction != null) {
Runnable runnable = this.mVpa.mStartAction;
this.mVpa.mStartAction = null;
runnable.run();
}
Object tag = view.getTag(ViewPropertyAnimatorCompat.LISTENER_TAG_ID);
ViewPropertyAnimatorListener viewPropertyAnimatorListener = tag instanceof ViewPropertyAnimatorListener ? (ViewPropertyAnimatorListener) tag : null;
if (viewPropertyAnimatorListener != null) {
viewPropertyAnimatorListener.onAnimationStart(view);
}
}
@Override // androidx.core.view.ViewPropertyAnimatorListener
public void onAnimationEnd(View view) {
if (this.mVpa.mOldLayerType > -1) {
view.setLayerType(this.mVpa.mOldLayerType, null);
this.mVpa.mOldLayerType = -1;
}
if (this.mVpa.mEndAction != null) {
Runnable runnable = this.mVpa.mEndAction;
this.mVpa.mEndAction = null;
runnable.run();
}
Object tag = view.getTag(ViewPropertyAnimatorCompat.LISTENER_TAG_ID);
ViewPropertyAnimatorListener viewPropertyAnimatorListener = tag instanceof ViewPropertyAnimatorListener ? (ViewPropertyAnimatorListener) tag : null;
if (viewPropertyAnimatorListener != null) {
viewPropertyAnimatorListener.onAnimationEnd(view);
}
this.mAnimEndCalled = true;
}
@Override // androidx.core.view.ViewPropertyAnimatorListener
public void onAnimationCancel(View view) {
Object tag = view.getTag(ViewPropertyAnimatorCompat.LISTENER_TAG_ID);
ViewPropertyAnimatorListener viewPropertyAnimatorListener = tag instanceof ViewPropertyAnimatorListener ? (ViewPropertyAnimatorListener) tag : null;
if (viewPropertyAnimatorListener != null) {
viewPropertyAnimatorListener.onAnimationCancel(view);
}
}
}
public ViewPropertyAnimatorCompat setDuration(long j) {
View view = this.mView.get();
if (view != null) {
view.animate().setDuration(j);
}
return this;
}
public ViewPropertyAnimatorCompat alpha(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().alpha(f);
}
return this;
}
public ViewPropertyAnimatorCompat alphaBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().alphaBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat translationX(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().translationX(f);
}
return this;
}
public ViewPropertyAnimatorCompat translationY(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().translationY(f);
}
return this;
}
public ViewPropertyAnimatorCompat withEndAction(Runnable runnable) {
View view = this.mView.get();
if (view != null) {
Api16Impl.withEndAction(view.animate(), runnable);
}
return this;
}
public long getDuration() {
View view = this.mView.get();
if (view != null) {
return view.animate().getDuration();
}
return 0L;
}
public ViewPropertyAnimatorCompat setInterpolator(Interpolator interpolator) {
View view = this.mView.get();
if (view != null) {
view.animate().setInterpolator(interpolator);
}
return this;
}
public Interpolator getInterpolator() {
View view = this.mView.get();
if (view != null) {
return Api18Impl.getInterpolator(view.animate());
}
return null;
}
public ViewPropertyAnimatorCompat setStartDelay(long j) {
View view = this.mView.get();
if (view != null) {
view.animate().setStartDelay(j);
}
return this;
}
public long getStartDelay() {
View view = this.mView.get();
if (view != null) {
return view.animate().getStartDelay();
}
return 0L;
}
public ViewPropertyAnimatorCompat rotation(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().rotation(f);
}
return this;
}
public ViewPropertyAnimatorCompat rotationBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().rotationBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat rotationX(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().rotationX(f);
}
return this;
}
public ViewPropertyAnimatorCompat rotationXBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().rotationXBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat rotationY(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().rotationY(f);
}
return this;
}
public ViewPropertyAnimatorCompat rotationYBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().rotationYBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat scaleX(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().scaleX(f);
}
return this;
}
public ViewPropertyAnimatorCompat scaleXBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().scaleXBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat scaleY(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().scaleY(f);
}
return this;
}
public ViewPropertyAnimatorCompat scaleYBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().scaleYBy(f);
}
return this;
}
public void cancel() {
View view = this.mView.get();
if (view != null) {
view.animate().cancel();
}
}
public ViewPropertyAnimatorCompat x(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().x(f);
}
return this;
}
public ViewPropertyAnimatorCompat xBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().xBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat y(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().y(f);
}
return this;
}
public ViewPropertyAnimatorCompat yBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().yBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat translationXBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().translationXBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat translationYBy(float f) {
View view = this.mView.get();
if (view != null) {
view.animate().translationYBy(f);
}
return this;
}
public ViewPropertyAnimatorCompat translationZBy(float f) {
View view = this.mView.get();
if (view != null) {
Api21Impl.translationZBy(view.animate(), f);
}
return this;
}
public ViewPropertyAnimatorCompat translationZ(float f) {
View view = this.mView.get();
if (view != null) {
Api21Impl.translationZ(view.animate(), f);
}
return this;
}
public ViewPropertyAnimatorCompat z(float f) {
View view = this.mView.get();
if (view != null) {
Api21Impl.z(view.animate(), f);
}
return this;
}
public ViewPropertyAnimatorCompat zBy(float f) {
View view = this.mView.get();
if (view != null) {
Api21Impl.zBy(view.animate(), f);
}
return this;
}
public void start() {
View view = this.mView.get();
if (view != null) {
view.animate().start();
}
}
public ViewPropertyAnimatorCompat withLayer() {
View view = this.mView.get();
if (view != null) {
Api16Impl.withLayer(view.animate());
}
return this;
}
public ViewPropertyAnimatorCompat withStartAction(Runnable runnable) {
View view = this.mView.get();
if (view != null) {
Api16Impl.withStartAction(view.animate(), runnable);
}
return this;
}
public ViewPropertyAnimatorCompat setListener(ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
View view = this.mView.get();
if (view != null) {
setListenerInternal(view, viewPropertyAnimatorListener);
}
return this;
}
private void setListenerInternal(final View view, final ViewPropertyAnimatorListener viewPropertyAnimatorListener) {
if (viewPropertyAnimatorListener != null) {
view.animate().setListener(new AnimatorListenerAdapter() { // from class: androidx.core.view.ViewPropertyAnimatorCompat.1
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
public void onAnimationCancel(Animator animator) {
viewPropertyAnimatorListener.onAnimationCancel(view);
}
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
public void onAnimationEnd(Animator animator) {
viewPropertyAnimatorListener.onAnimationEnd(view);
}
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
public void onAnimationStart(Animator animator) {
viewPropertyAnimatorListener.onAnimationStart(view);
}
});
} else {
view.animate().setListener(null);
}
}
public ViewPropertyAnimatorCompat setUpdateListener(final ViewPropertyAnimatorUpdateListener viewPropertyAnimatorUpdateListener) {
final View view = this.mView.get();
if (view != null) {
Api19Impl.setUpdateListener(view.animate(), viewPropertyAnimatorUpdateListener != null ? new ValueAnimator.AnimatorUpdateListener() { // from class: androidx.core.view.ViewPropertyAnimatorCompat$$ExternalSyntheticLambda0
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public final void onAnimationUpdate(ValueAnimator valueAnimator) {
ViewPropertyAnimatorUpdateListener.this.onAnimationUpdate(view);
}
} : null);
}
return this;
}
static class Api16Impl {
private Api16Impl() {
}
static ViewPropertyAnimator withEndAction(ViewPropertyAnimator viewPropertyAnimator, Runnable runnable) {
return viewPropertyAnimator.withEndAction(runnable);
}
static ViewPropertyAnimator withLayer(ViewPropertyAnimator viewPropertyAnimator) {
return viewPropertyAnimator.withLayer();
}
static ViewPropertyAnimator withStartAction(ViewPropertyAnimator viewPropertyAnimator, Runnable runnable) {
return viewPropertyAnimator.withStartAction(runnable);
}
}
static class Api18Impl {
private Api18Impl() {
}
static Interpolator getInterpolator(ViewPropertyAnimator viewPropertyAnimator) {
return (Interpolator) viewPropertyAnimator.getInterpolator();
}
}
static class Api21Impl {
private Api21Impl() {
}
static ViewPropertyAnimator translationZBy(ViewPropertyAnimator viewPropertyAnimator, float f) {
return viewPropertyAnimator.translationZBy(f);
}
static ViewPropertyAnimator translationZ(ViewPropertyAnimator viewPropertyAnimator, float f) {
return viewPropertyAnimator.translationZ(f);
}
static ViewPropertyAnimator z(ViewPropertyAnimator viewPropertyAnimator, float f) {
return viewPropertyAnimator.z(f);
}
static ViewPropertyAnimator zBy(ViewPropertyAnimator viewPropertyAnimator, float f) {
return viewPropertyAnimator.zBy(f);
}
}
static class Api19Impl {
private Api19Impl() {
}
static ViewPropertyAnimator setUpdateListener(ViewPropertyAnimator viewPropertyAnimator, ValueAnimator.AnimatorUpdateListener animatorUpdateListener) {
return viewPropertyAnimator.setUpdateListener(animatorUpdateListener);
}
}
}

View File

@ -0,0 +1,12 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public interface ViewPropertyAnimatorListener {
void onAnimationCancel(View view);
void onAnimationEnd(View view);
void onAnimationStart(View view);
}

View File

@ -0,0 +1,18 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public class ViewPropertyAnimatorListenerAdapter implements ViewPropertyAnimatorListener {
@Override // androidx.core.view.ViewPropertyAnimatorListener
public void onAnimationCancel(View view) {
}
@Override // androidx.core.view.ViewPropertyAnimatorListener
public void onAnimationEnd(View view) {
}
@Override // androidx.core.view.ViewPropertyAnimatorListener
public void onAnimationStart(View view) {
}
}

View File

@ -0,0 +1,8 @@
package androidx.core.view;
import android.view.View;
/* loaded from: classes.dex */
public interface ViewPropertyAnimatorUpdateListener {
void onAnimationUpdate(View view);
}

View File

@ -0,0 +1,67 @@
package androidx.core.view;
import android.os.Build;
import android.view.View;
import android.view.Window;
/* loaded from: classes.dex */
public final class WindowCompat {
public static final int FEATURE_ACTION_BAR = 8;
public static final int FEATURE_ACTION_BAR_OVERLAY = 9;
public static final int FEATURE_ACTION_MODE_OVERLAY = 10;
private WindowCompat() {
}
public static <T extends View> T requireViewById(Window window, int i) {
if (Build.VERSION.SDK_INT >= 28) {
return (T) Api28Impl.requireViewById(window, i);
}
T t = (T) window.findViewById(i);
if (t != null) {
return t;
}
throw new IllegalArgumentException("ID does not reference a View inside this Window");
}
public static void setDecorFitsSystemWindows(Window window, boolean z) {
if (Build.VERSION.SDK_INT >= 30) {
Api30Impl.setDecorFitsSystemWindows(window, z);
} else {
Api16Impl.setDecorFitsSystemWindows(window, z);
}
}
public static WindowInsetsControllerCompat getInsetsController(Window window, View view) {
return new WindowInsetsControllerCompat(window, view);
}
static class Api16Impl {
private Api16Impl() {
}
static void setDecorFitsSystemWindows(Window window, boolean z) {
View decorView = window.getDecorView();
int systemUiVisibility = decorView.getSystemUiVisibility();
decorView.setSystemUiVisibility(z ? systemUiVisibility & (-1793) : systemUiVisibility | 1792);
}
}
static class Api30Impl {
private Api30Impl() {
}
static void setDecorFitsSystemWindows(Window window, boolean z) {
window.setDecorFitsSystemWindows(z);
}
}
static class Api28Impl {
private Api28Impl() {
}
static <T> T requireViewById(Window window, int i) {
return (T) window.requireViewById(i);
}
}
}

View File

@ -0,0 +1,540 @@
package androidx.core.view;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowInsets;
import android.view.WindowInsetsAnimation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import androidx.core.R;
import androidx.core.graphics.Insets;
import androidx.core.util.HalfKt$$ExternalSyntheticApiModelOutline0;
import androidx.core.view.WindowInsetsCompat;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
/* loaded from: classes.dex */
public final class WindowInsetsAnimationCompat {
private static final boolean DEBUG = false;
private static final String TAG = "WindowInsetsAnimCompat";
private Impl mImpl;
public WindowInsetsAnimationCompat(int i, Interpolator interpolator, long j) {
if (Build.VERSION.SDK_INT >= 30) {
this.mImpl = new Impl30(i, interpolator, j);
} else {
this.mImpl = new Impl21(i, interpolator, j);
}
}
private WindowInsetsAnimationCompat(WindowInsetsAnimation windowInsetsAnimation) {
this(0, null, 0L);
if (Build.VERSION.SDK_INT >= 30) {
this.mImpl = new Impl30(windowInsetsAnimation);
}
}
public int getTypeMask() {
return this.mImpl.getTypeMask();
}
public float getFraction() {
return this.mImpl.getFraction();
}
public float getInterpolatedFraction() {
return this.mImpl.getInterpolatedFraction();
}
public Interpolator getInterpolator() {
return this.mImpl.getInterpolator();
}
public long getDurationMillis() {
return this.mImpl.getDurationMillis();
}
public void setFraction(float f) {
this.mImpl.setFraction(f);
}
public float getAlpha() {
return this.mImpl.getAlpha();
}
public void setAlpha(float f) {
this.mImpl.setAlpha(f);
}
public static final class BoundsCompat {
private final Insets mLowerBound;
private final Insets mUpperBound;
public Insets getLowerBound() {
return this.mLowerBound;
}
public Insets getUpperBound() {
return this.mUpperBound;
}
public BoundsCompat(Insets insets, Insets insets2) {
this.mLowerBound = insets;
this.mUpperBound = insets2;
}
private BoundsCompat(WindowInsetsAnimation.Bounds bounds) {
this.mLowerBound = Impl30.getLowerBounds(bounds);
this.mUpperBound = Impl30.getHigherBounds(bounds);
}
public BoundsCompat inset(Insets insets) {
return new BoundsCompat(WindowInsetsCompat.insetInsets(this.mLowerBound, insets.left, insets.top, insets.right, insets.bottom), WindowInsetsCompat.insetInsets(this.mUpperBound, insets.left, insets.top, insets.right, insets.bottom));
}
public String toString() {
return "Bounds{lower=" + this.mLowerBound + " upper=" + this.mUpperBound + "}";
}
public WindowInsetsAnimation.Bounds toBounds() {
return Impl30.createPlatformBounds(this);
}
public static BoundsCompat toBoundsCompat(WindowInsetsAnimation.Bounds bounds) {
return new BoundsCompat(bounds);
}
}
static WindowInsetsAnimationCompat toWindowInsetsAnimationCompat(WindowInsetsAnimation windowInsetsAnimation) {
return new WindowInsetsAnimationCompat(windowInsetsAnimation);
}
public static abstract class Callback {
public static final int DISPATCH_MODE_CONTINUE_ON_SUBTREE = 1;
public static final int DISPATCH_MODE_STOP = 0;
WindowInsets mDispachedInsets;
private final int mDispatchMode;
@Retention(RetentionPolicy.SOURCE)
public @interface DispatchMode {
}
public final int getDispatchMode() {
return this.mDispatchMode;
}
public void onEnd(WindowInsetsAnimationCompat windowInsetsAnimationCompat) {
}
public void onPrepare(WindowInsetsAnimationCompat windowInsetsAnimationCompat) {
}
public abstract WindowInsetsCompat onProgress(WindowInsetsCompat windowInsetsCompat, List<WindowInsetsAnimationCompat> list);
public BoundsCompat onStart(WindowInsetsAnimationCompat windowInsetsAnimationCompat, BoundsCompat boundsCompat) {
return boundsCompat;
}
public Callback(int i) {
this.mDispatchMode = i;
}
}
static void setCallback(View view, Callback callback) {
if (Build.VERSION.SDK_INT >= 30) {
Impl30.setCallback(view, callback);
} else {
Impl21.setCallback(view, callback);
}
}
private static class Impl {
private float mAlpha;
private final long mDurationMillis;
private float mFraction;
private final Interpolator mInterpolator;
private final int mTypeMask;
public float getAlpha() {
return this.mAlpha;
}
public long getDurationMillis() {
return this.mDurationMillis;
}
public float getFraction() {
return this.mFraction;
}
public Interpolator getInterpolator() {
return this.mInterpolator;
}
public int getTypeMask() {
return this.mTypeMask;
}
public void setAlpha(float f) {
this.mAlpha = f;
}
public void setFraction(float f) {
this.mFraction = f;
}
Impl(int i, Interpolator interpolator, long j) {
this.mTypeMask = i;
this.mInterpolator = interpolator;
this.mDurationMillis = j;
}
public float getInterpolatedFraction() {
Interpolator interpolator = this.mInterpolator;
return interpolator != null ? interpolator.getInterpolation(this.mFraction) : this.mFraction;
}
}
private static class Impl21 extends Impl {
Impl21(int i, Interpolator interpolator, long j) {
super(i, interpolator, j);
}
static void setCallback(View view, Callback callback) {
Object tag = view.getTag(R.id.tag_on_apply_window_listener);
if (callback == null) {
view.setTag(R.id.tag_window_insets_animation_callback, null);
if (tag == null) {
view.setOnApplyWindowInsetsListener(null);
return;
}
return;
}
View.OnApplyWindowInsetsListener createProxyListener = createProxyListener(view, callback);
view.setTag(R.id.tag_window_insets_animation_callback, createProxyListener);
if (tag == null) {
view.setOnApplyWindowInsetsListener(createProxyListener);
}
}
private static View.OnApplyWindowInsetsListener createProxyListener(View view, Callback callback) {
return new Impl21OnApplyWindowInsetsListener(view, callback);
}
static BoundsCompat computeAnimationBounds(WindowInsetsCompat windowInsetsCompat, WindowInsetsCompat windowInsetsCompat2, int i) {
Insets insets = windowInsetsCompat.getInsets(i);
Insets insets2 = windowInsetsCompat2.getInsets(i);
return new BoundsCompat(Insets.of(Math.min(insets.left, insets2.left), Math.min(insets.top, insets2.top), Math.min(insets.right, insets2.right), Math.min(insets.bottom, insets2.bottom)), Insets.of(Math.max(insets.left, insets2.left), Math.max(insets.top, insets2.top), Math.max(insets.right, insets2.right), Math.max(insets.bottom, insets2.bottom)));
}
static int buildAnimationMask(WindowInsetsCompat windowInsetsCompat, WindowInsetsCompat windowInsetsCompat2) {
int i = 0;
for (int i2 = 1; i2 <= 256; i2 <<= 1) {
if (!windowInsetsCompat.getInsets(i2).equals(windowInsetsCompat2.getInsets(i2))) {
i |= i2;
}
}
return i;
}
static WindowInsetsCompat interpolateInsets(WindowInsetsCompat windowInsetsCompat, WindowInsetsCompat windowInsetsCompat2, float f, int i) {
WindowInsetsCompat.Builder builder = new WindowInsetsCompat.Builder(windowInsetsCompat);
for (int i2 = 1; i2 <= 256; i2 <<= 1) {
if ((i & i2) == 0) {
builder.setInsets(i2, windowInsetsCompat.getInsets(i2));
} else {
Insets insets = windowInsetsCompat.getInsets(i2);
Insets insets2 = windowInsetsCompat2.getInsets(i2);
float f2 = 1.0f - f;
builder.setInsets(i2, WindowInsetsCompat.insetInsets(insets, (int) (((insets.left - insets2.left) * f2) + 0.5d), (int) (((insets.top - insets2.top) * f2) + 0.5d), (int) (((insets.right - insets2.right) * f2) + 0.5d), (int) (((insets.bottom - insets2.bottom) * f2) + 0.5d)));
}
}
return builder.build();
}
private static class Impl21OnApplyWindowInsetsListener implements View.OnApplyWindowInsetsListener {
private static final int COMPAT_ANIMATION_DURATION = 160;
final Callback mCallback;
private WindowInsetsCompat mLastInsets;
Impl21OnApplyWindowInsetsListener(View view, Callback callback) {
this.mCallback = callback;
WindowInsetsCompat rootWindowInsets = ViewCompat.getRootWindowInsets(view);
this.mLastInsets = rootWindowInsets != null ? new WindowInsetsCompat.Builder(rootWindowInsets).build() : null;
}
@Override // android.view.View.OnApplyWindowInsetsListener
public WindowInsets onApplyWindowInsets(final View view, WindowInsets windowInsets) {
if (!view.isLaidOut()) {
this.mLastInsets = WindowInsetsCompat.toWindowInsetsCompat(windowInsets, view);
return Impl21.forwardToViewIfNeeded(view, windowInsets);
}
final WindowInsetsCompat windowInsetsCompat = WindowInsetsCompat.toWindowInsetsCompat(windowInsets, view);
if (this.mLastInsets == null) {
this.mLastInsets = ViewCompat.getRootWindowInsets(view);
}
if (this.mLastInsets == null) {
this.mLastInsets = windowInsetsCompat;
return Impl21.forwardToViewIfNeeded(view, windowInsets);
}
Callback callback = Impl21.getCallback(view);
if (callback != null && Objects.equals(callback.mDispachedInsets, windowInsets)) {
return Impl21.forwardToViewIfNeeded(view, windowInsets);
}
final int buildAnimationMask = Impl21.buildAnimationMask(windowInsetsCompat, this.mLastInsets);
if (buildAnimationMask == 0) {
return Impl21.forwardToViewIfNeeded(view, windowInsets);
}
final WindowInsetsCompat windowInsetsCompat2 = this.mLastInsets;
final WindowInsetsAnimationCompat windowInsetsAnimationCompat = new WindowInsetsAnimationCompat(buildAnimationMask, new DecelerateInterpolator(), 160L);
windowInsetsAnimationCompat.setFraction(0.0f);
final ValueAnimator duration = ValueAnimator.ofFloat(0.0f, 1.0f).setDuration(windowInsetsAnimationCompat.getDurationMillis());
final BoundsCompat computeAnimationBounds = Impl21.computeAnimationBounds(windowInsetsCompat, windowInsetsCompat2, buildAnimationMask);
Impl21.dispatchOnPrepare(view, windowInsetsAnimationCompat, windowInsets, false);
duration.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { // from class: androidx.core.view.WindowInsetsAnimationCompat.Impl21.Impl21OnApplyWindowInsetsListener.1
@Override // android.animation.ValueAnimator.AnimatorUpdateListener
public void onAnimationUpdate(ValueAnimator valueAnimator) {
windowInsetsAnimationCompat.setFraction(valueAnimator.getAnimatedFraction());
Impl21.dispatchOnProgress(view, Impl21.interpolateInsets(windowInsetsCompat, windowInsetsCompat2, windowInsetsAnimationCompat.getInterpolatedFraction(), buildAnimationMask), Collections.singletonList(windowInsetsAnimationCompat));
}
});
duration.addListener(new AnimatorListenerAdapter() { // from class: androidx.core.view.WindowInsetsAnimationCompat.Impl21.Impl21OnApplyWindowInsetsListener.2
@Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
public void onAnimationEnd(Animator animator) {
windowInsetsAnimationCompat.setFraction(1.0f);
Impl21.dispatchOnEnd(view, windowInsetsAnimationCompat);
}
});
OneShotPreDrawListener.add(view, new Runnable() { // from class: androidx.core.view.WindowInsetsAnimationCompat.Impl21.Impl21OnApplyWindowInsetsListener.3
@Override // java.lang.Runnable
public void run() {
Impl21.dispatchOnStart(view, windowInsetsAnimationCompat, computeAnimationBounds);
duration.start();
}
});
this.mLastInsets = windowInsetsCompat;
return Impl21.forwardToViewIfNeeded(view, windowInsets);
}
}
static WindowInsets forwardToViewIfNeeded(View view, WindowInsets windowInsets) {
return view.getTag(R.id.tag_on_apply_window_listener) != null ? windowInsets : view.onApplyWindowInsets(windowInsets);
}
static void dispatchOnPrepare(View view, WindowInsetsAnimationCompat windowInsetsAnimationCompat, WindowInsets windowInsets, boolean z) {
Callback callback = getCallback(view);
if (callback != null) {
callback.mDispachedInsets = windowInsets;
if (!z) {
callback.onPrepare(windowInsetsAnimationCompat);
z = callback.getDispatchMode() == 0;
}
}
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
dispatchOnPrepare(viewGroup.getChildAt(i), windowInsetsAnimationCompat, windowInsets, z);
}
}
}
static void dispatchOnStart(View view, WindowInsetsAnimationCompat windowInsetsAnimationCompat, BoundsCompat boundsCompat) {
Callback callback = getCallback(view);
if (callback != null) {
callback.onStart(windowInsetsAnimationCompat, boundsCompat);
if (callback.getDispatchMode() == 0) {
return;
}
}
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
dispatchOnStart(viewGroup.getChildAt(i), windowInsetsAnimationCompat, boundsCompat);
}
}
}
static void dispatchOnProgress(View view, WindowInsetsCompat windowInsetsCompat, List<WindowInsetsAnimationCompat> list) {
Callback callback = getCallback(view);
if (callback != null) {
windowInsetsCompat = callback.onProgress(windowInsetsCompat, list);
if (callback.getDispatchMode() == 0) {
return;
}
}
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
dispatchOnProgress(viewGroup.getChildAt(i), windowInsetsCompat, list);
}
}
}
static void dispatchOnEnd(View view, WindowInsetsAnimationCompat windowInsetsAnimationCompat) {
Callback callback = getCallback(view);
if (callback != null) {
callback.onEnd(windowInsetsAnimationCompat);
if (callback.getDispatchMode() == 0) {
return;
}
}
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
dispatchOnEnd(viewGroup.getChildAt(i), windowInsetsAnimationCompat);
}
}
}
static Callback getCallback(View view) {
Object tag = view.getTag(R.id.tag_window_insets_animation_callback);
if (tag instanceof Impl21OnApplyWindowInsetsListener) {
return ((Impl21OnApplyWindowInsetsListener) tag).mCallback;
}
return null;
}
}
private static class Impl30 extends Impl {
private final WindowInsetsAnimation mWrapped;
Impl30(WindowInsetsAnimation windowInsetsAnimation) {
super(0, null, 0L);
this.mWrapped = windowInsetsAnimation;
}
Impl30(int i, Interpolator interpolator, long j) {
this(HalfKt$$ExternalSyntheticApiModelOutline0.m(i, interpolator, j));
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Impl
public int getTypeMask() {
int typeMask;
typeMask = this.mWrapped.getTypeMask();
return typeMask;
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Impl
public Interpolator getInterpolator() {
Interpolator interpolator;
interpolator = this.mWrapped.getInterpolator();
return interpolator;
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Impl
public long getDurationMillis() {
long durationMillis;
durationMillis = this.mWrapped.getDurationMillis();
return durationMillis;
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Impl
public float getFraction() {
float fraction;
fraction = this.mWrapped.getFraction();
return fraction;
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Impl
public void setFraction(float f) {
this.mWrapped.setFraction(f);
}
@Override // androidx.core.view.WindowInsetsAnimationCompat.Impl
public float getInterpolatedFraction() {
float interpolatedFraction;
interpolatedFraction = this.mWrapped.getInterpolatedFraction();
return interpolatedFraction;
}
private static class ProxyCallback extends WindowInsetsAnimation.Callback {
private final HashMap<WindowInsetsAnimation, WindowInsetsAnimationCompat> mAnimations;
private final Callback mCompat;
private List<WindowInsetsAnimationCompat> mRORunningAnimations;
private ArrayList<WindowInsetsAnimationCompat> mTmpRunningAnimations;
ProxyCallback(Callback callback) {
super(callback.getDispatchMode());
this.mAnimations = new HashMap<>();
this.mCompat = callback;
}
private WindowInsetsAnimationCompat getWindowInsetsAnimationCompat(WindowInsetsAnimation windowInsetsAnimation) {
WindowInsetsAnimationCompat windowInsetsAnimationCompat = this.mAnimations.get(windowInsetsAnimation);
if (windowInsetsAnimationCompat != null) {
return windowInsetsAnimationCompat;
}
WindowInsetsAnimationCompat windowInsetsAnimationCompat2 = WindowInsetsAnimationCompat.toWindowInsetsAnimationCompat(windowInsetsAnimation);
this.mAnimations.put(windowInsetsAnimation, windowInsetsAnimationCompat2);
return windowInsetsAnimationCompat2;
}
@Override // android.view.WindowInsetsAnimation.Callback
public void onPrepare(WindowInsetsAnimation windowInsetsAnimation) {
this.mCompat.onPrepare(getWindowInsetsAnimationCompat(windowInsetsAnimation));
}
@Override // android.view.WindowInsetsAnimation.Callback
public WindowInsetsAnimation.Bounds onStart(WindowInsetsAnimation windowInsetsAnimation, WindowInsetsAnimation.Bounds bounds) {
return this.mCompat.onStart(getWindowInsetsAnimationCompat(windowInsetsAnimation), BoundsCompat.toBoundsCompat(bounds)).toBounds();
}
@Override // android.view.WindowInsetsAnimation.Callback
public WindowInsets onProgress(WindowInsets windowInsets, List<WindowInsetsAnimation> list) {
float fraction;
ArrayList<WindowInsetsAnimationCompat> arrayList = this.mTmpRunningAnimations;
if (arrayList == null) {
ArrayList<WindowInsetsAnimationCompat> arrayList2 = new ArrayList<>(list.size());
this.mTmpRunningAnimations = arrayList2;
this.mRORunningAnimations = Collections.unmodifiableList(arrayList2);
} else {
arrayList.clear();
}
for (int size = list.size() - 1; size >= 0; size--) {
WindowInsetsAnimation m147m = HalfKt$$ExternalSyntheticApiModelOutline0.m147m((Object) list.get(size));
WindowInsetsAnimationCompat windowInsetsAnimationCompat = getWindowInsetsAnimationCompat(m147m);
fraction = m147m.getFraction();
windowInsetsAnimationCompat.setFraction(fraction);
this.mTmpRunningAnimations.add(windowInsetsAnimationCompat);
}
return this.mCompat.onProgress(WindowInsetsCompat.toWindowInsetsCompat(windowInsets), this.mRORunningAnimations).toWindowInsets();
}
@Override // android.view.WindowInsetsAnimation.Callback
public void onEnd(WindowInsetsAnimation windowInsetsAnimation) {
this.mCompat.onEnd(getWindowInsetsAnimationCompat(windowInsetsAnimation));
this.mAnimations.remove(windowInsetsAnimation);
}
}
public static void setCallback(View view, Callback callback) {
view.setWindowInsetsAnimationCallback(callback != null ? new ProxyCallback(callback) : null);
}
public static WindowInsetsAnimation.Bounds createPlatformBounds(BoundsCompat boundsCompat) {
HalfKt$$ExternalSyntheticApiModelOutline0.m156m$1();
return HalfKt$$ExternalSyntheticApiModelOutline0.m(boundsCompat.getLowerBound().toPlatformInsets(), boundsCompat.getUpperBound().toPlatformInsets());
}
public static Insets getLowerBounds(WindowInsetsAnimation.Bounds bounds) {
android.graphics.Insets lowerBound;
lowerBound = bounds.getLowerBound();
return Insets.toCompatInsets(lowerBound);
}
public static Insets getHigherBounds(WindowInsetsAnimation.Bounds bounds) {
android.graphics.Insets upperBound;
upperBound = bounds.getUpperBound();
return Insets.toCompatInsets(upperBound);
}
}
}

View File

@ -0,0 +1,10 @@
package androidx.core.view;
/* loaded from: classes.dex */
public interface WindowInsetsAnimationControlListenerCompat {
void onCancelled(WindowInsetsAnimationControllerCompat windowInsetsAnimationControllerCompat);
void onFinished(WindowInsetsAnimationControllerCompat windowInsetsAnimationControllerCompat);
void onReady(WindowInsetsAnimationControllerCompat windowInsetsAnimationControllerCompat, int i);
}

View File

@ -0,0 +1,174 @@
package androidx.core.view;
import android.view.WindowInsetsAnimationController;
import androidx.core.graphics.Insets;
/* loaded from: classes.dex */
public final class WindowInsetsAnimationControllerCompat {
private final Impl mImpl;
WindowInsetsAnimationControllerCompat(WindowInsetsAnimationController windowInsetsAnimationController) {
this.mImpl = new Impl30(windowInsetsAnimationController);
}
public Insets getHiddenStateInsets() {
return this.mImpl.getHiddenStateInsets();
}
public Insets getShownStateInsets() {
return this.mImpl.getShownStateInsets();
}
public Insets getCurrentInsets() {
return this.mImpl.getCurrentInsets();
}
public float getCurrentFraction() {
return this.mImpl.getCurrentFraction();
}
public float getCurrentAlpha() {
return this.mImpl.getCurrentAlpha();
}
public int getTypes() {
return this.mImpl.getTypes();
}
public void setInsetsAndAlpha(Insets insets, float f, float f2) {
this.mImpl.setInsetsAndAlpha(insets, f, f2);
}
public void finish(boolean z) {
this.mImpl.finish(z);
}
public boolean isReady() {
return (isFinished() || isCancelled()) ? false : true;
}
public boolean isFinished() {
return this.mImpl.isFinished();
}
public boolean isCancelled() {
return this.mImpl.isCancelled();
}
private static class Impl {
void finish(boolean z) {
}
public float getCurrentAlpha() {
return 0.0f;
}
public float getCurrentFraction() {
return 0.0f;
}
public int getTypes() {
return 0;
}
boolean isCancelled() {
return true;
}
boolean isFinished() {
return false;
}
public void setInsetsAndAlpha(Insets insets, float f, float f2) {
}
Impl() {
}
public Insets getHiddenStateInsets() {
return Insets.NONE;
}
public Insets getShownStateInsets() {
return Insets.NONE;
}
public Insets getCurrentInsets() {
return Insets.NONE;
}
}
private static class Impl30 extends Impl {
private final WindowInsetsAnimationController mController;
Impl30(WindowInsetsAnimationController windowInsetsAnimationController) {
this.mController = windowInsetsAnimationController;
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
public Insets getHiddenStateInsets() {
android.graphics.Insets hiddenStateInsets;
hiddenStateInsets = this.mController.getHiddenStateInsets();
return Insets.toCompatInsets(hiddenStateInsets);
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
public Insets getShownStateInsets() {
android.graphics.Insets shownStateInsets;
shownStateInsets = this.mController.getShownStateInsets();
return Insets.toCompatInsets(shownStateInsets);
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
public Insets getCurrentInsets() {
android.graphics.Insets currentInsets;
currentInsets = this.mController.getCurrentInsets();
return Insets.toCompatInsets(currentInsets);
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
public float getCurrentFraction() {
float currentFraction;
currentFraction = this.mController.getCurrentFraction();
return currentFraction;
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
public float getCurrentAlpha() {
float currentAlpha;
currentAlpha = this.mController.getCurrentAlpha();
return currentAlpha;
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
public int getTypes() {
int types;
types = this.mController.getTypes();
return types;
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
public void setInsetsAndAlpha(Insets insets, float f, float f2) {
this.mController.setInsetsAndAlpha(insets == null ? null : insets.toPlatformInsets(), f, f2);
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
void finish(boolean z) {
this.mController.finish(z);
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
boolean isFinished() {
boolean isFinished;
isFinished = this.mController.isFinished();
return isFinished;
}
@Override // androidx.core.view.WindowInsetsAnimationControllerCompat.Impl
boolean isCancelled() {
boolean isCancelled;
isCancelled = this.mController.isCancelled();
return isCancelled;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,471 @@
package androidx.core.view;
import android.R;
import android.os.Build;
import android.os.CancellationSignal;
import android.view.View;
import android.view.Window;
import android.view.WindowInsetsAnimationControlListener;
import android.view.WindowInsetsAnimationController;
import android.view.WindowInsetsController;
import android.view.animation.Interpolator;
import android.view.inputmethod.InputMethodManager;
import androidx.collection.SimpleArrayMap;
import androidx.core.util.HalfKt$$ExternalSyntheticApiModelOutline0;
import androidx.core.view.WindowInsetsControllerCompat;
/* loaded from: classes.dex */
public final class WindowInsetsControllerCompat {
public static final int BEHAVIOR_SHOW_BARS_BY_SWIPE = 1;
public static final int BEHAVIOR_SHOW_BARS_BY_TOUCH = 0;
public static final int BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE = 2;
private final Impl mImpl;
public interface OnControllableInsetsChangedListener {
void onControllableInsetsChanged(WindowInsetsControllerCompat windowInsetsControllerCompat, int i);
}
@Deprecated
private WindowInsetsControllerCompat(WindowInsetsController windowInsetsController) {
this.mImpl = new Impl30(windowInsetsController, this);
}
public WindowInsetsControllerCompat(Window window, View view) {
if (Build.VERSION.SDK_INT >= 30) {
this.mImpl = new Impl30(window, this);
return;
}
if (Build.VERSION.SDK_INT >= 26) {
this.mImpl = new Impl26(window, view);
} else if (Build.VERSION.SDK_INT >= 23) {
this.mImpl = new Impl23(window, view);
} else {
this.mImpl = new Impl20(window, view);
}
}
@Deprecated
public static WindowInsetsControllerCompat toWindowInsetsControllerCompat(WindowInsetsController windowInsetsController) {
return new WindowInsetsControllerCompat(windowInsetsController);
}
public void show(int i) {
this.mImpl.show(i);
}
public void hide(int i) {
this.mImpl.hide(i);
}
public boolean isAppearanceLightStatusBars() {
return this.mImpl.isAppearanceLightStatusBars();
}
public void setAppearanceLightStatusBars(boolean z) {
this.mImpl.setAppearanceLightStatusBars(z);
}
public boolean isAppearanceLightNavigationBars() {
return this.mImpl.isAppearanceLightNavigationBars();
}
public void setAppearanceLightNavigationBars(boolean z) {
this.mImpl.setAppearanceLightNavigationBars(z);
}
public void controlWindowInsetsAnimation(int i, long j, Interpolator interpolator, CancellationSignal cancellationSignal, WindowInsetsAnimationControlListenerCompat windowInsetsAnimationControlListenerCompat) {
this.mImpl.controlWindowInsetsAnimation(i, j, interpolator, cancellationSignal, windowInsetsAnimationControlListenerCompat);
}
public void setSystemBarsBehavior(int i) {
this.mImpl.setSystemBarsBehavior(i);
}
public int getSystemBarsBehavior() {
return this.mImpl.getSystemBarsBehavior();
}
public void addOnControllableInsetsChangedListener(OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
this.mImpl.addOnControllableInsetsChangedListener(onControllableInsetsChangedListener);
}
public void removeOnControllableInsetsChangedListener(OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
this.mImpl.removeOnControllableInsetsChangedListener(onControllableInsetsChangedListener);
}
private static class Impl {
void addOnControllableInsetsChangedListener(OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
}
void controlWindowInsetsAnimation(int i, long j, Interpolator interpolator, CancellationSignal cancellationSignal, WindowInsetsAnimationControlListenerCompat windowInsetsAnimationControlListenerCompat) {
}
int getSystemBarsBehavior() {
return 0;
}
void hide(int i) {
}
public boolean isAppearanceLightNavigationBars() {
return false;
}
public boolean isAppearanceLightStatusBars() {
return false;
}
void removeOnControllableInsetsChangedListener(OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
}
public void setAppearanceLightNavigationBars(boolean z) {
}
public void setAppearanceLightStatusBars(boolean z) {
}
void setSystemBarsBehavior(int i) {
}
void show(int i) {
}
Impl() {
}
}
/* JADX INFO: Access modifiers changed from: private */
static class Impl20 extends Impl {
private final View mView;
protected final Window mWindow;
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void addOnControllableInsetsChangedListener(OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void controlWindowInsetsAnimation(int i, long j, Interpolator interpolator, CancellationSignal cancellationSignal, WindowInsetsAnimationControlListenerCompat windowInsetsAnimationControlListenerCompat) {
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
int getSystemBarsBehavior() {
return 0;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void removeOnControllableInsetsChangedListener(OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
}
Impl20(Window window, View view) {
this.mWindow = window;
this.mView = view;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void show(int i) {
for (int i2 = 1; i2 <= 256; i2 <<= 1) {
if ((i & i2) != 0) {
showForType(i2);
}
}
}
private void showForType(int i) {
if (i == 1) {
unsetSystemUiFlag(4);
unsetWindowFlag(1024);
return;
}
if (i == 2) {
unsetSystemUiFlag(2);
return;
}
if (i != 8) {
return;
}
final View view = this.mView;
if (view.isInEditMode() || view.onCheckIsTextEditor()) {
view.requestFocus();
} else {
view = this.mWindow.getCurrentFocus();
}
if (view == null) {
view = this.mWindow.findViewById(R.id.content);
}
if (view == null || !view.hasWindowFocus()) {
return;
}
view.post(new Runnable() { // from class: androidx.core.view.WindowInsetsControllerCompat$Impl20$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
((InputMethodManager) r0.getContext().getSystemService("input_method")).showSoftInput(view, 0);
}
});
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void hide(int i) {
for (int i2 = 1; i2 <= 256; i2 <<= 1) {
if ((i & i2) != 0) {
hideForType(i2);
}
}
}
private void hideForType(int i) {
if (i == 1) {
setSystemUiFlag(4);
} else if (i == 2) {
setSystemUiFlag(2);
} else {
if (i != 8) {
return;
}
((InputMethodManager) this.mWindow.getContext().getSystemService("input_method")).hideSoftInputFromWindow(this.mWindow.getDecorView().getWindowToken(), 0);
}
}
protected void setSystemUiFlag(int i) {
View decorView = this.mWindow.getDecorView();
decorView.setSystemUiVisibility(i | decorView.getSystemUiVisibility());
}
protected void unsetSystemUiFlag(int i) {
View decorView = this.mWindow.getDecorView();
decorView.setSystemUiVisibility((~i) & decorView.getSystemUiVisibility());
}
protected void setWindowFlag(int i) {
this.mWindow.addFlags(i);
}
protected void unsetWindowFlag(int i) {
this.mWindow.clearFlags(i);
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void setSystemBarsBehavior(int i) {
if (i == 0) {
unsetSystemUiFlag(6144);
return;
}
if (i == 1) {
unsetSystemUiFlag(4096);
setSystemUiFlag(2048);
} else {
if (i != 2) {
return;
}
unsetSystemUiFlag(2048);
setSystemUiFlag(4096);
}
}
}
private static class Impl23 extends Impl20 {
Impl23(Window window, View view) {
super(window, view);
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public boolean isAppearanceLightStatusBars() {
return (this.mWindow.getDecorView().getSystemUiVisibility() & 8192) != 0;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public void setAppearanceLightStatusBars(boolean z) {
if (z) {
unsetWindowFlag(67108864);
setWindowFlag(Integer.MIN_VALUE);
setSystemUiFlag(8192);
return;
}
unsetSystemUiFlag(8192);
}
}
private static class Impl26 extends Impl23 {
Impl26(Window window, View view) {
super(window, view);
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public boolean isAppearanceLightNavigationBars() {
return (this.mWindow.getDecorView().getSystemUiVisibility() & 16) != 0;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public void setAppearanceLightNavigationBars(boolean z) {
if (z) {
unsetWindowFlag(134217728);
setWindowFlag(Integer.MIN_VALUE);
setSystemUiFlag(16);
return;
}
unsetSystemUiFlag(16);
}
}
/* JADX INFO: Access modifiers changed from: private */
static class Impl30 extends Impl {
final WindowInsetsControllerCompat mCompatController;
final WindowInsetsController mInsetsController;
private final SimpleArrayMap<OnControllableInsetsChangedListener, WindowInsetsController.OnControllableInsetsChangedListener> mListeners;
protected Window mWindow;
/* JADX WARN: Illegal instructions before constructor call */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
Impl30(android.view.Window r2, androidx.core.view.WindowInsetsControllerCompat r3) {
/*
r1 = this;
android.view.WindowInsetsController r0 = androidx.core.util.HalfKt$$ExternalSyntheticApiModelOutline0.m(r2)
r1.<init>(r0, r3)
r1.mWindow = r2
return
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.core.view.WindowInsetsControllerCompat.Impl30.<init>(android.view.Window, androidx.core.view.WindowInsetsControllerCompat):void");
}
Impl30(WindowInsetsController windowInsetsController, WindowInsetsControllerCompat windowInsetsControllerCompat) {
this.mListeners = new SimpleArrayMap<>();
this.mInsetsController = windowInsetsController;
this.mCompatController = windowInsetsControllerCompat;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void show(int i) {
if (this.mWindow != null && (i & 8) != 0 && Build.VERSION.SDK_INT < 32) {
((InputMethodManager) this.mWindow.getContext().getSystemService("input_method")).isActive();
}
this.mInsetsController.show(i);
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void hide(int i) {
this.mInsetsController.hide(i);
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public boolean isAppearanceLightStatusBars() {
int systemBarsAppearance;
systemBarsAppearance = this.mInsetsController.getSystemBarsAppearance();
return (systemBarsAppearance & 8) != 0;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public void setAppearanceLightStatusBars(boolean z) {
if (z) {
if (this.mWindow != null) {
setSystemUiFlag(8192);
}
this.mInsetsController.setSystemBarsAppearance(8, 8);
} else {
if (this.mWindow != null) {
unsetSystemUiFlag(8192);
}
this.mInsetsController.setSystemBarsAppearance(0, 8);
}
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public boolean isAppearanceLightNavigationBars() {
int systemBarsAppearance;
systemBarsAppearance = this.mInsetsController.getSystemBarsAppearance();
return (systemBarsAppearance & 16) != 0;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
public void setAppearanceLightNavigationBars(boolean z) {
if (z) {
if (this.mWindow != null) {
setSystemUiFlag(16);
}
this.mInsetsController.setSystemBarsAppearance(16, 16);
} else {
if (this.mWindow != null) {
unsetSystemUiFlag(16);
}
this.mInsetsController.setSystemBarsAppearance(0, 16);
}
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void controlWindowInsetsAnimation(int i, long j, Interpolator interpolator, CancellationSignal cancellationSignal, final WindowInsetsAnimationControlListenerCompat windowInsetsAnimationControlListenerCompat) {
this.mInsetsController.controlWindowInsetsAnimation(i, j, interpolator, cancellationSignal, new WindowInsetsAnimationControlListener() { // from class: androidx.core.view.WindowInsetsControllerCompat.Impl30.1
private WindowInsetsAnimationControllerCompat mCompatAnimController = null;
@Override // android.view.WindowInsetsAnimationControlListener
public void onReady(WindowInsetsAnimationController windowInsetsAnimationController, int i2) {
WindowInsetsAnimationControllerCompat windowInsetsAnimationControllerCompat = new WindowInsetsAnimationControllerCompat(windowInsetsAnimationController);
this.mCompatAnimController = windowInsetsAnimationControllerCompat;
windowInsetsAnimationControlListenerCompat.onReady(windowInsetsAnimationControllerCompat, i2);
}
@Override // android.view.WindowInsetsAnimationControlListener
public void onFinished(WindowInsetsAnimationController windowInsetsAnimationController) {
windowInsetsAnimationControlListenerCompat.onFinished(this.mCompatAnimController);
}
@Override // android.view.WindowInsetsAnimationControlListener
public void onCancelled(WindowInsetsAnimationController windowInsetsAnimationController) {
windowInsetsAnimationControlListenerCompat.onCancelled(windowInsetsAnimationController == null ? null : this.mCompatAnimController);
}
});
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void setSystemBarsBehavior(int i) {
this.mInsetsController.setSystemBarsBehavior(i);
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
int getSystemBarsBehavior() {
int systemBarsBehavior;
systemBarsBehavior = this.mInsetsController.getSystemBarsBehavior();
return systemBarsBehavior;
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void addOnControllableInsetsChangedListener(final OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
if (this.mListeners.containsKey(onControllableInsetsChangedListener)) {
return;
}
WindowInsetsController.OnControllableInsetsChangedListener onControllableInsetsChangedListener2 = new WindowInsetsController.OnControllableInsetsChangedListener() { // from class: androidx.core.view.WindowInsetsControllerCompat$Impl30$$ExternalSyntheticLambda11
@Override // android.view.WindowInsetsController.OnControllableInsetsChangedListener
public final void onControllableInsetsChanged(WindowInsetsController windowInsetsController, int i) {
WindowInsetsControllerCompat.Impl30.this.m162xe96d8c51(onControllableInsetsChangedListener, windowInsetsController, i);
}
};
this.mListeners.put(onControllableInsetsChangedListener, onControllableInsetsChangedListener2);
this.mInsetsController.addOnControllableInsetsChangedListener(onControllableInsetsChangedListener2);
}
/* renamed from: lambda$addOnControllableInsetsChangedListener$0$androidx-core-view-WindowInsetsControllerCompat$Impl30, reason: not valid java name */
/* synthetic */ void m162xe96d8c51(OnControllableInsetsChangedListener onControllableInsetsChangedListener, WindowInsetsController windowInsetsController, int i) {
if (this.mInsetsController == windowInsetsController) {
onControllableInsetsChangedListener.onControllableInsetsChanged(this.mCompatController, i);
}
}
@Override // androidx.core.view.WindowInsetsControllerCompat.Impl
void removeOnControllableInsetsChangedListener(OnControllableInsetsChangedListener onControllableInsetsChangedListener) {
WindowInsetsController.OnControllableInsetsChangedListener m148m = HalfKt$$ExternalSyntheticApiModelOutline0.m148m((Object) this.mListeners.remove(onControllableInsetsChangedListener));
if (m148m != null) {
this.mInsetsController.removeOnControllableInsetsChangedListener(m148m);
}
}
protected void unsetSystemUiFlag(int i) {
View decorView = this.mWindow.getDecorView();
decorView.setSystemUiVisibility((~i) & decorView.getSystemUiVisibility());
}
protected void setSystemUiFlag(int i) {
View decorView = this.mWindow.getDecorView();
decorView.setSystemUiVisibility(i | decorView.getSystemUiVisibility());
}
}
}

View File

@ -0,0 +1,26 @@
package androidx.core.view.accessibility;
import android.os.Bundle;
import android.text.style.ClickableSpan;
import android.view.View;
/* loaded from: classes.dex */
public final class AccessibilityClickableSpanCompat extends ClickableSpan {
public static final String SPAN_ID = "ACCESSIBILITY_CLICKABLE_SPAN_ID";
private final int mClickableSpanActionId;
private final AccessibilityNodeInfoCompat mNodeInfoCompat;
private final int mOriginalClickableSpanId;
public AccessibilityClickableSpanCompat(int i, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat, int i2) {
this.mOriginalClickableSpanId = i;
this.mNodeInfoCompat = accessibilityNodeInfoCompat;
this.mClickableSpanActionId = i2;
}
@Override // android.text.style.ClickableSpan
public void onClick(View view) {
Bundle bundle = new Bundle();
bundle.putInt(SPAN_ID, this.mOriginalClickableSpanId);
this.mNodeInfoCompat.performAction(this.mClickableSpanActionId, bundle);
}
}

View File

@ -0,0 +1,139 @@
package androidx.core.view.accessibility;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityRecord;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/* loaded from: classes.dex */
public final class AccessibilityEventCompat {
public static final int CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION = 4;
public static final int CONTENT_CHANGE_TYPE_DRAG_CANCELLED = 512;
public static final int CONTENT_CHANGE_TYPE_DRAG_DROPPED = 256;
public static final int CONTENT_CHANGE_TYPE_DRAG_STARTED = 128;
public static final int CONTENT_CHANGE_TYPE_PANE_APPEARED = 16;
public static final int CONTENT_CHANGE_TYPE_PANE_DISAPPEARED = 32;
public static final int CONTENT_CHANGE_TYPE_PANE_TITLE = 8;
public static final int CONTENT_CHANGE_TYPE_STATE_DESCRIPTION = 64;
public static final int CONTENT_CHANGE_TYPE_SUBTREE = 1;
public static final int CONTENT_CHANGE_TYPE_TEXT = 2;
public static final int CONTENT_CHANGE_TYPE_UNDEFINED = 0;
public static final int TYPES_ALL_MASK = -1;
public static final int TYPE_ANNOUNCEMENT = 16384;
public static final int TYPE_ASSIST_READING_CONTEXT = 16777216;
public static final int TYPE_GESTURE_DETECTION_END = 524288;
public static final int TYPE_GESTURE_DETECTION_START = 262144;
@Deprecated
public static final int TYPE_TOUCH_EXPLORATION_GESTURE_END = 1024;
@Deprecated
public static final int TYPE_TOUCH_EXPLORATION_GESTURE_START = 512;
public static final int TYPE_TOUCH_INTERACTION_END = 2097152;
public static final int TYPE_TOUCH_INTERACTION_START = 1048576;
public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 32768;
public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 65536;
public static final int TYPE_VIEW_CONTEXT_CLICKED = 8388608;
@Deprecated
public static final int TYPE_VIEW_HOVER_ENTER = 128;
@Deprecated
public static final int TYPE_VIEW_HOVER_EXIT = 256;
@Deprecated
public static final int TYPE_VIEW_SCROLLED = 4096;
@Deprecated
public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192;
public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 131072;
public static final int TYPE_WINDOWS_CHANGED = 4194304;
@Deprecated
public static final int TYPE_WINDOW_CONTENT_CHANGED = 2048;
@Retention(RetentionPolicy.SOURCE)
public @interface ContentChangeType {
}
private AccessibilityEventCompat() {
}
@Deprecated
public static int getRecordCount(AccessibilityEvent accessibilityEvent) {
return accessibilityEvent.getRecordCount();
}
@Deprecated
public static void appendRecord(AccessibilityEvent accessibilityEvent, AccessibilityRecordCompat accessibilityRecordCompat) {
accessibilityEvent.appendRecord((AccessibilityRecord) accessibilityRecordCompat.getImpl());
}
@Deprecated
public static AccessibilityRecordCompat getRecord(AccessibilityEvent accessibilityEvent, int i) {
return new AccessibilityRecordCompat(accessibilityEvent.getRecord(i));
}
@Deprecated
public static AccessibilityRecordCompat asRecord(AccessibilityEvent accessibilityEvent) {
return new AccessibilityRecordCompat(accessibilityEvent);
}
public static void setContentChangeTypes(AccessibilityEvent accessibilityEvent, int i) {
Api19Impl.setContentChangeTypes(accessibilityEvent, i);
}
public static int getContentChangeTypes(AccessibilityEvent accessibilityEvent) {
return Api19Impl.getContentChangeTypes(accessibilityEvent);
}
public static void setMovementGranularity(AccessibilityEvent accessibilityEvent, int i) {
Api16Impl.setMovementGranularity(accessibilityEvent, i);
}
public static int getMovementGranularity(AccessibilityEvent accessibilityEvent) {
return Api16Impl.getMovementGranularity(accessibilityEvent);
}
public static void setAction(AccessibilityEvent accessibilityEvent, int i) {
Api16Impl.setAction(accessibilityEvent, i);
}
public static int getAction(AccessibilityEvent accessibilityEvent) {
return Api16Impl.getAction(accessibilityEvent);
}
static class Api19Impl {
private Api19Impl() {
}
static void setContentChangeTypes(AccessibilityEvent accessibilityEvent, int i) {
accessibilityEvent.setContentChangeTypes(i);
}
static int getContentChangeTypes(AccessibilityEvent accessibilityEvent) {
return accessibilityEvent.getContentChangeTypes();
}
}
static class Api16Impl {
private Api16Impl() {
}
static void setMovementGranularity(AccessibilityEvent accessibilityEvent, int i) {
accessibilityEvent.setMovementGranularity(i);
}
static int getMovementGranularity(AccessibilityEvent accessibilityEvent) {
return accessibilityEvent.getMovementGranularity();
}
static void setAction(AccessibilityEvent accessibilityEvent, int i) {
accessibilityEvent.setAction(i);
}
static int getAction(AccessibilityEvent accessibilityEvent) {
return accessibilityEvent.getAction();
}
}
}

View File

@ -0,0 +1,132 @@
package androidx.core.view.accessibility;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.view.accessibility.AccessibilityManager;
import java.util.List;
/* loaded from: classes.dex */
public final class AccessibilityManagerCompat {
@Deprecated
public interface AccessibilityStateChangeListener {
@Deprecated
void onAccessibilityStateChanged(boolean z);
}
@Deprecated
public static abstract class AccessibilityStateChangeListenerCompat implements AccessibilityStateChangeListener {
}
public interface TouchExplorationStateChangeListener {
void onTouchExplorationStateChanged(boolean z);
}
@Deprecated
public static boolean addAccessibilityStateChangeListener(AccessibilityManager accessibilityManager, AccessibilityStateChangeListener accessibilityStateChangeListener) {
if (accessibilityStateChangeListener == null) {
return false;
}
return accessibilityManager.addAccessibilityStateChangeListener(new AccessibilityStateChangeListenerWrapper(accessibilityStateChangeListener));
}
@Deprecated
public static boolean removeAccessibilityStateChangeListener(AccessibilityManager accessibilityManager, AccessibilityStateChangeListener accessibilityStateChangeListener) {
if (accessibilityStateChangeListener == null) {
return false;
}
return accessibilityManager.removeAccessibilityStateChangeListener(new AccessibilityStateChangeListenerWrapper(accessibilityStateChangeListener));
}
private static class AccessibilityStateChangeListenerWrapper implements AccessibilityManager.AccessibilityStateChangeListener {
AccessibilityStateChangeListener mListener;
AccessibilityStateChangeListenerWrapper(AccessibilityStateChangeListener accessibilityStateChangeListener) {
this.mListener = accessibilityStateChangeListener;
}
public int hashCode() {
return this.mListener.hashCode();
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof AccessibilityStateChangeListenerWrapper) {
return this.mListener.equals(((AccessibilityStateChangeListenerWrapper) obj).mListener);
}
return false;
}
@Override // android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener
public void onAccessibilityStateChanged(boolean z) {
this.mListener.onAccessibilityStateChanged(z);
}
}
@Deprecated
public static List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList(AccessibilityManager accessibilityManager) {
return accessibilityManager.getInstalledAccessibilityServiceList();
}
@Deprecated
public static List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList(AccessibilityManager accessibilityManager, int i) {
return accessibilityManager.getEnabledAccessibilityServiceList(i);
}
@Deprecated
public static boolean isTouchExplorationEnabled(AccessibilityManager accessibilityManager) {
return accessibilityManager.isTouchExplorationEnabled();
}
public static boolean addTouchExplorationStateChangeListener(AccessibilityManager accessibilityManager, TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
return Api19Impl.addTouchExplorationStateChangeListenerWrapper(accessibilityManager, touchExplorationStateChangeListener);
}
public static boolean removeTouchExplorationStateChangeListener(AccessibilityManager accessibilityManager, TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
return Api19Impl.removeTouchExplorationStateChangeListenerWrapper(accessibilityManager, touchExplorationStateChangeListener);
}
private static final class TouchExplorationStateChangeListenerWrapper implements AccessibilityManager.TouchExplorationStateChangeListener {
final TouchExplorationStateChangeListener mListener;
TouchExplorationStateChangeListenerWrapper(TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
this.mListener = touchExplorationStateChangeListener;
}
public int hashCode() {
return this.mListener.hashCode();
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof TouchExplorationStateChangeListenerWrapper) {
return this.mListener.equals(((TouchExplorationStateChangeListenerWrapper) obj).mListener);
}
return false;
}
@Override // android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener
public void onTouchExplorationStateChanged(boolean z) {
this.mListener.onTouchExplorationStateChanged(z);
}
}
private AccessibilityManagerCompat() {
}
static class Api19Impl {
private Api19Impl() {
}
static boolean addTouchExplorationStateChangeListenerWrapper(AccessibilityManager accessibilityManager, TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
return accessibilityManager.addTouchExplorationStateChangeListener(new TouchExplorationStateChangeListenerWrapper(touchExplorationStateChangeListener));
}
static boolean removeTouchExplorationStateChangeListenerWrapper(AccessibilityManager accessibilityManager, TouchExplorationStateChangeListener touchExplorationStateChangeListener) {
return accessibilityManager.removeTouchExplorationStateChangeListener(new TouchExplorationStateChangeListenerWrapper(touchExplorationStateChangeListener));
}
}
}

View File

@ -0,0 +1,111 @@
package androidx.core.view.accessibility;
import android.os.Build;
import android.os.Bundle;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeProvider;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes.dex */
public class AccessibilityNodeProviderCompat {
public static final int HOST_VIEW_ID = -1;
private final Object mProvider;
public void addExtraDataToAccessibilityNodeInfo(int i, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat, String str, Bundle bundle) {
}
public AccessibilityNodeInfoCompat createAccessibilityNodeInfo(int i) {
return null;
}
public List<AccessibilityNodeInfoCompat> findAccessibilityNodeInfosByText(String str, int i) {
return null;
}
public AccessibilityNodeInfoCompat findFocus(int i) {
return null;
}
public Object getProvider() {
return this.mProvider;
}
public boolean performAction(int i, int i2, Bundle bundle) {
return false;
}
static class AccessibilityNodeProviderApi16 extends AccessibilityNodeProvider {
final AccessibilityNodeProviderCompat mCompat;
AccessibilityNodeProviderApi16(AccessibilityNodeProviderCompat accessibilityNodeProviderCompat) {
this.mCompat = accessibilityNodeProviderCompat;
}
@Override // android.view.accessibility.AccessibilityNodeProvider
public AccessibilityNodeInfo createAccessibilityNodeInfo(int i) {
AccessibilityNodeInfoCompat createAccessibilityNodeInfo = this.mCompat.createAccessibilityNodeInfo(i);
if (createAccessibilityNodeInfo == null) {
return null;
}
return createAccessibilityNodeInfo.unwrap();
}
@Override // android.view.accessibility.AccessibilityNodeProvider
public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String str, int i) {
List<AccessibilityNodeInfoCompat> findAccessibilityNodeInfosByText = this.mCompat.findAccessibilityNodeInfosByText(str, i);
if (findAccessibilityNodeInfosByText == null) {
return null;
}
ArrayList arrayList = new ArrayList();
int size = findAccessibilityNodeInfosByText.size();
for (int i2 = 0; i2 < size; i2++) {
arrayList.add(findAccessibilityNodeInfosByText.get(i2).unwrap());
}
return arrayList;
}
@Override // android.view.accessibility.AccessibilityNodeProvider
public boolean performAction(int i, int i2, Bundle bundle) {
return this.mCompat.performAction(i, i2, bundle);
}
}
static class AccessibilityNodeProviderApi19 extends AccessibilityNodeProviderApi16 {
AccessibilityNodeProviderApi19(AccessibilityNodeProviderCompat accessibilityNodeProviderCompat) {
super(accessibilityNodeProviderCompat);
}
@Override // android.view.accessibility.AccessibilityNodeProvider
public AccessibilityNodeInfo findFocus(int i) {
AccessibilityNodeInfoCompat findFocus = this.mCompat.findFocus(i);
if (findFocus == null) {
return null;
}
return findFocus.unwrap();
}
}
static class AccessibilityNodeProviderApi26 extends AccessibilityNodeProviderApi19 {
AccessibilityNodeProviderApi26(AccessibilityNodeProviderCompat accessibilityNodeProviderCompat) {
super(accessibilityNodeProviderCompat);
}
@Override // android.view.accessibility.AccessibilityNodeProvider
public void addExtraDataToAccessibilityNodeInfo(int i, AccessibilityNodeInfo accessibilityNodeInfo, String str, Bundle bundle) {
this.mCompat.addExtraDataToAccessibilityNodeInfo(i, AccessibilityNodeInfoCompat.wrap(accessibilityNodeInfo), str, bundle);
}
}
public AccessibilityNodeProviderCompat() {
if (Build.VERSION.SDK_INT >= 26) {
this.mProvider = new AccessibilityNodeProviderApi26(this);
} else {
this.mProvider = new AccessibilityNodeProviderApi19(this);
}
}
public AccessibilityNodeProviderCompat(Object obj) {
this.mProvider = obj;
}
}

View File

@ -0,0 +1,326 @@
package androidx.core.view.accessibility;
import android.os.Parcelable;
import android.view.View;
import android.view.accessibility.AccessibilityRecord;
import java.util.List;
/* loaded from: classes.dex */
public class AccessibilityRecordCompat {
private final AccessibilityRecord mRecord;
@Deprecated
public Object getImpl() {
return this.mRecord;
}
@Deprecated
public AccessibilityRecordCompat(Object obj) {
this.mRecord = (AccessibilityRecord) obj;
}
@Deprecated
public static AccessibilityRecordCompat obtain(AccessibilityRecordCompat accessibilityRecordCompat) {
return new AccessibilityRecordCompat(AccessibilityRecord.obtain(accessibilityRecordCompat.mRecord));
}
@Deprecated
public static AccessibilityRecordCompat obtain() {
return new AccessibilityRecordCompat(AccessibilityRecord.obtain());
}
@Deprecated
public void setSource(View view) {
this.mRecord.setSource(view);
}
@Deprecated
public void setSource(View view, int i) {
setSource(this.mRecord, view, i);
}
public static void setSource(AccessibilityRecord accessibilityRecord, View view, int i) {
Api16Impl.setSource(accessibilityRecord, view, i);
}
@Deprecated
public AccessibilityNodeInfoCompat getSource() {
return AccessibilityNodeInfoCompat.wrapNonNullInstance(this.mRecord.getSource());
}
@Deprecated
public int getWindowId() {
return this.mRecord.getWindowId();
}
@Deprecated
public boolean isChecked() {
return this.mRecord.isChecked();
}
@Deprecated
public void setChecked(boolean z) {
this.mRecord.setChecked(z);
}
@Deprecated
public boolean isEnabled() {
return this.mRecord.isEnabled();
}
@Deprecated
public void setEnabled(boolean z) {
this.mRecord.setEnabled(z);
}
@Deprecated
public boolean isPassword() {
return this.mRecord.isPassword();
}
@Deprecated
public void setPassword(boolean z) {
this.mRecord.setPassword(z);
}
@Deprecated
public boolean isFullScreen() {
return this.mRecord.isFullScreen();
}
@Deprecated
public void setFullScreen(boolean z) {
this.mRecord.setFullScreen(z);
}
@Deprecated
public boolean isScrollable() {
return this.mRecord.isScrollable();
}
@Deprecated
public void setScrollable(boolean z) {
this.mRecord.setScrollable(z);
}
@Deprecated
public int getItemCount() {
return this.mRecord.getItemCount();
}
@Deprecated
public void setItemCount(int i) {
this.mRecord.setItemCount(i);
}
@Deprecated
public int getCurrentItemIndex() {
return this.mRecord.getCurrentItemIndex();
}
@Deprecated
public void setCurrentItemIndex(int i) {
this.mRecord.setCurrentItemIndex(i);
}
@Deprecated
public int getFromIndex() {
return this.mRecord.getFromIndex();
}
@Deprecated
public void setFromIndex(int i) {
this.mRecord.setFromIndex(i);
}
@Deprecated
public int getToIndex() {
return this.mRecord.getToIndex();
}
@Deprecated
public void setToIndex(int i) {
this.mRecord.setToIndex(i);
}
@Deprecated
public int getScrollX() {
return this.mRecord.getScrollX();
}
@Deprecated
public void setScrollX(int i) {
this.mRecord.setScrollX(i);
}
@Deprecated
public int getScrollY() {
return this.mRecord.getScrollY();
}
@Deprecated
public void setScrollY(int i) {
this.mRecord.setScrollY(i);
}
@Deprecated
public int getMaxScrollX() {
return getMaxScrollX(this.mRecord);
}
public static int getMaxScrollX(AccessibilityRecord accessibilityRecord) {
return Api15Impl.getMaxScrollX(accessibilityRecord);
}
@Deprecated
public void setMaxScrollX(int i) {
setMaxScrollX(this.mRecord, i);
}
public static void setMaxScrollX(AccessibilityRecord accessibilityRecord, int i) {
Api15Impl.setMaxScrollX(accessibilityRecord, i);
}
@Deprecated
public int getMaxScrollY() {
return getMaxScrollY(this.mRecord);
}
public static int getMaxScrollY(AccessibilityRecord accessibilityRecord) {
return Api15Impl.getMaxScrollY(accessibilityRecord);
}
@Deprecated
public void setMaxScrollY(int i) {
setMaxScrollY(this.mRecord, i);
}
public static void setMaxScrollY(AccessibilityRecord accessibilityRecord, int i) {
Api15Impl.setMaxScrollY(accessibilityRecord, i);
}
@Deprecated
public int getAddedCount() {
return this.mRecord.getAddedCount();
}
@Deprecated
public void setAddedCount(int i) {
this.mRecord.setAddedCount(i);
}
@Deprecated
public int getRemovedCount() {
return this.mRecord.getRemovedCount();
}
@Deprecated
public void setRemovedCount(int i) {
this.mRecord.setRemovedCount(i);
}
@Deprecated
public CharSequence getClassName() {
return this.mRecord.getClassName();
}
@Deprecated
public void setClassName(CharSequence charSequence) {
this.mRecord.setClassName(charSequence);
}
@Deprecated
public List<CharSequence> getText() {
return this.mRecord.getText();
}
@Deprecated
public CharSequence getBeforeText() {
return this.mRecord.getBeforeText();
}
@Deprecated
public void setBeforeText(CharSequence charSequence) {
this.mRecord.setBeforeText(charSequence);
}
@Deprecated
public CharSequence getContentDescription() {
return this.mRecord.getContentDescription();
}
@Deprecated
public void setContentDescription(CharSequence charSequence) {
this.mRecord.setContentDescription(charSequence);
}
@Deprecated
public Parcelable getParcelableData() {
return this.mRecord.getParcelableData();
}
@Deprecated
public void setParcelableData(Parcelable parcelable) {
this.mRecord.setParcelableData(parcelable);
}
@Deprecated
public void recycle() {
this.mRecord.recycle();
}
@Deprecated
public int hashCode() {
AccessibilityRecord accessibilityRecord = this.mRecord;
if (accessibilityRecord == null) {
return 0;
}
return accessibilityRecord.hashCode();
}
@Deprecated
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AccessibilityRecordCompat)) {
return false;
}
AccessibilityRecordCompat accessibilityRecordCompat = (AccessibilityRecordCompat) obj;
AccessibilityRecord accessibilityRecord = this.mRecord;
if (accessibilityRecord == null) {
return accessibilityRecordCompat.mRecord == null;
}
return accessibilityRecord.equals(accessibilityRecordCompat.mRecord);
}
static class Api16Impl {
private Api16Impl() {
}
static void setSource(AccessibilityRecord accessibilityRecord, View view, int i) {
accessibilityRecord.setSource(view, i);
}
}
static class Api15Impl {
private Api15Impl() {
}
static int getMaxScrollX(AccessibilityRecord accessibilityRecord) {
return accessibilityRecord.getMaxScrollX();
}
static void setMaxScrollX(AccessibilityRecord accessibilityRecord, int i) {
accessibilityRecord.setMaxScrollX(i);
}
static int getMaxScrollY(AccessibilityRecord accessibilityRecord) {
return accessibilityRecord.getMaxScrollY();
}
static void setMaxScrollY(AccessibilityRecord accessibilityRecord, int i) {
accessibilityRecord.setMaxScrollY(i);
}
}
}

View File

@ -0,0 +1,76 @@
package androidx.core.view.accessibility;
import android.os.Bundle;
import android.view.View;
/* loaded from: classes.dex */
public interface AccessibilityViewCommand {
public static abstract class CommandArguments {
Bundle mBundle;
public void setBundle(Bundle bundle) {
this.mBundle = bundle;
}
}
boolean perform(View view, CommandArguments commandArguments);
public static final class MoveAtGranularityArguments extends CommandArguments {
public int getGranularity() {
return this.mBundle.getInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT);
}
public boolean getExtendSelection() {
return this.mBundle.getBoolean(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN);
}
}
public static final class MoveHtmlArguments extends CommandArguments {
public String getHTMLElement() {
return this.mBundle.getString(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_HTML_ELEMENT_STRING);
}
}
public static final class SetSelectionArguments extends CommandArguments {
public int getStart() {
return this.mBundle.getInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_START_INT);
}
public int getEnd() {
return this.mBundle.getInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_END_INT);
}
}
public static final class SetTextArguments extends CommandArguments {
public CharSequence getText() {
return this.mBundle.getCharSequence(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE);
}
}
public static final class ScrollToPositionArguments extends CommandArguments {
public int getRow() {
return this.mBundle.getInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_ROW_INT);
}
public int getColumn() {
return this.mBundle.getInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_COLUMN_INT);
}
}
public static final class SetProgressArguments extends CommandArguments {
public float getProgress() {
return this.mBundle.getFloat(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_PROGRESS_VALUE);
}
}
public static final class MoveWindowArguments extends CommandArguments {
public int getX() {
return this.mBundle.getInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVE_WINDOW_X);
}
public int getY() {
return this.mBundle.getInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVE_WINDOW_Y);
}
}
}

View File

@ -0,0 +1,271 @@
package androidx.core.view.accessibility;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.Build;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityWindowInfo;
/* loaded from: classes.dex */
public class AccessibilityWindowInfoCompat {
public static final int TYPE_ACCESSIBILITY_OVERLAY = 4;
public static final int TYPE_APPLICATION = 1;
public static final int TYPE_INPUT_METHOD = 2;
public static final int TYPE_SPLIT_SCREEN_DIVIDER = 5;
public static final int TYPE_SYSTEM = 3;
private static final int UNDEFINED = -1;
private final Object mInfo;
private static String typeToString(int i) {
return i != 1 ? i != 2 ? i != 3 ? i != 4 ? "<UNKNOWN>" : "TYPE_ACCESSIBILITY_OVERLAY" : "TYPE_SYSTEM" : "TYPE_INPUT_METHOD" : "TYPE_APPLICATION";
}
static AccessibilityWindowInfoCompat wrapNonNullInstance(Object obj) {
if (obj != null) {
return new AccessibilityWindowInfoCompat(obj);
}
return null;
}
private AccessibilityWindowInfoCompat(Object obj) {
this.mInfo = obj;
}
public int getType() {
return Api21Impl.getType((AccessibilityWindowInfo) this.mInfo);
}
public int getLayer() {
return Api21Impl.getLayer((AccessibilityWindowInfo) this.mInfo);
}
public AccessibilityNodeInfoCompat getRoot() {
return AccessibilityNodeInfoCompat.wrapNonNullInstance(Api21Impl.getRoot((AccessibilityWindowInfo) this.mInfo));
}
public boolean isInPictureInPictureMode() {
if (Build.VERSION.SDK_INT >= 33) {
return Api33Impl.isInPictureInPictureMode((AccessibilityWindowInfo) this.mInfo);
}
return false;
}
public AccessibilityWindowInfoCompat getParent() {
return wrapNonNullInstance(Api21Impl.getParent((AccessibilityWindowInfo) this.mInfo));
}
public int getId() {
return Api21Impl.getId((AccessibilityWindowInfo) this.mInfo);
}
public void getRegionInScreen(Region region) {
if (Build.VERSION.SDK_INT >= 33) {
Api33Impl.getRegionInScreen((AccessibilityWindowInfo) this.mInfo, region);
return;
}
Rect rect = new Rect();
Api21Impl.getBoundsInScreen((AccessibilityWindowInfo) this.mInfo, rect);
region.set(rect);
}
public void getBoundsInScreen(Rect rect) {
Api21Impl.getBoundsInScreen((AccessibilityWindowInfo) this.mInfo, rect);
}
public boolean isActive() {
return Api21Impl.isActive((AccessibilityWindowInfo) this.mInfo);
}
public boolean isFocused() {
return Api21Impl.isFocused((AccessibilityWindowInfo) this.mInfo);
}
public boolean isAccessibilityFocused() {
return Api21Impl.isAccessibilityFocused((AccessibilityWindowInfo) this.mInfo);
}
public int getChildCount() {
return Api21Impl.getChildCount((AccessibilityWindowInfo) this.mInfo);
}
public AccessibilityWindowInfoCompat getChild(int i) {
return wrapNonNullInstance(Api21Impl.getChild((AccessibilityWindowInfo) this.mInfo, i));
}
public int getDisplayId() {
if (Build.VERSION.SDK_INT >= 33) {
return Api33Impl.getDisplayId((AccessibilityWindowInfo) this.mInfo);
}
return 0;
}
public CharSequence getTitle() {
if (Build.VERSION.SDK_INT >= 24) {
return Api24Impl.getTitle((AccessibilityWindowInfo) this.mInfo);
}
return null;
}
public AccessibilityNodeInfoCompat getAnchor() {
if (Build.VERSION.SDK_INT >= 24) {
return AccessibilityNodeInfoCompat.wrapNonNullInstance(Api24Impl.getAnchor((AccessibilityWindowInfo) this.mInfo));
}
return null;
}
public static AccessibilityWindowInfoCompat obtain() {
return wrapNonNullInstance(Api21Impl.obtain());
}
public static AccessibilityWindowInfoCompat obtain(AccessibilityWindowInfoCompat accessibilityWindowInfoCompat) {
if (accessibilityWindowInfoCompat == null) {
return null;
}
return wrapNonNullInstance(Api21Impl.obtain((AccessibilityWindowInfo) accessibilityWindowInfoCompat.mInfo));
}
public void recycle() {
Api21Impl.recycle((AccessibilityWindowInfo) this.mInfo);
}
public AccessibilityWindowInfo unwrap() {
return (AccessibilityWindowInfo) this.mInfo;
}
public int hashCode() {
Object obj = this.mInfo;
if (obj == null) {
return 0;
}
return obj.hashCode();
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !(obj instanceof AccessibilityWindowInfoCompat)) {
return false;
}
AccessibilityWindowInfoCompat accessibilityWindowInfoCompat = (AccessibilityWindowInfoCompat) obj;
Object obj2 = this.mInfo;
if (obj2 == null) {
return accessibilityWindowInfoCompat.mInfo == null;
}
return obj2.equals(accessibilityWindowInfoCompat.mInfo);
}
public String toString() {
StringBuilder sb = new StringBuilder("AccessibilityWindowInfo[id=");
Rect rect = new Rect();
getBoundsInScreen(rect);
sb.append(getId());
sb.append(", type=");
sb.append(typeToString(getType()));
sb.append(", layer=");
sb.append(getLayer());
sb.append(", bounds=");
sb.append(rect);
sb.append(", focused=");
sb.append(isFocused());
sb.append(", active=");
sb.append(isActive());
sb.append(", hasParent=");
sb.append(getParent() != null);
sb.append(", hasChildren=");
sb.append(getChildCount() > 0);
sb.append(']');
return sb.toString();
}
private static class Api21Impl {
private Api21Impl() {
}
static void getBoundsInScreen(AccessibilityWindowInfo accessibilityWindowInfo, Rect rect) {
accessibilityWindowInfo.getBoundsInScreen(rect);
}
static AccessibilityWindowInfo getChild(AccessibilityWindowInfo accessibilityWindowInfo, int i) {
return accessibilityWindowInfo.getChild(i);
}
static int getChildCount(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getChildCount();
}
static int getId(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getId();
}
static int getLayer(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getLayer();
}
static AccessibilityWindowInfo getParent(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getParent();
}
static AccessibilityNodeInfo getRoot(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getRoot();
}
static int getType(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getType();
}
static boolean isAccessibilityFocused(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.isAccessibilityFocused();
}
static boolean isActive(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.isActive();
}
static boolean isFocused(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.isFocused();
}
static AccessibilityWindowInfo obtain() {
return AccessibilityWindowInfo.obtain();
}
static AccessibilityWindowInfo obtain(AccessibilityWindowInfo accessibilityWindowInfo) {
return AccessibilityWindowInfo.obtain(accessibilityWindowInfo);
}
static void recycle(AccessibilityWindowInfo accessibilityWindowInfo) {
accessibilityWindowInfo.recycle();
}
}
private static class Api24Impl {
private Api24Impl() {
}
static AccessibilityNodeInfo getAnchor(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getAnchor();
}
static CharSequence getTitle(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getTitle();
}
}
private static class Api33Impl {
private Api33Impl() {
}
static int getDisplayId(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.getDisplayId();
}
static void getRegionInScreen(AccessibilityWindowInfo accessibilityWindowInfo, Region region) {
accessibilityWindowInfo.getRegionInScreen(region);
}
static boolean isInPictureInPictureMode(AccessibilityWindowInfo accessibilityWindowInfo) {
return accessibilityWindowInfo.isInPictureInPictureMode();
}
}
}

View File

@ -0,0 +1,80 @@
package androidx.core.view.animation;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.view.animation.Interpolator;
/* loaded from: classes.dex */
class PathInterpolatorApi14 implements Interpolator {
private static final float PRECISION = 0.002f;
private final float[] mX;
private final float[] mY;
PathInterpolatorApi14(Path path) {
PathMeasure pathMeasure = new PathMeasure(path, false);
float length = pathMeasure.getLength();
int i = (int) (length / 0.002f);
int i2 = i + 1;
this.mX = new float[i2];
this.mY = new float[i2];
float[] fArr = new float[2];
for (int i3 = 0; i3 < i2; i3++) {
pathMeasure.getPosTan((i3 * length) / i, fArr, null);
this.mX[i3] = fArr[0];
this.mY[i3] = fArr[1];
}
}
PathInterpolatorApi14(float f, float f2) {
this(createQuad(f, f2));
}
PathInterpolatorApi14(float f, float f2, float f3, float f4) {
this(createCubic(f, f2, f3, f4));
}
@Override // android.animation.TimeInterpolator
public float getInterpolation(float f) {
if (f <= 0.0f) {
return 0.0f;
}
if (f >= 1.0f) {
return 1.0f;
}
int length = this.mX.length - 1;
int i = 0;
while (length - i > 1) {
int i2 = (i + length) / 2;
if (f < this.mX[i2]) {
length = i2;
} else {
i = i2;
}
}
float[] fArr = this.mX;
float f2 = fArr[length];
float f3 = fArr[i];
float f4 = f2 - f3;
if (f4 == 0.0f) {
return this.mY[i];
}
float f5 = (f - f3) / f4;
float[] fArr2 = this.mY;
float f6 = fArr2[i];
return f6 + (f5 * (fArr2[length] - f6));
}
private static Path createQuad(float f, float f2) {
Path path = new Path();
path.moveTo(0.0f, 0.0f);
path.quadTo(f, f2, 1.0f, 1.0f);
return path;
}
private static Path createCubic(float f, float f2, float f3, float f4) {
Path path = new Path();
path.moveTo(0.0f, 0.0f);
path.cubicTo(f, f2, f3, f4, 1.0f, 1.0f);
return path;
}
}

View File

@ -0,0 +1,40 @@
package androidx.core.view.animation;
import android.graphics.Path;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
/* loaded from: classes.dex */
public final class PathInterpolatorCompat {
private PathInterpolatorCompat() {
}
public static Interpolator create(Path path) {
return Api21Impl.createPathInterpolator(path);
}
public static Interpolator create(float f, float f2) {
return Api21Impl.createPathInterpolator(f, f2);
}
public static Interpolator create(float f, float f2, float f3, float f4) {
return Api21Impl.createPathInterpolator(f, f2, f3, f4);
}
static class Api21Impl {
private Api21Impl() {
}
static PathInterpolator createPathInterpolator(Path path) {
return new PathInterpolator(path);
}
static PathInterpolator createPathInterpolator(float f, float f2) {
return new PathInterpolator(f, f2);
}
static PathInterpolator createPathInterpolator(float f, float f2, float f3, float f4) {
return new PathInterpolator(f, f2, f3, f4);
}
}
}

View File

@ -0,0 +1,237 @@
package androidx.core.view.inputmethod;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.view.inputmethod.EditorInfo;
import androidx.core.util.Preconditions;
/* loaded from: classes.dex */
public final class EditorInfoCompat {
private static final String CONTENT_MIME_TYPES_INTEROP_KEY = "android.support.v13.view.inputmethod.EditorInfoCompat.CONTENT_MIME_TYPES";
private static final String CONTENT_MIME_TYPES_KEY = "androidx.core.view.inputmethod.EditorInfoCompat.CONTENT_MIME_TYPES";
private static final String CONTENT_SELECTION_END_KEY = "androidx.core.view.inputmethod.EditorInfoCompat.CONTENT_SELECTION_END";
private static final String CONTENT_SELECTION_HEAD_KEY = "androidx.core.view.inputmethod.EditorInfoCompat.CONTENT_SELECTION_HEAD";
private static final String CONTENT_SURROUNDING_TEXT_KEY = "androidx.core.view.inputmethod.EditorInfoCompat.CONTENT_SURROUNDING_TEXT";
private static final String[] EMPTY_STRING_ARRAY = new String[0];
public static final int IME_FLAG_FORCE_ASCII = Integer.MIN_VALUE;
public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 16777216;
static final int MAX_INITIAL_SELECTION_LENGTH = 1024;
static final int MEMORY_EFFICIENT_TEXT_LENGTH = 2048;
private static boolean isPasswordInputType(int i) {
int i2 = i & 4095;
return i2 == 129 || i2 == 225 || i2 == 18;
}
public static void setContentMimeTypes(EditorInfo editorInfo, String[] strArr) {
if (Build.VERSION.SDK_INT >= 25) {
editorInfo.contentMimeTypes = strArr;
return;
}
if (editorInfo.extras == null) {
editorInfo.extras = new Bundle();
}
editorInfo.extras.putStringArray(CONTENT_MIME_TYPES_KEY, strArr);
editorInfo.extras.putStringArray(CONTENT_MIME_TYPES_INTEROP_KEY, strArr);
}
public static String[] getContentMimeTypes(EditorInfo editorInfo) {
String[] strArr;
if (Build.VERSION.SDK_INT >= 25) {
strArr = editorInfo.contentMimeTypes;
return strArr != null ? strArr : EMPTY_STRING_ARRAY;
}
if (editorInfo.extras == null) {
return EMPTY_STRING_ARRAY;
}
String[] stringArray = editorInfo.extras.getStringArray(CONTENT_MIME_TYPES_KEY);
if (stringArray == null) {
stringArray = editorInfo.extras.getStringArray(CONTENT_MIME_TYPES_INTEROP_KEY);
}
return stringArray != null ? stringArray : EMPTY_STRING_ARRAY;
}
public static void setInitialSurroundingText(EditorInfo editorInfo, CharSequence charSequence) {
if (Build.VERSION.SDK_INT >= 30) {
Api30Impl.setInitialSurroundingSubText(editorInfo, charSequence, 0);
} else {
setInitialSurroundingSubText(editorInfo, charSequence, 0);
}
}
public static void setInitialSurroundingSubText(EditorInfo editorInfo, CharSequence charSequence, int i) {
int i2;
int i3;
Preconditions.checkNotNull(charSequence);
if (Build.VERSION.SDK_INT >= 30) {
Api30Impl.setInitialSurroundingSubText(editorInfo, charSequence, i);
return;
}
if (editorInfo.initialSelStart > editorInfo.initialSelEnd) {
i2 = editorInfo.initialSelEnd;
} else {
i2 = editorInfo.initialSelStart;
}
int i4 = i2 - i;
if (editorInfo.initialSelStart > editorInfo.initialSelEnd) {
i3 = editorInfo.initialSelStart;
} else {
i3 = editorInfo.initialSelEnd;
}
int i5 = i3 - i;
int length = charSequence.length();
if (i < 0 || i4 < 0 || i5 > length) {
setSurroundingText(editorInfo, null, 0, 0);
return;
}
if (isPasswordInputType(editorInfo.inputType)) {
setSurroundingText(editorInfo, null, 0, 0);
} else if (length <= 2048) {
setSurroundingText(editorInfo, charSequence, i4, i5);
} else {
trimLongSurroundingText(editorInfo, charSequence, i4, i5);
}
}
private static void trimLongSurroundingText(EditorInfo editorInfo, CharSequence charSequence, int i, int i2) {
CharSequence subSequence;
int i3 = i2 - i;
int i4 = i3 > 1024 ? 0 : i3;
int i5 = 2048 - i4;
int min = Math.min(charSequence.length() - i2, i5 - Math.min(i, (int) (i5 * 0.8d)));
int min2 = Math.min(i, i5 - min);
int i6 = i - min2;
if (isCutOnSurrogate(charSequence, i6, 0)) {
i6++;
min2--;
}
if (isCutOnSurrogate(charSequence, (i2 + min) - 1, 1)) {
min--;
}
int i7 = min2 + i4 + min;
if (i4 != i3) {
subSequence = TextUtils.concat(charSequence.subSequence(i6, i6 + min2), charSequence.subSequence(i2, min + i2));
} else {
subSequence = charSequence.subSequence(i6, i7 + i6);
}
setSurroundingText(editorInfo, subSequence, min2, i4 + min2);
}
public static CharSequence getInitialTextBeforeCursor(EditorInfo editorInfo, int i, int i2) {
CharSequence charSequence;
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.getInitialTextBeforeCursor(editorInfo, i, i2);
}
if (editorInfo.extras == null || (charSequence = editorInfo.extras.getCharSequence(CONTENT_SURROUNDING_TEXT_KEY)) == null) {
return null;
}
int i3 = editorInfo.extras.getInt(CONTENT_SELECTION_HEAD_KEY);
int min = Math.min(i, i3);
if ((i2 & 1) != 0) {
return charSequence.subSequence(i3 - min, i3);
}
return TextUtils.substring(charSequence, i3 - min, i3);
}
public static CharSequence getInitialSelectedText(EditorInfo editorInfo, int i) {
CharSequence charSequence;
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.getInitialSelectedText(editorInfo, i);
}
if (editorInfo.extras == null) {
return null;
}
int min = Math.min(editorInfo.initialSelStart, editorInfo.initialSelEnd);
int max = Math.max(editorInfo.initialSelStart, editorInfo.initialSelEnd);
int i2 = editorInfo.extras.getInt(CONTENT_SELECTION_HEAD_KEY);
int i3 = editorInfo.extras.getInt(CONTENT_SELECTION_END_KEY);
int i4 = max - min;
if (editorInfo.initialSelStart < 0 || editorInfo.initialSelEnd < 0 || i3 - i2 != i4 || (charSequence = editorInfo.extras.getCharSequence(CONTENT_SURROUNDING_TEXT_KEY)) == null) {
return null;
}
if ((i & 1) != 0) {
return charSequence.subSequence(i2, i3);
}
return TextUtils.substring(charSequence, i2, i3);
}
public static CharSequence getInitialTextAfterCursor(EditorInfo editorInfo, int i, int i2) {
CharSequence charSequence;
if (Build.VERSION.SDK_INT >= 30) {
return Api30Impl.getInitialTextAfterCursor(editorInfo, i, i2);
}
if (editorInfo.extras == null || (charSequence = editorInfo.extras.getCharSequence(CONTENT_SURROUNDING_TEXT_KEY)) == null) {
return null;
}
int i3 = editorInfo.extras.getInt(CONTENT_SELECTION_END_KEY);
int min = Math.min(i, charSequence.length() - i3);
if ((i2 & 1) != 0) {
return charSequence.subSequence(i3, min + i3);
}
return TextUtils.substring(charSequence, i3, min + i3);
}
private static boolean isCutOnSurrogate(CharSequence charSequence, int i, int i2) {
if (i2 == 0) {
return Character.isLowSurrogate(charSequence.charAt(i));
}
if (i2 != 1) {
return false;
}
return Character.isHighSurrogate(charSequence.charAt(i));
}
private static void setSurroundingText(EditorInfo editorInfo, CharSequence charSequence, int i, int i2) {
if (editorInfo.extras == null) {
editorInfo.extras = new Bundle();
}
editorInfo.extras.putCharSequence(CONTENT_SURROUNDING_TEXT_KEY, charSequence != null ? new SpannableStringBuilder(charSequence) : null);
editorInfo.extras.putInt(CONTENT_SELECTION_HEAD_KEY, i);
editorInfo.extras.putInt(CONTENT_SELECTION_END_KEY, i2);
}
static int getProtocol(EditorInfo editorInfo) {
if (Build.VERSION.SDK_INT >= 25) {
return 1;
}
if (editorInfo.extras == null) {
return 0;
}
boolean containsKey = editorInfo.extras.containsKey(CONTENT_MIME_TYPES_KEY);
boolean containsKey2 = editorInfo.extras.containsKey(CONTENT_MIME_TYPES_INTEROP_KEY);
if (containsKey && containsKey2) {
return 4;
}
if (containsKey) {
return 3;
}
return containsKey2 ? 2 : 0;
}
@Deprecated
public EditorInfoCompat() {
}
private static class Api30Impl {
private Api30Impl() {
}
static void setInitialSurroundingSubText(EditorInfo editorInfo, CharSequence charSequence, int i) {
editorInfo.setInitialSurroundingSubText(charSequence, i);
}
static CharSequence getInitialTextBeforeCursor(EditorInfo editorInfo, int i, int i2) {
return editorInfo.getInitialTextBeforeCursor(i, i2);
}
static CharSequence getInitialSelectedText(EditorInfo editorInfo, int i) {
return editorInfo.getInitialSelectedText(i);
}
static CharSequence getInitialTextAfterCursor(EditorInfo editorInfo, int i, int i2) {
return editorInfo.getInitialTextAfterCursor(i, i2);
}
}
}

View File

@ -0,0 +1,187 @@
package androidx.core.view.inputmethod;
import android.content.ClipData;
import android.content.ClipDescription;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.ResultReceiver;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputConnectionWrapper;
import android.view.inputmethod.InputContentInfo;
import androidx.core.util.ObjectsCompat;
import androidx.core.util.Preconditions;
import androidx.core.view.ContentInfoCompat;
import androidx.core.view.ViewCompat;
import androidx.tracing.Trace$$ExternalSyntheticApiModelOutline0;
/* loaded from: classes.dex */
public final class InputConnectionCompat {
private static final String COMMIT_CONTENT_ACTION = "androidx.core.view.inputmethod.InputConnectionCompat.COMMIT_CONTENT";
private static final String COMMIT_CONTENT_CONTENT_URI_INTEROP_KEY = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_URI";
private static final String COMMIT_CONTENT_CONTENT_URI_KEY = "androidx.core.view.inputmethod.InputConnectionCompat.CONTENT_URI";
private static final String COMMIT_CONTENT_DESCRIPTION_INTEROP_KEY = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_DESCRIPTION";
private static final String COMMIT_CONTENT_DESCRIPTION_KEY = "androidx.core.view.inputmethod.InputConnectionCompat.CONTENT_DESCRIPTION";
private static final String COMMIT_CONTENT_FLAGS_INTEROP_KEY = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_FLAGS";
private static final String COMMIT_CONTENT_FLAGS_KEY = "androidx.core.view.inputmethod.InputConnectionCompat.CONTENT_FLAGS";
private static final String COMMIT_CONTENT_INTEROP_ACTION = "android.support.v13.view.inputmethod.InputConnectionCompat.COMMIT_CONTENT";
private static final String COMMIT_CONTENT_LINK_URI_INTEROP_KEY = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_LINK_URI";
private static final String COMMIT_CONTENT_LINK_URI_KEY = "androidx.core.view.inputmethod.InputConnectionCompat.CONTENT_LINK_URI";
private static final String COMMIT_CONTENT_OPTS_INTEROP_KEY = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_OPTS";
private static final String COMMIT_CONTENT_OPTS_KEY = "androidx.core.view.inputmethod.InputConnectionCompat.CONTENT_OPTS";
private static final String COMMIT_CONTENT_RESULT_INTEROP_RECEIVER_KEY = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_RESULT_RECEIVER";
private static final String COMMIT_CONTENT_RESULT_RECEIVER_KEY = "androidx.core.view.inputmethod.InputConnectionCompat.CONTENT_RESULT_RECEIVER";
private static final String EXTRA_INPUT_CONTENT_INFO = "androidx.core.view.extra.INPUT_CONTENT_INFO";
public static final int INPUT_CONTENT_GRANT_READ_URI_PERMISSION = 1;
private static final String LOG_TAG = "InputConnectionCompat";
public interface OnCommitContentListener {
boolean onCommitContent(InputContentInfoCompat inputContentInfoCompat, int i, Bundle bundle);
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r0v0 */
/* JADX WARN: Type inference failed for: r0v3, types: [boolean, int] */
/* JADX WARN: Type inference failed for: r0v5 */
/* JADX WARN: Type inference failed for: r0v6 */
static boolean handlePerformPrivateCommand(String str, Bundle bundle, OnCommitContentListener onCommitContentListener) {
boolean z;
ResultReceiver resultReceiver;
?? r0 = 0;
r0 = 0;
if (bundle == null) {
return false;
}
if (TextUtils.equals(COMMIT_CONTENT_ACTION, str)) {
z = false;
} else {
if (!TextUtils.equals(COMMIT_CONTENT_INTEROP_ACTION, str)) {
return false;
}
z = true;
}
try {
resultReceiver = (ResultReceiver) bundle.getParcelable(z ? COMMIT_CONTENT_RESULT_INTEROP_RECEIVER_KEY : COMMIT_CONTENT_RESULT_RECEIVER_KEY);
try {
Uri uri = (Uri) bundle.getParcelable(z ? COMMIT_CONTENT_CONTENT_URI_INTEROP_KEY : COMMIT_CONTENT_CONTENT_URI_KEY);
ClipDescription clipDescription = (ClipDescription) bundle.getParcelable(z ? COMMIT_CONTENT_DESCRIPTION_INTEROP_KEY : COMMIT_CONTENT_DESCRIPTION_KEY);
Uri uri2 = (Uri) bundle.getParcelable(z ? COMMIT_CONTENT_LINK_URI_INTEROP_KEY : COMMIT_CONTENT_LINK_URI_KEY);
int i = bundle.getInt(z ? COMMIT_CONTENT_FLAGS_INTEROP_KEY : COMMIT_CONTENT_FLAGS_KEY);
Bundle bundle2 = (Bundle) bundle.getParcelable(z ? COMMIT_CONTENT_OPTS_INTEROP_KEY : COMMIT_CONTENT_OPTS_KEY);
if (uri != null && clipDescription != null) {
r0 = onCommitContentListener.onCommitContent(new InputContentInfoCompat(uri, clipDescription, uri2), i, bundle2);
}
if (resultReceiver != 0) {
resultReceiver.send(r0, null);
}
return r0;
} catch (Throwable th) {
th = th;
if (resultReceiver != 0) {
resultReceiver.send(0, null);
}
throw th;
}
} catch (Throwable th2) {
th = th2;
resultReceiver = 0;
}
}
public static boolean commitContent(InputConnection inputConnection, EditorInfo editorInfo, InputContentInfoCompat inputContentInfoCompat, int i, Bundle bundle) {
boolean z;
if (Build.VERSION.SDK_INT >= 25) {
return Api25Impl.commitContent(inputConnection, Trace$$ExternalSyntheticApiModelOutline0.m(inputContentInfoCompat.unwrap()), i, bundle);
}
int protocol = EditorInfoCompat.getProtocol(editorInfo);
if (protocol != 2) {
z = false;
if (protocol != 3 && protocol != 4) {
return false;
}
} else {
z = true;
}
Bundle bundle2 = new Bundle();
bundle2.putParcelable(z ? COMMIT_CONTENT_CONTENT_URI_INTEROP_KEY : COMMIT_CONTENT_CONTENT_URI_KEY, inputContentInfoCompat.getContentUri());
bundle2.putParcelable(z ? COMMIT_CONTENT_DESCRIPTION_INTEROP_KEY : COMMIT_CONTENT_DESCRIPTION_KEY, inputContentInfoCompat.getDescription());
bundle2.putParcelable(z ? COMMIT_CONTENT_LINK_URI_INTEROP_KEY : COMMIT_CONTENT_LINK_URI_KEY, inputContentInfoCompat.getLinkUri());
bundle2.putInt(z ? COMMIT_CONTENT_FLAGS_INTEROP_KEY : COMMIT_CONTENT_FLAGS_KEY, i);
bundle2.putParcelable(z ? COMMIT_CONTENT_OPTS_INTEROP_KEY : COMMIT_CONTENT_OPTS_KEY, bundle);
return inputConnection.performPrivateCommand(z ? COMMIT_CONTENT_INTEROP_ACTION : COMMIT_CONTENT_ACTION, bundle2);
}
@Deprecated
public static InputConnection createWrapper(InputConnection inputConnection, EditorInfo editorInfo, final OnCommitContentListener onCommitContentListener) {
ObjectsCompat.requireNonNull(inputConnection, "inputConnection must be non-null");
ObjectsCompat.requireNonNull(editorInfo, "editorInfo must be non-null");
ObjectsCompat.requireNonNull(onCommitContentListener, "onCommitContentListener must be non-null");
boolean z = false;
if (Build.VERSION.SDK_INT >= 25) {
return new InputConnectionWrapper(inputConnection, z) { // from class: androidx.core.view.inputmethod.InputConnectionCompat.1
@Override // android.view.inputmethod.InputConnectionWrapper, android.view.inputmethod.InputConnection
public boolean commitContent(InputContentInfo inputContentInfo, int i, Bundle bundle) {
if (onCommitContentListener.onCommitContent(InputContentInfoCompat.wrap(inputContentInfo), i, bundle)) {
return true;
}
return super.commitContent(inputContentInfo, i, bundle);
}
};
}
return EditorInfoCompat.getContentMimeTypes(editorInfo).length == 0 ? inputConnection : new InputConnectionWrapper(inputConnection, z) { // from class: androidx.core.view.inputmethod.InputConnectionCompat.2
@Override // android.view.inputmethod.InputConnectionWrapper, android.view.inputmethod.InputConnection
public boolean performPrivateCommand(String str, Bundle bundle) {
if (InputConnectionCompat.handlePerformPrivateCommand(str, bundle, onCommitContentListener)) {
return true;
}
return super.performPrivateCommand(str, bundle);
}
};
}
public static InputConnection createWrapper(View view, InputConnection inputConnection, EditorInfo editorInfo) {
return createWrapper(inputConnection, editorInfo, createOnCommitContentListenerUsingPerformReceiveContent(view));
}
private static OnCommitContentListener createOnCommitContentListenerUsingPerformReceiveContent(final View view) {
Preconditions.checkNotNull(view);
return new OnCommitContentListener() { // from class: androidx.core.view.inputmethod.InputConnectionCompat$$ExternalSyntheticLambda1
@Override // androidx.core.view.inputmethod.InputConnectionCompat.OnCommitContentListener
public final boolean onCommitContent(InputContentInfoCompat inputContentInfoCompat, int i, Bundle bundle) {
return InputConnectionCompat.lambda$createOnCommitContentListenerUsingPerformReceiveContent$0(view, inputContentInfoCompat, i, bundle);
}
};
}
static /* synthetic */ boolean lambda$createOnCommitContentListenerUsingPerformReceiveContent$0(View view, InputContentInfoCompat inputContentInfoCompat, int i, Bundle bundle) {
if (Build.VERSION.SDK_INT >= 25 && (i & 1) != 0) {
try {
inputContentInfoCompat.requestPermission();
InputContentInfo m = Trace$$ExternalSyntheticApiModelOutline0.m(inputContentInfoCompat.unwrap());
bundle = bundle == null ? new Bundle() : new Bundle(bundle);
bundle.putParcelable(EXTRA_INPUT_CONTENT_INFO, m);
} catch (Exception e) {
Log.w(LOG_TAG, "Can't insert content from IME; requestPermission() failed", e);
return false;
}
}
return ViewCompat.performReceiveContent(view, new ContentInfoCompat.Builder(new ClipData(inputContentInfoCompat.getDescription(), new ClipData.Item(inputContentInfoCompat.getContentUri())), 2).setLinkUri(inputContentInfoCompat.getLinkUri()).setExtras(bundle).build()) == null;
}
@Deprecated
public InputConnectionCompat() {
}
static class Api25Impl {
private Api25Impl() {
}
static boolean commitContent(InputConnection inputConnection, InputContentInfo inputContentInfo, int i, Bundle bundle) {
return inputConnection.commitContent(inputContentInfo, i, bundle);
}
}
}

View File

@ -0,0 +1,150 @@
package androidx.core.view.inputmethod;
import android.content.ClipDescription;
import android.net.Uri;
import android.os.Build;
import android.view.inputmethod.InputContentInfo;
/* loaded from: classes.dex */
public final class InputContentInfoCompat {
private final InputContentInfoCompatImpl mImpl;
private interface InputContentInfoCompatImpl {
Uri getContentUri();
ClipDescription getDescription();
Object getInputContentInfo();
Uri getLinkUri();
void releasePermission();
void requestPermission();
}
private static final class InputContentInfoCompatBaseImpl implements InputContentInfoCompatImpl {
private final Uri mContentUri;
private final ClipDescription mDescription;
private final Uri mLinkUri;
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public Uri getContentUri() {
return this.mContentUri;
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public ClipDescription getDescription() {
return this.mDescription;
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public Object getInputContentInfo() {
return null;
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public Uri getLinkUri() {
return this.mLinkUri;
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public void releasePermission() {
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public void requestPermission() {
}
InputContentInfoCompatBaseImpl(Uri uri, ClipDescription clipDescription, Uri uri2) {
this.mContentUri = uri;
this.mDescription = clipDescription;
this.mLinkUri = uri2;
}
}
private static final class InputContentInfoCompatApi25Impl implements InputContentInfoCompatImpl {
final InputContentInfo mObject;
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public Object getInputContentInfo() {
return this.mObject;
}
InputContentInfoCompatApi25Impl(Object obj) {
this.mObject = (InputContentInfo) obj;
}
InputContentInfoCompatApi25Impl(Uri uri, ClipDescription clipDescription, Uri uri2) {
this.mObject = new InputContentInfo(uri, clipDescription, uri2);
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public Uri getContentUri() {
return this.mObject.getContentUri();
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public ClipDescription getDescription() {
return this.mObject.getDescription();
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public Uri getLinkUri() {
return this.mObject.getLinkUri();
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public void requestPermission() {
this.mObject.requestPermission();
}
@Override // androidx.core.view.inputmethod.InputContentInfoCompat.InputContentInfoCompatImpl
public void releasePermission() {
this.mObject.releasePermission();
}
}
public InputContentInfoCompat(Uri uri, ClipDescription clipDescription, Uri uri2) {
if (Build.VERSION.SDK_INT >= 25) {
this.mImpl = new InputContentInfoCompatApi25Impl(uri, clipDescription, uri2);
} else {
this.mImpl = new InputContentInfoCompatBaseImpl(uri, clipDescription, uri2);
}
}
private InputContentInfoCompat(InputContentInfoCompatImpl inputContentInfoCompatImpl) {
this.mImpl = inputContentInfoCompatImpl;
}
public Uri getContentUri() {
return this.mImpl.getContentUri();
}
public ClipDescription getDescription() {
return this.mImpl.getDescription();
}
public Uri getLinkUri() {
return this.mImpl.getLinkUri();
}
public static InputContentInfoCompat wrap(Object obj) {
if (obj != null && Build.VERSION.SDK_INT >= 25) {
return new InputContentInfoCompat(new InputContentInfoCompatApi25Impl(obj));
}
return null;
}
public Object unwrap() {
return this.mImpl.getInputContentInfo();
}
public void requestPermission() {
this.mImpl.requestPermission();
}
public void releasePermission() {
this.mImpl.releasePermission();
}
}