127 lines
4.2 KiB
Java
127 lines
4.2 KiB
Java
package o;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.ColorStateList;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.util.AttributeSet;
|
|
import android.widget.SeekBar;
|
|
import androidx.core.view.ViewCompat;
|
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
|
import o.SYO;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class uzP extends Kvu {
|
|
private boolean a;
|
|
private boolean b;
|
|
private PorterDuff.Mode c;
|
|
private Drawable d;
|
|
private ColorStateList e;
|
|
private final SeekBar g;
|
|
|
|
public uzP(SeekBar seekBar) {
|
|
super(seekBar);
|
|
this.e = null;
|
|
this.c = null;
|
|
this.b = false;
|
|
this.a = false;
|
|
this.g = seekBar;
|
|
}
|
|
|
|
@Override // o.Kvu
|
|
public void gK_(AttributeSet attributeSet, int i) {
|
|
super.gK_(attributeSet, i);
|
|
Context context = this.g.getContext();
|
|
C0683McA c0683McA = new C0683McA(context, context.obtainStyledAttributes(attributeSet, SYO.ZqN.AppCompatSeekBar, i, 0));
|
|
SeekBar seekBar = this.g;
|
|
ViewCompat.sm_(seekBar, seekBar.getContext(), SYO.ZqN.AppCompatSeekBar, attributeSet, c0683McA.d, i, 0);
|
|
Drawable jM_ = c0683McA.jM_(SYO.ZqN.AppCompatSeekBar_android_thumb);
|
|
if (jM_ != null) {
|
|
this.g.setThumb(jM_);
|
|
}
|
|
gL_(c0683McA.jL_(SYO.ZqN.AppCompatSeekBar_tickMark));
|
|
if (c0683McA.d.hasValue(SYO.ZqN.AppCompatSeekBar_tickMarkTintMode)) {
|
|
this.c = FIj.hZ_(c0683McA.d.getInt(SYO.ZqN.AppCompatSeekBar_tickMarkTintMode, -1), this.c);
|
|
this.a = true;
|
|
}
|
|
if (c0683McA.d.hasValue(SYO.ZqN.AppCompatSeekBar_tickMarkTint)) {
|
|
this.e = c0683McA.jK_(SYO.ZqN.AppCompatSeekBar_tickMarkTint);
|
|
this.b = true;
|
|
}
|
|
c0683McA.d.recycle();
|
|
d();
|
|
}
|
|
|
|
void gL_(Drawable drawable) {
|
|
Drawable drawable2 = this.d;
|
|
if (drawable2 != null) {
|
|
drawable2.setCallback(null);
|
|
}
|
|
this.d = drawable;
|
|
if (drawable != null) {
|
|
drawable.setCallback(this.g);
|
|
Tlu.pD_(drawable, ViewCompat.m(this.g));
|
|
if (drawable.isStateful()) {
|
|
drawable.setState(this.g.getDrawableState());
|
|
}
|
|
d();
|
|
}
|
|
this.g.invalidate();
|
|
}
|
|
|
|
private void d() {
|
|
Drawable drawable = this.d;
|
|
if (drawable != null) {
|
|
if (this.b || this.a) {
|
|
Drawable pI_ = Tlu.pI_(drawable.mutate());
|
|
this.d = pI_;
|
|
if (this.b) {
|
|
Tlu.pF_(pI_, this.e);
|
|
}
|
|
if (this.a) {
|
|
Tlu.pG_(this.d, this.c);
|
|
}
|
|
if (this.d.isStateful()) {
|
|
this.d.setState(this.g.getDrawableState());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public void a() {
|
|
Drawable drawable = this.d;
|
|
if (drawable != null) {
|
|
drawable.jumpToCurrentState();
|
|
}
|
|
}
|
|
|
|
public void c() {
|
|
Drawable drawable = this.d;
|
|
if (drawable != null && drawable.isStateful() && drawable.setState(this.g.getDrawableState())) {
|
|
this.g.invalidateDrawable(drawable);
|
|
}
|
|
}
|
|
|
|
public void gJ_(Canvas canvas) {
|
|
if (this.d != null) {
|
|
int max = this.g.getMax();
|
|
if (max > 1) {
|
|
int intrinsicWidth = this.d.getIntrinsicWidth();
|
|
int intrinsicHeight = this.d.getIntrinsicHeight();
|
|
int i = intrinsicWidth >= 0 ? intrinsicWidth / 2 : 1;
|
|
int i2 = intrinsicHeight >= 0 ? intrinsicHeight / 2 : 1;
|
|
this.d.setBounds(-i, -i2, i, i2);
|
|
float width = ((this.g.getWidth() - this.g.getPaddingLeft()) - this.g.getPaddingRight()) / max;
|
|
int save = canvas.save();
|
|
canvas.translate(this.g.getPaddingLeft(), this.g.getHeight() / 2);
|
|
for (int i3 = 0; i3 <= max; i3++) {
|
|
this.d.draw(canvas);
|
|
canvas.translate(width, BitmapDescriptorFactory.HUE_RED);
|
|
}
|
|
canvas.restoreToCount(save);
|
|
}
|
|
}
|
|
}
|
|
}
|