jimu-decompiled/sources/com/google/android/material/snackbar/BaseTransientBottomBar$SnackbarBaseLayout.java
2025-05-13 19:24:51 +02:00

84 lines
4.1 KiB
Java

package com.google.android.material.snackbar;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityManager;
import android.widget.FrameLayout;
import androidx.core.view.ViewCompat;
import androidx.core.view.accessibility.AccessibilityManagerCompat;
import com.google.android.material.R$styleable;
/* loaded from: classes.dex */
public class BaseTransientBottomBar$SnackbarBaseLayout extends FrameLayout {
private final AccessibilityManager a;
private final AccessibilityManagerCompat.TouchExplorationStateChangeListener b;
private BaseTransientBottomBar$OnLayoutChangeListener c;
private BaseTransientBottomBar$OnAttachStateChangeListener d;
protected BaseTransientBottomBar$SnackbarBaseLayout(Context context) {
this(context, null);
}
/* JADX INFO: Access modifiers changed from: private */
public void setClickableOrFocusableBasedOnAccessibility(boolean z) {
setClickable(!z);
setFocusable(z);
}
@Override // android.view.ViewGroup, android.view.View
protected void onAttachedToWindow() {
super.onAttachedToWindow();
BaseTransientBottomBar$OnAttachStateChangeListener baseTransientBottomBar$OnAttachStateChangeListener = this.d;
if (baseTransientBottomBar$OnAttachStateChangeListener != null) {
baseTransientBottomBar$OnAttachStateChangeListener.onViewAttachedToWindow(this);
}
ViewCompat.B(this);
}
@Override // android.view.ViewGroup, android.view.View
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
BaseTransientBottomBar$OnAttachStateChangeListener baseTransientBottomBar$OnAttachStateChangeListener = this.d;
if (baseTransientBottomBar$OnAttachStateChangeListener != null) {
baseTransientBottomBar$OnAttachStateChangeListener.onViewDetachedFromWindow(this);
}
AccessibilityManagerCompat.b(this.a, this.b);
}
@Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
protected void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
BaseTransientBottomBar$OnLayoutChangeListener baseTransientBottomBar$OnLayoutChangeListener = this.c;
if (baseTransientBottomBar$OnLayoutChangeListener != null) {
baseTransientBottomBar$OnLayoutChangeListener.a(this, i, i2, i3, i4);
}
}
void setOnAttachStateChangeListener(BaseTransientBottomBar$OnAttachStateChangeListener baseTransientBottomBar$OnAttachStateChangeListener) {
this.d = baseTransientBottomBar$OnAttachStateChangeListener;
}
void setOnLayoutChangeListener(BaseTransientBottomBar$OnLayoutChangeListener baseTransientBottomBar$OnLayoutChangeListener) {
this.c = baseTransientBottomBar$OnLayoutChangeListener;
}
protected BaseTransientBottomBar$SnackbarBaseLayout(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.SnackbarLayout);
if (obtainStyledAttributes.hasValue(R$styleable.SnackbarLayout_elevation)) {
ViewCompat.b(this, obtainStyledAttributes.getDimensionPixelSize(R$styleable.SnackbarLayout_elevation, 0));
}
obtainStyledAttributes.recycle();
this.a = (AccessibilityManager) context.getSystemService("accessibility");
this.b = new AccessibilityManagerCompat.TouchExplorationStateChangeListener() { // from class: com.google.android.material.snackbar.BaseTransientBottomBar$SnackbarBaseLayout.1
@Override // androidx.core.view.accessibility.AccessibilityManagerCompat.TouchExplorationStateChangeListener
public void onTouchExplorationStateChanged(boolean z) {
BaseTransientBottomBar$SnackbarBaseLayout.this.setClickableOrFocusableBasedOnAccessibility(z);
}
};
AccessibilityManagerCompat.a(this.a, this.b);
setClickableOrFocusableBasedOnAccessibility(this.a.isTouchExplorationEnabled());
}
}