306 lines
12 KiB
Java
306 lines
12 KiB
Java
package o;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.Resources;
|
|
import android.content.res.TypedArray;
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import android.util.AttributeSet;
|
|
import java.util.Locale;
|
|
import o.C17052tZT;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class Tjw {
|
|
final float a;
|
|
final float b;
|
|
final float c;
|
|
final float d;
|
|
final float e;
|
|
final int f;
|
|
final float g;
|
|
public final RVV h;
|
|
final int i;
|
|
final float j;
|
|
int m;
|
|
public final RVV n;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public Tjw(Context context, int i, int i2, RVV rvv) {
|
|
AttributeSet attributeSet;
|
|
int i3;
|
|
CharSequence charSequence;
|
|
int i4;
|
|
int i5;
|
|
int i6;
|
|
int intValue;
|
|
int intValue2;
|
|
int intValue3;
|
|
int intValue4;
|
|
int intValue5;
|
|
int intValue6;
|
|
int intValue7;
|
|
int intValue8;
|
|
int intValue9;
|
|
int intValue10;
|
|
int intValue11;
|
|
RVV rvv2 = new RVV();
|
|
this.h = rvv2;
|
|
rvv = rvv == null ? new RVV() : rvv;
|
|
int i7 = rvv.g;
|
|
if (i7 != 0) {
|
|
attributeSet = NiE.IW_(context, i7, "badge");
|
|
i3 = attributeSet.getStyleAttribute();
|
|
} else {
|
|
attributeSet = null;
|
|
i3 = 0;
|
|
}
|
|
i2 = i3 != 0 ? i3 : i2;
|
|
int[] iArr = C17052tZT.jNh.Badge;
|
|
uqW.Kb_(context, attributeSet, i, i2);
|
|
uqW.Kc_(context, attributeSet, iArr, i, i2, new int[0]);
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, i, i2);
|
|
Resources resources = context.getResources();
|
|
this.e = obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.Badge_badgeRadius, -1);
|
|
this.a = obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.Badge_badgeWidePadding, resources.getDimensionPixelSize(C17052tZT.HBt.mtrl_badge_long_text_horizontal_padding));
|
|
this.i = context.getResources().getDimensionPixelSize(C17052tZT.HBt.mtrl_badge_horizontal_edge_offset);
|
|
this.f = context.getResources().getDimensionPixelSize(C17052tZT.HBt.mtrl_badge_text_horizontal_edge_offset);
|
|
this.g = obtainStyledAttributes.getDimensionPixelSize(C17052tZT.jNh.Badge_badgeWithTextRadius, -1);
|
|
this.c = obtainStyledAttributes.getDimension(C17052tZT.jNh.Badge_badgeWidth, resources.getDimension(C17052tZT.HBt.m3_badge_size));
|
|
this.j = obtainStyledAttributes.getDimension(C17052tZT.jNh.Badge_badgeWithTextWidth, resources.getDimension(C17052tZT.HBt.m3_badge_with_text_size));
|
|
this.d = obtainStyledAttributes.getDimension(C17052tZT.jNh.Badge_badgeHeight, resources.getDimension(C17052tZT.HBt.m3_badge_size));
|
|
this.b = obtainStyledAttributes.getDimension(C17052tZT.jNh.Badge_badgeWithTextHeight, resources.getDimension(C17052tZT.HBt.m3_badge_with_text_size));
|
|
boolean z = true;
|
|
this.m = obtainStyledAttributes.getInt(C17052tZT.jNh.Badge_offsetAlignmentMode, 1);
|
|
rvv2.b = rvv.b == -2 ? 255 : rvv.b;
|
|
if (rvv.f8380o == null) {
|
|
charSequence = context.getString(C17052tZT.ojQ.mtrl_badge_numberless_content_description);
|
|
} else {
|
|
charSequence = rvv.f8380o;
|
|
}
|
|
rvv2.f8380o = charSequence;
|
|
if (rvv.m == 0) {
|
|
i4 = C17052tZT.jbe.mtrl_badge_content_description;
|
|
} else {
|
|
i4 = rvv.m;
|
|
}
|
|
rvv2.m = i4;
|
|
if (rvv.l == 0) {
|
|
i5 = C17052tZT.ojQ.mtrl_exceed_max_badge_number_content_description;
|
|
} else {
|
|
i5 = rvv.l;
|
|
}
|
|
rvv2.l = i5;
|
|
if (rvv.t != null && !rvv.t.booleanValue()) {
|
|
z = false;
|
|
}
|
|
rvv2.t = Boolean.valueOf(z);
|
|
if (rvv.p == -2) {
|
|
i6 = obtainStyledAttributes.getInt(C17052tZT.jNh.Badge_maxCharacterCount, 4);
|
|
} else {
|
|
i6 = rvv.p;
|
|
}
|
|
rvv2.p = i6;
|
|
if (rvv.r == -2) {
|
|
if (obtainStyledAttributes.hasValue(C17052tZT.jNh.Badge_number)) {
|
|
rvv2.r = obtainStyledAttributes.getInt(C17052tZT.jNh.Badge_number, 0);
|
|
} else {
|
|
rvv2.r = -1;
|
|
}
|
|
} else {
|
|
rvv2.r = rvv.r;
|
|
}
|
|
if (rvv.j == null) {
|
|
intValue = obtainStyledAttributes.getResourceId(C17052tZT.jNh.Badge_badgeShapeAppearance, C17052tZT.NHB.ShapeAppearance_M3_Sys_Shape_Corner_Full);
|
|
} else {
|
|
intValue = rvv.j.intValue();
|
|
}
|
|
rvv2.j = Integer.valueOf(intValue);
|
|
if (rvv.i == null) {
|
|
intValue2 = obtainStyledAttributes.getResourceId(C17052tZT.jNh.Badge_badgeShapeAppearanceOverlay, 0);
|
|
} else {
|
|
intValue2 = rvv.i.intValue();
|
|
}
|
|
rvv2.i = Integer.valueOf(intValue2);
|
|
if (rvv.k == null) {
|
|
intValue3 = obtainStyledAttributes.getResourceId(C17052tZT.jNh.Badge_badgeWithTextShapeAppearance, C17052tZT.NHB.ShapeAppearance_M3_Sys_Shape_Corner_Full);
|
|
} else {
|
|
intValue3 = rvv.k.intValue();
|
|
}
|
|
rvv2.k = Integer.valueOf(intValue3);
|
|
if (rvv.n == null) {
|
|
intValue4 = obtainStyledAttributes.getResourceId(C17052tZT.jNh.Badge_badgeWithTextShapeAppearanceOverlay, 0);
|
|
} else {
|
|
intValue4 = rvv.n.intValue();
|
|
}
|
|
rvv2.n = Integer.valueOf(intValue4);
|
|
if (rvv.a != null) {
|
|
intValue5 = rvv.a.intValue();
|
|
} else {
|
|
intValue5 = C14739fyr.Ku_(context, obtainStyledAttributes, C17052tZT.jNh.Badge_backgroundColor).getDefaultColor();
|
|
}
|
|
rvv2.a = Integer.valueOf(intValue5);
|
|
if (rvv.f == null) {
|
|
intValue6 = obtainStyledAttributes.getResourceId(C17052tZT.jNh.Badge_badgeTextAppearance, C17052tZT.NHB.TextAppearance_MaterialComponents_Badge);
|
|
} else {
|
|
intValue6 = rvv.f.intValue();
|
|
}
|
|
rvv2.f = Integer.valueOf(intValue6);
|
|
if (rvv.h == null) {
|
|
if (obtainStyledAttributes.hasValue(C17052tZT.jNh.Badge_badgeTextColor)) {
|
|
rvv2.h = Integer.valueOf(C14739fyr.Ku_(context, obtainStyledAttributes, C17052tZT.jNh.Badge_badgeTextColor).getDefaultColor());
|
|
} else {
|
|
rvv2.h = Integer.valueOf(new Rzh(context, rvv2.f.intValue()).g.getDefaultColor());
|
|
}
|
|
} else {
|
|
rvv2.h = rvv.h;
|
|
}
|
|
if (rvv.d == null) {
|
|
intValue7 = obtainStyledAttributes.getInt(C17052tZT.jNh.Badge_badgeGravity, 8388661);
|
|
} else {
|
|
intValue7 = rvv.d.intValue();
|
|
}
|
|
rvv2.d = Integer.valueOf(intValue7);
|
|
if (rvv.s == null) {
|
|
intValue8 = obtainStyledAttributes.getDimensionPixelOffset(C17052tZT.jNh.Badge_horizontalOffset, 0);
|
|
} else {
|
|
intValue8 = rvv.s.intValue();
|
|
}
|
|
rvv2.s = Integer.valueOf(intValue8);
|
|
if (rvv.v == null) {
|
|
intValue9 = obtainStyledAttributes.getDimensionPixelOffset(C17052tZT.jNh.Badge_verticalOffset, 0);
|
|
} else {
|
|
intValue9 = rvv.v.intValue();
|
|
}
|
|
rvv2.v = Integer.valueOf(intValue9);
|
|
if (rvv.q == null) {
|
|
intValue10 = obtainStyledAttributes.getDimensionPixelOffset(C17052tZT.jNh.Badge_horizontalOffsetWithText, rvv2.s.intValue());
|
|
} else {
|
|
intValue10 = rvv.q.intValue();
|
|
}
|
|
rvv2.q = Integer.valueOf(intValue10);
|
|
if (rvv.u == null) {
|
|
intValue11 = obtainStyledAttributes.getDimensionPixelOffset(C17052tZT.jNh.Badge_verticalOffsetWithText, rvv2.v.intValue());
|
|
} else {
|
|
intValue11 = rvv.u.intValue();
|
|
}
|
|
rvv2.u = Integer.valueOf(intValue11);
|
|
rvv2.e = Integer.valueOf(rvv.e == null ? 0 : rvv.e.intValue());
|
|
rvv2.c = Integer.valueOf(rvv.c != null ? rvv.c.intValue() : 0);
|
|
obtainStyledAttributes.recycle();
|
|
if (rvv.y == null) {
|
|
rvv2.y = Locale.getDefault(Locale.Category.FORMAT);
|
|
} else {
|
|
rvv2.y = rvv.y;
|
|
}
|
|
this.n = rvv;
|
|
}
|
|
|
|
/* loaded from: classes2.dex */
|
|
public static final class RVV implements Parcelable {
|
|
public static final Parcelable.Creator<RVV> CREATOR = new Parcelable.Creator<RVV>() { // from class: o.Tjw.RVV.1
|
|
@Override // android.os.Parcelable.Creator
|
|
public final /* synthetic */ RVV createFromParcel(Parcel parcel) {
|
|
return new RVV(parcel);
|
|
}
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
public final /* bridge */ /* synthetic */ RVV[] newArray(int i) {
|
|
return new RVV[i];
|
|
}
|
|
};
|
|
public Integer a;
|
|
int b;
|
|
Integer c;
|
|
Integer d;
|
|
Integer e;
|
|
Integer f;
|
|
int g;
|
|
Integer h;
|
|
Integer i;
|
|
Integer j;
|
|
Integer k;
|
|
int l;
|
|
int m;
|
|
Integer n;
|
|
|
|
/* renamed from: o, reason: collision with root package name */
|
|
CharSequence f8380o;
|
|
int p;
|
|
public Integer q;
|
|
public int r;
|
|
public Integer s;
|
|
Boolean t;
|
|
public Integer u;
|
|
public Integer v;
|
|
Locale y;
|
|
|
|
@Override // android.os.Parcelable
|
|
public final int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
public RVV() {
|
|
this.b = 255;
|
|
this.r = -2;
|
|
this.p = -2;
|
|
this.t = Boolean.TRUE;
|
|
}
|
|
|
|
RVV(Parcel parcel) {
|
|
this.b = 255;
|
|
this.r = -2;
|
|
this.p = -2;
|
|
this.t = Boolean.TRUE;
|
|
this.g = parcel.readInt();
|
|
this.a = (Integer) parcel.readSerializable();
|
|
this.h = (Integer) parcel.readSerializable();
|
|
this.f = (Integer) parcel.readSerializable();
|
|
this.j = (Integer) parcel.readSerializable();
|
|
this.i = (Integer) parcel.readSerializable();
|
|
this.k = (Integer) parcel.readSerializable();
|
|
this.n = (Integer) parcel.readSerializable();
|
|
this.b = parcel.readInt();
|
|
this.r = parcel.readInt();
|
|
this.p = parcel.readInt();
|
|
this.f8380o = parcel.readString();
|
|
this.m = parcel.readInt();
|
|
this.d = (Integer) parcel.readSerializable();
|
|
this.s = (Integer) parcel.readSerializable();
|
|
this.v = (Integer) parcel.readSerializable();
|
|
this.q = (Integer) parcel.readSerializable();
|
|
this.u = (Integer) parcel.readSerializable();
|
|
this.e = (Integer) parcel.readSerializable();
|
|
this.c = (Integer) parcel.readSerializable();
|
|
this.t = (Boolean) parcel.readSerializable();
|
|
this.y = (Locale) parcel.readSerializable();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public final void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeInt(this.g);
|
|
parcel.writeSerializable(this.a);
|
|
parcel.writeSerializable(this.h);
|
|
parcel.writeSerializable(this.f);
|
|
parcel.writeSerializable(this.j);
|
|
parcel.writeSerializable(this.i);
|
|
parcel.writeSerializable(this.k);
|
|
parcel.writeSerializable(this.n);
|
|
parcel.writeInt(this.b);
|
|
parcel.writeInt(this.r);
|
|
parcel.writeInt(this.p);
|
|
CharSequence charSequence = this.f8380o;
|
|
parcel.writeString(charSequence == null ? null : charSequence.toString());
|
|
parcel.writeInt(this.m);
|
|
parcel.writeSerializable(this.d);
|
|
parcel.writeSerializable(this.s);
|
|
parcel.writeSerializable(this.v);
|
|
parcel.writeSerializable(this.q);
|
|
parcel.writeSerializable(this.u);
|
|
parcel.writeSerializable(this.e);
|
|
parcel.writeSerializable(this.c);
|
|
parcel.writeSerializable(this.t);
|
|
parcel.writeSerializable(this.y);
|
|
}
|
|
}
|
|
}
|