761 lines
29 KiB
Java
761 lines
29 KiB
Java
package c.p.a;
|
|
|
|
import android.annotation.SuppressLint;
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.graphics.Bitmap;
|
|
import android.graphics.ColorFilter;
|
|
import android.graphics.LightingColorFilter;
|
|
import android.graphics.Typeface;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.media.RingtoneManager;
|
|
import android.net.Uri;
|
|
import android.os.Build;
|
|
import android.text.TextUtils;
|
|
import android.util.AttributeSet;
|
|
import android.util.Log;
|
|
import android.util.TypedValue;
|
|
import android.view.DisplayCutout;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewStub;
|
|
import android.view.Window;
|
|
import android.view.WindowInsets;
|
|
import android.view.animation.Animation;
|
|
import android.view.animation.AnimationUtils;
|
|
import android.widget.Button;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.TextView;
|
|
import androidx.annotation.ColorInt;
|
|
import androidx.annotation.ColorRes;
|
|
import androidx.annotation.DimenRes;
|
|
import androidx.annotation.DrawableRes;
|
|
import androidx.annotation.Px;
|
|
import androidx.annotation.StringRes;
|
|
import androidx.annotation.StyleRes;
|
|
import androidx.appcompat.content.res.AppCompatResources;
|
|
import androidx.appcompat.widget.AppCompatImageView;
|
|
import androidx.appcompat.widget.AppCompatTextView;
|
|
import androidx.core.content.ContextCompat;
|
|
import androidx.core.view.ViewCompat;
|
|
import androidx.core.widget.TextViewCompat;
|
|
import c.i.a.f.e.o.c;
|
|
import c.p.a.l;
|
|
import com.tapadoo.alerter.R;
|
|
import d0.g;
|
|
import d0.z.d.m;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.Objects;
|
|
import kotlin.Lazy;
|
|
/* compiled from: Alert.kt */
|
|
@SuppressLint({"ViewConstructor"})
|
|
public final class b extends FrameLayout implements View.OnClickListener, Animation.AnimationListener, l.a {
|
|
public int A;
|
|
public final Lazy B;
|
|
public final Lazy C;
|
|
public HashMap D;
|
|
public k i;
|
|
public j j;
|
|
public Animation k;
|
|
public Animation l;
|
|
public long m;
|
|
public boolean n;
|
|
public boolean o;
|
|
public boolean p;
|
|
public boolean q;
|
|
public boolean r;
|
|
|
|
/* renamed from: s reason: collision with root package name */
|
|
public boolean f1514s;
|
|
public Runnable t;
|
|
public boolean u;
|
|
public ArrayList<Button> v;
|
|
public Typeface w;
|
|
|
|
/* renamed from: x reason: collision with root package name */
|
|
public boolean f1515x;
|
|
|
|
/* renamed from: y reason: collision with root package name */
|
|
public boolean f1516y;
|
|
|
|
/* renamed from: z reason: collision with root package name */
|
|
public Uri f1517z;
|
|
|
|
/* compiled from: Alert.kt */
|
|
public static final class a implements Animation.AnimationListener {
|
|
public final /* synthetic */ b i;
|
|
|
|
public a(b bVar) {
|
|
this.i = bVar;
|
|
}
|
|
|
|
@Override // android.view.animation.Animation.AnimationListener
|
|
public void onAnimationEnd(Animation animation) {
|
|
m.checkNotNullParameter(animation, "animation");
|
|
b bVar = this.i;
|
|
bVar.clearAnimation();
|
|
bVar.setVisibility(8);
|
|
bVar.postDelayed(new e(bVar), (long) 100);
|
|
}
|
|
|
|
@Override // android.view.animation.Animation.AnimationListener
|
|
public void onAnimationRepeat(Animation animation) {
|
|
m.checkNotNullParameter(animation, "animation");
|
|
}
|
|
|
|
@Override // android.view.animation.Animation.AnimationListener
|
|
public void onAnimationStart(Animation animation) {
|
|
m.checkNotNullParameter(animation, "animation");
|
|
b bVar = this.i;
|
|
int i = R.d.llAlertBackground;
|
|
LinearLayout linearLayout = (LinearLayout) bVar.c(i);
|
|
if (linearLayout != null) {
|
|
linearLayout.setOnClickListener(null);
|
|
}
|
|
LinearLayout linearLayout2 = (LinearLayout) this.i.c(i);
|
|
if (linearLayout2 != null) {
|
|
linearLayout2.setClickable(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
public b(Context context, int i, AttributeSet attributeSet, int i2, int i3) {
|
|
super(context, null, i2);
|
|
int i4 = i3 & 4;
|
|
i2 = (i3 & 8) != 0 ? 0 : i2;
|
|
m.checkNotNullParameter(context, "context");
|
|
Animation loadAnimation = AnimationUtils.loadAnimation(context, R.a.alerter_slide_in_from_top);
|
|
m.checkNotNullExpressionValue(loadAnimation, "AnimationUtils.loadAnima…lerter_slide_in_from_top)");
|
|
this.k = loadAnimation;
|
|
Animation loadAnimation2 = AnimationUtils.loadAnimation(context, R.a.alerter_slide_out_to_top);
|
|
m.checkNotNullExpressionValue(loadAnimation2, "AnimationUtils.loadAnima…alerter_slide_out_to_top)");
|
|
this.l = loadAnimation2;
|
|
this.m = 3000;
|
|
this.n = true;
|
|
this.o = true;
|
|
this.r = true;
|
|
this.f1514s = true;
|
|
this.u = true;
|
|
this.v = new ArrayList<>();
|
|
this.f1516y = true;
|
|
this.A = 48;
|
|
this.B = g.lazy(new c(this));
|
|
this.C = g.lazy(new d(this));
|
|
FrameLayout.inflate(context, R.e.alerter_alert_view, this);
|
|
int i5 = R.d.vAlertContentContainer;
|
|
ViewStub viewStub = (ViewStub) findViewById(i5);
|
|
m.checkNotNullExpressionValue(viewStub, "vAlertContentContainer");
|
|
viewStub.setLayoutResource(i);
|
|
((ViewStub) findViewById(i5)).inflate();
|
|
setHapticFeedbackEnabled(true);
|
|
ViewCompat.setTranslationZ(this, (float) Integer.MAX_VALUE);
|
|
((LinearLayout) c(R.d.llAlertBackground)).setOnClickListener(this);
|
|
}
|
|
|
|
private final int getNavigationBarHeight() {
|
|
return ((Number) this.C.getValue()).intValue();
|
|
}
|
|
|
|
@Override // c.p.a.l.a
|
|
public void a(View view, boolean z2) {
|
|
m.checkNotNullParameter(view, "view");
|
|
if (z2) {
|
|
removeCallbacks(this.t);
|
|
} else if (!this.p) {
|
|
f fVar = new f(this);
|
|
this.t = fVar;
|
|
postDelayed(fVar, this.m);
|
|
}
|
|
}
|
|
|
|
@Override // c.p.a.l.a
|
|
public boolean b() {
|
|
return this.u;
|
|
}
|
|
|
|
public View c(int i) {
|
|
if (this.D == null) {
|
|
this.D = new HashMap();
|
|
}
|
|
View view = (View) this.D.get(Integer.valueOf(i));
|
|
if (view != null) {
|
|
return view;
|
|
}
|
|
View findViewById = findViewById(i);
|
|
this.D.put(Integer.valueOf(i), findViewById);
|
|
return findViewById;
|
|
}
|
|
|
|
public final void d() {
|
|
try {
|
|
this.l.setAnimationListener(new a(this));
|
|
startAnimation(this.l);
|
|
} catch (Exception e) {
|
|
Log.e(b.class.getSimpleName(), Log.getStackTraceString(e));
|
|
}
|
|
}
|
|
|
|
public final Typeface getButtonTypeFace() {
|
|
return this.w;
|
|
}
|
|
|
|
public final int getContentGravity() {
|
|
LinearLayout linearLayout = (LinearLayout) c(R.d.llAlertBackground);
|
|
ViewGroup.LayoutParams layoutParams = linearLayout != null ? linearLayout.getLayoutParams() : null;
|
|
Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type android.widget.FrameLayout.LayoutParams");
|
|
return ((FrameLayout.LayoutParams) layoutParams).gravity;
|
|
}
|
|
|
|
public final long getDuration$alerter_release() {
|
|
return this.m;
|
|
}
|
|
|
|
public final Animation getEnterAnimation$alerter_release() {
|
|
return this.k;
|
|
}
|
|
|
|
public final Animation getExitAnimation$alerter_release() {
|
|
return this.l;
|
|
}
|
|
|
|
public final View getLayoutContainer() {
|
|
return (View) this.B.getValue();
|
|
}
|
|
|
|
public final int getLayoutGravity() {
|
|
return this.A;
|
|
}
|
|
|
|
public final j getOnHideListener$alerter_release() {
|
|
return this.j;
|
|
}
|
|
|
|
public final TextView getText() {
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(R.d.tvText);
|
|
m.checkNotNullExpressionValue(appCompatTextView, "tvText");
|
|
return appCompatTextView;
|
|
}
|
|
|
|
public final TextView getTitle() {
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(R.d.tvTitle);
|
|
m.checkNotNullExpressionValue(appCompatTextView, "tvTitle");
|
|
return appCompatTextView;
|
|
}
|
|
|
|
@Override // android.view.animation.Animation.AnimationListener
|
|
public void onAnimationEnd(Animation animation) {
|
|
m.checkNotNullParameter(animation, "animation");
|
|
k kVar = this.i;
|
|
if (kVar != null) {
|
|
kVar.a();
|
|
}
|
|
if (!this.p) {
|
|
f fVar = new f(this);
|
|
this.t = fVar;
|
|
postDelayed(fVar, this.m);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.animation.Animation.AnimationListener
|
|
public void onAnimationRepeat(Animation animation) {
|
|
m.checkNotNullParameter(animation, "animation");
|
|
}
|
|
|
|
@Override // android.view.animation.Animation.AnimationListener
|
|
public void onAnimationStart(Animation animation) {
|
|
AppCompatImageView appCompatImageView;
|
|
m.checkNotNullParameter(animation, "animation");
|
|
if (!isInEditMode()) {
|
|
setVisibility(0);
|
|
if (this.f1516y) {
|
|
performHapticFeedback(1);
|
|
}
|
|
if (this.f1517z != null) {
|
|
RingtoneManager.getRingtone(getContext(), this.f1517z).play();
|
|
}
|
|
if (this.q) {
|
|
AppCompatImageView appCompatImageView2 = (AppCompatImageView) c(R.d.ivIcon);
|
|
if (appCompatImageView2 != null) {
|
|
appCompatImageView2.setVisibility(4);
|
|
}
|
|
AppCompatImageView appCompatImageView3 = (AppCompatImageView) c(R.d.ivRightIcon);
|
|
if (appCompatImageView3 != null) {
|
|
appCompatImageView3.setVisibility(4);
|
|
}
|
|
ProgressBar progressBar = (ProgressBar) c(R.d.pbProgress);
|
|
if (progressBar != null) {
|
|
progressBar.setVisibility(0);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (this.n) {
|
|
int i = R.d.ivIcon;
|
|
AppCompatImageView appCompatImageView4 = (AppCompatImageView) c(i);
|
|
if (appCompatImageView4 != null) {
|
|
appCompatImageView4.setVisibility(0);
|
|
}
|
|
if (this.o && (appCompatImageView = (AppCompatImageView) c(i)) != null) {
|
|
appCompatImageView.startAnimation(AnimationUtils.loadAnimation(getContext(), R.a.alerter_pulse));
|
|
}
|
|
} else {
|
|
FrameLayout frameLayout = (FrameLayout) c(R.d.flIconContainer);
|
|
if (frameLayout != null) {
|
|
frameLayout.setVisibility(8);
|
|
}
|
|
}
|
|
FrameLayout frameLayout2 = (FrameLayout) c(R.d.flRightIconContainer);
|
|
if (frameLayout2 != null) {
|
|
frameLayout2.setVisibility(8);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View, android.view.ViewGroup
|
|
public void onAttachedToWindow() {
|
|
Drawable drawable;
|
|
super.onAttachedToWindow();
|
|
LinearLayout linearLayout = (LinearLayout) c(R.d.llAlertBackground);
|
|
if (Build.VERSION.SDK_INT >= 23) {
|
|
if (!this.r) {
|
|
drawable = null;
|
|
} else {
|
|
Context context = linearLayout.getContext();
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
m.checkNotNullParameter(context, "$this$getRippleDrawable");
|
|
TypedValue typedValue = new TypedValue();
|
|
context.getTheme().resolveAttribute(R.b.selectableItemBackground, typedValue, true);
|
|
drawable = ContextCompat.getDrawable(context, typedValue.resourceId);
|
|
}
|
|
linearLayout.setForeground(drawable);
|
|
}
|
|
ViewGroup.LayoutParams layoutParams = linearLayout.getLayoutParams();
|
|
Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type android.widget.FrameLayout.LayoutParams");
|
|
int i = this.A;
|
|
((FrameLayout.LayoutParams) layoutParams).gravity = i;
|
|
if (i != 48) {
|
|
linearLayout.setPadding(linearLayout.getPaddingLeft(), c.J(this, R.c.alerter_padding_default), linearLayout.getPaddingRight(), c.J(this, R.c.alerter_alert_padding));
|
|
}
|
|
ViewGroup.LayoutParams layoutParams2 = getLayoutParams();
|
|
Objects.requireNonNull(layoutParams2, "null cannot be cast to non-null type android.view.ViewGroup.MarginLayoutParams");
|
|
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) layoutParams2;
|
|
if (this.A != 48) {
|
|
marginLayoutParams.bottomMargin = getNavigationBarHeight();
|
|
}
|
|
this.k.setAnimationListener(this);
|
|
setAnimation(this.k);
|
|
for (Button button : this.v) {
|
|
Typeface typeface = this.w;
|
|
if (typeface != null) {
|
|
button.setTypeface(typeface);
|
|
}
|
|
((LinearLayout) c(R.d.llButtonContainer)).addView(button);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public void onClick(View view) {
|
|
m.checkNotNullParameter(view, "v");
|
|
if (this.u) {
|
|
d();
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View, android.view.ViewGroup
|
|
public void onDetachedFromWindow() {
|
|
super.onDetachedFromWindow();
|
|
this.k.setAnimationListener(null);
|
|
}
|
|
|
|
@Override // c.p.a.l.a
|
|
public void onDismiss(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
FrameLayout frameLayout = (FrameLayout) c(R.d.flClickShield);
|
|
if (frameLayout != null) {
|
|
frameLayout.removeView((LinearLayout) c(R.d.llAlertBackground));
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.FrameLayout, android.view.View
|
|
public void onMeasure(int i, int i2) {
|
|
Window window;
|
|
View decorView;
|
|
WindowInsets rootWindowInsets;
|
|
DisplayCutout displayCutout;
|
|
if (!this.f1515x) {
|
|
this.f1515x = true;
|
|
ViewGroup.LayoutParams layoutParams = getLayoutParams();
|
|
Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type android.view.ViewGroup.MarginLayoutParams");
|
|
((ViewGroup.MarginLayoutParams) layoutParams).topMargin = c.J(this, R.c.alerter_alert_negative_margin_top);
|
|
if (Build.VERSION.SDK_INT >= 28) {
|
|
LinearLayout linearLayout = (LinearLayout) c(R.d.llAlertBackground);
|
|
int paddingLeft = linearLayout.getPaddingLeft();
|
|
int paddingTop = linearLayout.getPaddingTop();
|
|
m.checkNotNullParameter(this, "$this$notchHeight");
|
|
Context context = getContext();
|
|
if (!(context instanceof Activity)) {
|
|
context = null;
|
|
}
|
|
Activity activity = (Activity) context;
|
|
linearLayout.setPadding(paddingLeft, (((activity == null || (window = activity.getWindow()) == null || (decorView = window.getDecorView()) == null || (rootWindowInsets = decorView.getRootWindowInsets()) == null || (displayCutout = rootWindowInsets.getDisplayCutout()) == null) ? 0 : displayCutout.getSafeInsetTop()) / 2) + paddingTop, linearLayout.getPaddingRight(), linearLayout.getPaddingBottom());
|
|
}
|
|
}
|
|
super.onMeasure(i, i2);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
@SuppressLint({"ClickableViewAccessibility"})
|
|
public boolean onTouchEvent(MotionEvent motionEvent) {
|
|
m.checkNotNullParameter(motionEvent, "event");
|
|
performClick();
|
|
return super.onTouchEvent(motionEvent);
|
|
}
|
|
|
|
public final void setAlertBackgroundColor(@ColorInt int i) {
|
|
((LinearLayout) c(R.d.llAlertBackground)).setBackgroundColor(i);
|
|
}
|
|
|
|
public final void setAlertBackgroundDrawable(Drawable drawable) {
|
|
m.checkNotNullParameter(drawable, "drawable");
|
|
ViewCompat.setBackground((LinearLayout) c(R.d.llAlertBackground), drawable);
|
|
}
|
|
|
|
public final void setAlertBackgroundResource(@DrawableRes int i) {
|
|
((LinearLayout) c(R.d.llAlertBackground)).setBackgroundResource(i);
|
|
}
|
|
|
|
public final void setButtonTypeFace(Typeface typeface) {
|
|
this.w = typeface;
|
|
}
|
|
|
|
public final void setContentGravity(int i) {
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(R.d.tvTitle);
|
|
LinearLayout.LayoutParams layoutParams = null;
|
|
ViewGroup.LayoutParams layoutParams2 = appCompatTextView != null ? appCompatTextView.getLayoutParams() : null;
|
|
if (!(layoutParams2 instanceof LinearLayout.LayoutParams)) {
|
|
layoutParams2 = null;
|
|
}
|
|
LinearLayout.LayoutParams layoutParams3 = (LinearLayout.LayoutParams) layoutParams2;
|
|
if (layoutParams3 != null) {
|
|
layoutParams3.gravity = i;
|
|
}
|
|
int i2 = R.d.tvText;
|
|
AppCompatTextView appCompatTextView2 = (AppCompatTextView) c(i2);
|
|
ViewGroup.LayoutParams layoutParams4 = appCompatTextView2 != null ? appCompatTextView2.getLayoutParams() : null;
|
|
if (layoutParams4 instanceof LinearLayout.LayoutParams) {
|
|
layoutParams = layoutParams4;
|
|
}
|
|
LinearLayout.LayoutParams layoutParams5 = layoutParams;
|
|
if (layoutParams5 != null) {
|
|
layoutParams5.gravity = i;
|
|
}
|
|
AppCompatTextView appCompatTextView3 = (AppCompatTextView) c(i2);
|
|
if (appCompatTextView3 != null) {
|
|
appCompatTextView3.setLayoutParams(layoutParams5);
|
|
}
|
|
}
|
|
|
|
public final void setDismissible(boolean z2) {
|
|
this.u = z2;
|
|
}
|
|
|
|
public final void setDuration$alerter_release(long j) {
|
|
this.m = j;
|
|
}
|
|
|
|
public final void setEnableInfiniteDuration(boolean z2) {
|
|
this.p = z2;
|
|
}
|
|
|
|
public final void setEnableProgress(boolean z2) {
|
|
this.q = z2;
|
|
}
|
|
|
|
public final void setEnterAnimation$alerter_release(Animation animation) {
|
|
m.checkNotNullParameter(animation, "<set-?>");
|
|
this.k = animation;
|
|
}
|
|
|
|
public final void setExitAnimation$alerter_release(Animation animation) {
|
|
m.checkNotNullParameter(animation, "<set-?>");
|
|
this.l = animation;
|
|
}
|
|
|
|
public final void setIcon(@DrawableRes int i) {
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setImageDrawable(AppCompatResources.getDrawable(getContext(), i));
|
|
}
|
|
}
|
|
|
|
public final void setIcon(Bitmap bitmap) {
|
|
m.checkNotNullParameter(bitmap, "bitmap");
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setImageBitmap(bitmap);
|
|
}
|
|
}
|
|
|
|
public final void setIcon(Drawable drawable) {
|
|
m.checkNotNullParameter(drawable, "drawable");
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setImageDrawable(drawable);
|
|
}
|
|
}
|
|
|
|
public final void setIconColorFilter(@ColorInt int i) {
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setColorFilter(i);
|
|
}
|
|
}
|
|
|
|
public final void setIconColorFilter(ColorFilter colorFilter) {
|
|
m.checkNotNullParameter(colorFilter, "colorFilter");
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setColorFilter(colorFilter);
|
|
}
|
|
}
|
|
|
|
public final void setIconPixelSize(@Px int i) {
|
|
int i2 = R.d.ivIcon;
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(i2);
|
|
m.checkNotNullExpressionValue(appCompatImageView, "ivIcon");
|
|
AppCompatImageView appCompatImageView2 = (AppCompatImageView) c(i2);
|
|
m.checkNotNullExpressionValue(appCompatImageView2, "ivIcon");
|
|
ViewGroup.LayoutParams layoutParams = appCompatImageView2.getLayoutParams();
|
|
layoutParams.width = i;
|
|
layoutParams.height = i;
|
|
setMinimumWidth(i);
|
|
setMinimumHeight(i);
|
|
appCompatImageView.setLayoutParams(layoutParams);
|
|
}
|
|
|
|
public final void setIconSize(@DimenRes int i) {
|
|
setIconPixelSize(c.J(this, i));
|
|
}
|
|
|
|
public final void setLayoutGravity(int i) {
|
|
if (i != 48) {
|
|
Animation loadAnimation = AnimationUtils.loadAnimation(getContext(), R.a.alerter_slide_in_from_bottom);
|
|
m.checkNotNullExpressionValue(loadAnimation, "AnimationUtils.loadAnima…ter_slide_in_from_bottom)");
|
|
this.k = loadAnimation;
|
|
Animation loadAnimation2 = AnimationUtils.loadAnimation(getContext(), R.a.alerter_slide_out_to_bottom);
|
|
m.checkNotNullExpressionValue(loadAnimation2, "AnimationUtils.loadAnima…rter_slide_out_to_bottom)");
|
|
this.l = loadAnimation2;
|
|
}
|
|
this.A = i;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setOnClickListener(View.OnClickListener onClickListener) {
|
|
((LinearLayout) c(R.d.llAlertBackground)).setOnClickListener(onClickListener);
|
|
}
|
|
|
|
public final void setOnHideListener$alerter_release(j jVar) {
|
|
this.j = jVar;
|
|
}
|
|
|
|
public final void setOnShowListener(k kVar) {
|
|
m.checkNotNullParameter(kVar, "listener");
|
|
this.i = kVar;
|
|
}
|
|
|
|
public final void setProgressColorInt(@ColorInt int i) {
|
|
Drawable progressDrawable;
|
|
ProgressBar progressBar = (ProgressBar) c(R.d.pbProgress);
|
|
if (progressBar != null && (progressDrawable = progressBar.getProgressDrawable()) != null) {
|
|
progressDrawable.setColorFilter(new LightingColorFilter(-16777216, i));
|
|
}
|
|
}
|
|
|
|
public final void setProgressColorRes(@ColorRes int i) {
|
|
Drawable progressDrawable;
|
|
ProgressBar progressBar = (ProgressBar) c(R.d.pbProgress);
|
|
if (progressBar != null && (progressDrawable = progressBar.getProgressDrawable()) != null) {
|
|
progressDrawable.setColorFilter(new LightingColorFilter(-16777216, ContextCompat.getColor(getContext(), i)));
|
|
}
|
|
}
|
|
|
|
public final void setRightIcon(@DrawableRes int i) {
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivRightIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setImageDrawable(AppCompatResources.getDrawable(getContext(), i));
|
|
}
|
|
}
|
|
|
|
public final void setRightIcon(Bitmap bitmap) {
|
|
m.checkNotNullParameter(bitmap, "bitmap");
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivRightIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setImageBitmap(bitmap);
|
|
}
|
|
}
|
|
|
|
public final void setRightIcon(Drawable drawable) {
|
|
m.checkNotNullParameter(drawable, "drawable");
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivRightIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setImageDrawable(drawable);
|
|
}
|
|
}
|
|
|
|
public final void setRightIconColorFilter(@ColorInt int i) {
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivRightIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setColorFilter(i);
|
|
}
|
|
}
|
|
|
|
public final void setRightIconColorFilter(ColorFilter colorFilter) {
|
|
m.checkNotNullParameter(colorFilter, "colorFilter");
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(R.d.ivRightIcon);
|
|
if (appCompatImageView != null) {
|
|
appCompatImageView.setColorFilter(colorFilter);
|
|
}
|
|
}
|
|
|
|
public final void setRightIconPixelSize(@Px int i) {
|
|
int i2 = R.d.ivRightIcon;
|
|
AppCompatImageView appCompatImageView = (AppCompatImageView) c(i2);
|
|
m.checkNotNullExpressionValue(appCompatImageView, "ivRightIcon");
|
|
AppCompatImageView appCompatImageView2 = (AppCompatImageView) c(i2);
|
|
m.checkNotNullExpressionValue(appCompatImageView2, "ivRightIcon");
|
|
ViewGroup.LayoutParams layoutParams = appCompatImageView2.getLayoutParams();
|
|
layoutParams.width = i;
|
|
layoutParams.height = i;
|
|
setMinimumWidth(i);
|
|
setMinimumHeight(i);
|
|
appCompatImageView.setLayoutParams(layoutParams);
|
|
}
|
|
|
|
public final void setRightIconPosition(int i) {
|
|
if (i == 48 || i == 17 || i == 16 || i == 80) {
|
|
int i2 = R.d.flRightIconContainer;
|
|
FrameLayout frameLayout = (FrameLayout) c(i2);
|
|
m.checkNotNullExpressionValue(frameLayout, "flRightIconContainer");
|
|
FrameLayout frameLayout2 = (FrameLayout) c(i2);
|
|
m.checkNotNullExpressionValue(frameLayout2, "flRightIconContainer");
|
|
ViewGroup.LayoutParams layoutParams = frameLayout2.getLayoutParams();
|
|
Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type android.widget.LinearLayout.LayoutParams");
|
|
LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) layoutParams;
|
|
layoutParams2.gravity = i;
|
|
frameLayout.setLayoutParams(layoutParams2);
|
|
}
|
|
}
|
|
|
|
public final void setRightIconSize(@DimenRes int i) {
|
|
Context context = getContext();
|
|
m.checkNotNullExpressionValue(context, "context");
|
|
setRightIconPixelSize(context.getResources().getDimensionPixelSize(i));
|
|
}
|
|
|
|
public final void setSound(Uri uri) {
|
|
this.f1517z = uri;
|
|
}
|
|
|
|
public final void setText(@StringRes int i) {
|
|
String string = getContext().getString(i);
|
|
m.checkNotNullExpressionValue(string, "context.getString(textId)");
|
|
setText(string);
|
|
}
|
|
|
|
public final void setText(CharSequence charSequence) {
|
|
m.checkNotNullParameter(charSequence, "text");
|
|
if (!TextUtils.isEmpty(charSequence)) {
|
|
int i = R.d.tvText;
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(i);
|
|
if (appCompatTextView != null) {
|
|
appCompatTextView.setVisibility(0);
|
|
}
|
|
AppCompatTextView appCompatTextView2 = (AppCompatTextView) c(i);
|
|
if (appCompatTextView2 != null) {
|
|
appCompatTextView2.setText(charSequence);
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void setTextAppearance(@StyleRes int i) {
|
|
if (Build.VERSION.SDK_INT >= 23) {
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(R.d.tvText);
|
|
if (appCompatTextView != null) {
|
|
appCompatTextView.setTextAppearance(i);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
TextViewCompat.setTextAppearance((AppCompatTextView) c(R.d.tvText), i);
|
|
}
|
|
|
|
public final void setTextTypeface(Typeface typeface) {
|
|
m.checkNotNullParameter(typeface, "typeface");
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(R.d.tvText);
|
|
if (appCompatTextView != null) {
|
|
appCompatTextView.setTypeface(typeface);
|
|
}
|
|
}
|
|
|
|
public final void setTitle(@StringRes int i) {
|
|
String string = getContext().getString(i);
|
|
m.checkNotNullExpressionValue(string, "context.getString(titleId)");
|
|
setTitle(string);
|
|
}
|
|
|
|
public final void setTitle(CharSequence charSequence) {
|
|
m.checkNotNullParameter(charSequence, "title");
|
|
if (!TextUtils.isEmpty(charSequence)) {
|
|
int i = R.d.tvTitle;
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(i);
|
|
if (appCompatTextView != null) {
|
|
appCompatTextView.setVisibility(0);
|
|
}
|
|
AppCompatTextView appCompatTextView2 = (AppCompatTextView) c(i);
|
|
if (appCompatTextView2 != null) {
|
|
appCompatTextView2.setText(charSequence);
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void setTitleAppearance(@StyleRes int i) {
|
|
if (Build.VERSION.SDK_INT >= 23) {
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(R.d.tvTitle);
|
|
if (appCompatTextView != null) {
|
|
appCompatTextView.setTextAppearance(i);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
TextViewCompat.setTextAppearance((AppCompatTextView) c(R.d.tvTitle), i);
|
|
}
|
|
|
|
public final void setTitleTypeface(Typeface typeface) {
|
|
m.checkNotNullParameter(typeface, "typeface");
|
|
AppCompatTextView appCompatTextView = (AppCompatTextView) c(R.d.tvTitle);
|
|
if (appCompatTextView != null) {
|
|
appCompatTextView.setTypeface(typeface);
|
|
}
|
|
}
|
|
|
|
public final void setVibrationEnabled(boolean z2) {
|
|
this.f1516y = z2;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setVisibility(int i) {
|
|
super.setVisibility(i);
|
|
int childCount = getChildCount();
|
|
for (int i2 = 0; i2 < childCount; i2++) {
|
|
View childAt = getChildAt(i2);
|
|
m.checkNotNullExpressionValue(childAt, "getChildAt(i)");
|
|
childAt.setVisibility(i);
|
|
}
|
|
}
|
|
}
|