package defpackage;

import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.material.chip.Chip;
import com.strmr.ps.R;
import com.strmr.ps.data.repository.PreferencesRepository;
import com.strmr.ps.ui.mobile.settings.MobileAboutFragment;

/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class aj implements CompoundButton.OnCheckedChangeListener {
    public final /* synthetic */ int a;
    public final /* synthetic */ Object b;

    public /* synthetic */ aj(Object obj, int i) {
        this.a = i;
        this.b = obj;
    }

    @Override // android.widget.CompoundButton.OnCheckedChangeListener
    public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
        switch (this.a) {
            case 0:
                an anVar = (an) this.b;
                cr4.g(compoundButton, "<unused var>");
                PreferencesRepository preferencesRepository = anVar.j;
                if (preferencesRepository == null) {
                    cr4.n("preferencesRepository");
                    throw null;
                }
                preferencesRepository.setDevUpdatesEnabled(z);
                String string = z ? anVar.getString(R.string.dev_channel_enabled) : anVar.getString(R.string.dev_channel_disabled);
                cr4.d(string);
                Toast.makeText(anVar.requireContext(), string, 0).show();
                TextView textView = anVar.p;
                if (textView != null) {
                    textView.setVisibility(8);
                    return;
                } else {
                    cr4.n("updateStatusText");
                    throw null;
                }
            case 1:
                ((Chip) this.b).lambda$new$0(compoundButton, z);
                return;
            default:
                MobileAboutFragment mobileAboutFragment = (MobileAboutFragment) this.b;
                cr4.g(compoundButton, "<unused var>");
                PreferencesRepository preferencesRepository2 = mobileAboutFragment.k;
                if (preferencesRepository2 == null) {
                    cr4.n("preferencesRepository");
                    throw null;
                }
                preferencesRepository2.setDevUpdatesEnabled(z);
                String string2 = z ? mobileAboutFragment.getString(R.string.dev_channel_enabled) : mobileAboutFragment.getString(R.string.dev_channel_disabled);
                cr4.d(string2);
                Toast.makeText(mobileAboutFragment.requireContext(), string2, 0).show();
                vl3 vl3Var = mobileAboutFragment.f;
                cr4.d(vl3Var);
                vl3Var.i.setVisibility(8);
                return;
        }
    }
}
