discord-jadx/app/src/main/java/com/discord/views/calls/VolumeSliderView.java

82 lines
3.7 KiB
Java

package com.discord.views.calls;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import c.a.i.a4;
import c.a.y.i;
import com.discord.R;
import com.discord.utilities.color.ColorCompat;
import com.discord.utilities.color.ColorCompatKt;
import d0.z.d.m;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
/* compiled from: VolumeSliderView.kt */
public final class VolumeSliderView extends LinearLayout {
public final a4 i;
/* compiled from: VolumeSliderView.kt */
public static final class a extends i {
public final /* synthetic */ Function2 a;
public a(Function2 function2) {
this.a = function2;
}
@Override // c.a.y.i, android.widget.SeekBar.OnSeekBarChangeListener
public void onProgressChanged(SeekBar seekBar, int i, boolean z2) {
m.checkNotNullParameter(seekBar, "seekBar");
this.a.invoke(Float.valueOf((float) i), Boolean.valueOf(z2));
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public VolumeSliderView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
m.checkNotNullParameter(context, "context");
LayoutInflater.from(getContext()).inflate(2131558844, this);
int i = 2131365719;
ImageView imageView = (ImageView) findViewById(2131365719);
if (imageView != null) {
i = 2131365720;
ImageView imageView2 = (ImageView) findViewById(2131365720);
if (imageView2 != null) {
i = 2131365721;
SeekBar seekBar = (SeekBar) findViewById(2131365721);
if (seekBar != null) {
a4 a4Var = new a4(this, imageView, imageView2, seekBar);
m.checkNotNullExpressionValue(a4Var, "VolumeSliderViewBinding.…ater.from(context), this)");
this.i = a4Var;
if (attributeSet != null) {
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R.a.VolumeSliderView, 0, 0);
m.checkNotNullExpressionValue(obtainStyledAttributes, "context.obtainStyledAttr…e.VolumeSliderView, 0, 0)");
int i2 = obtainStyledAttributes.getInt(1, 100);
int resourceId = obtainStyledAttributes.getResourceId(0, -1);
if (resourceId != -1) {
m.checkNotNullExpressionValue(imageView2, "binding.volumeSliderMinVol");
ColorCompatKt.tintWithColor(imageView2, ColorCompat.getColor(getContext(), resourceId));
m.checkNotNullExpressionValue(imageView, "binding.volumeSliderMaxVol");
ColorCompatKt.tintWithColor(imageView, ColorCompat.getColor(getContext(), resourceId));
}
m.checkNotNullExpressionValue(seekBar, "binding.volumeSliderSeekBar");
seekBar.setMax(i2);
obtainStyledAttributes.recycle();
return;
}
return;
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(getResources().getResourceName(i)));
}
public final void setOnVolumeChange(Function2<? super Float, ? super Boolean, Unit> function2) {
m.checkNotNullParameter(function2, "onVolumeChanged");
this.i.d.setOnSeekBarChangeListener(new a(function2));
}
}