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

82 lines
3.7 KiB
Java
Raw Normal View History

2021-06-27 20:44:35 +00:00
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;
2021-07-13 20:23:20 +00:00
import c.a.i.y3;
2021-06-27 20:44:35 +00:00
import c.a.z.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 {
2021-07-13 20:23:20 +00:00
public final y3 i;
2021-06-27 20:44:35 +00:00
/* 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.z.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");
2021-07-13 20:23:20 +00:00
LayoutInflater.from(getContext()).inflate(2131558842, this);
2021-07-19 11:38:20 +00:00
int i = 2131365701;
ImageView imageView = (ImageView) findViewById(2131365701);
2021-06-27 20:44:35 +00:00
if (imageView != null) {
2021-07-19 11:38:20 +00:00
i = 2131365702;
ImageView imageView2 = (ImageView) findViewById(2131365702);
2021-06-27 20:44:35 +00:00
if (imageView2 != null) {
2021-07-19 11:38:20 +00:00
i = 2131365703;
SeekBar seekBar = (SeekBar) findViewById(2131365703);
2021-06-27 20:44:35 +00:00
if (seekBar != null) {
2021-07-13 20:23:20 +00:00
y3 y3Var = new y3(this, imageView, imageView2, seekBar);
m.checkNotNullExpressionValue(y3Var, "VolumeSliderViewBinding.…ater.from(context), this)");
this.i = y3Var;
2021-06-27 20:44:35 +00:00
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));
}
}