2021-08-09 22:50:52 +00:00
package com.discord.widgets.settings ;
import android.content.Context ;
import android.view.View ;
import android.widget.TextView ;
import androidx.appcompat.app.AlertDialog ;
import com.discord.R ;
import com.discord.restapi.RestAPIParams ;
import com.discord.views.CheckedSetting ;
2021-11-01 07:19:03 +00:00
import d0.z.d.m ;
import d0.z.d.o ;
2021-08-09 22:50:52 +00:00
import kotlin.Unit ;
import kotlin.jvm.functions.Function5 ;
import rx.functions.Action1 ;
/* compiled from: WidgetSettingsPrivacy.kt */
public final class WidgetSettingsPrivacy$configurePrivacyControls$1 < T > implements Action1 < Boolean > {
public final /* synthetic */ Context $context ;
public final /* synthetic */ WidgetSettingsPrivacy this $0 ;
/* compiled from: WidgetSettingsPrivacy.kt */
/* renamed from: com.discord.widgets.settings.WidgetSettingsPrivacy$configurePrivacyControls$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function5 < AlertDialog , TextView , TextView , TextView , TextView , Unit > {
public final /* synthetic */ Boolean $consented ;
public final /* synthetic */ WidgetSettingsPrivacy$configurePrivacyControls$1 this $0 ;
/* compiled from: WidgetSettingsPrivacy.kt */
/* renamed from: com.discord.widgets.settings.WidgetSettingsPrivacy$configurePrivacyControls$1$1$1 reason: invalid class name */
public static final class AnonymousClass1 implements View . OnClickListener {
public final /* synthetic */ AlertDialog $dialog ;
public final /* synthetic */ AnonymousClass1 this $0 ;
public AnonymousClass1 ( AnonymousClass1 r1 , AlertDialog alertDialog ) {
this . this$0 = r1 ;
this . $dialog = alertDialog ;
}
@Override // android.view.View.OnClickListener
public final void onClick ( View view ) {
this . $dialog . dismiss ( ) ;
2021-11-05 21:05:33 +00:00
CheckedSetting checkedSetting = WidgetSettingsPrivacy . access$getBinding$p ( this . this$0 . this$0 . this$0 ) . f2063z ;
2021-08-09 22:50:52 +00:00
m . checkNotNullExpressionValue ( checkedSetting , " binding.settingsPrivacyStatistics " ) ;
checkedSetting . setChecked ( true ) ;
2021-11-05 21:05:33 +00:00
CheckedSetting checkedSetting2 = WidgetSettingsPrivacy . access$getBinding$p ( this . this$0 . this$0 . this$0 ) . f2063z ;
2021-08-09 22:50:52 +00:00
m . checkNotNullExpressionValue ( checkedSetting2 , " binding.settingsPrivacyStatistics " ) ;
checkedSetting2 . setEnabled ( true ) ;
}
}
/* compiled from: WidgetSettingsPrivacy.kt */
/* renamed from: com.discord.widgets.settings.WidgetSettingsPrivacy$configurePrivacyControls$1$1$2 reason: invalid class name */
public static final class AnonymousClass2 implements View . OnClickListener {
public final /* synthetic */ AlertDialog $dialog ;
public final /* synthetic */ AnonymousClass1 this $0 ;
public AnonymousClass2 ( AnonymousClass1 r1 , AlertDialog alertDialog ) {
this . this$0 = r1 ;
this . $dialog = alertDialog ;
}
@Override // android.view.View.OnClickListener
public final void onClick ( View view ) {
this . $dialog . dismiss ( ) ;
AnonymousClass1 r4 = this . this$0 ;
WidgetSettingsPrivacy widgetSettingsPrivacy = r4 . this$0 . this$0 ;
Boolean bool = r4 . $consented ;
m . checkNotNullExpressionValue ( bool , " consented " ) ;
boolean booleanValue = bool . booleanValue ( ) ;
2021-11-05 21:05:33 +00:00
CheckedSetting checkedSetting = WidgetSettingsPrivacy . access$getBinding$p ( this . this$0 . this$0 . this$0 ) . f2063z ;
2021-08-09 22:50:52 +00:00
m . checkNotNullExpressionValue ( checkedSetting , " binding.settingsPrivacyStatistics " ) ;
WidgetSettingsPrivacy . access$toggleConsent ( widgetSettingsPrivacy , booleanValue , RestAPIParams . Consents . Type . USAGE_STATS , checkedSetting ) ;
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1 ( WidgetSettingsPrivacy$configurePrivacyControls$1 widgetSettingsPrivacy$configurePrivacyControls$1 , Boolean bool ) {
super ( 5 ) ;
this . this$0 = widgetSettingsPrivacy$configurePrivacyControls$1 ;
this . $consented = bool ;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function5
public /* bridge */ /* synthetic */ Unit invoke ( AlertDialog alertDialog , TextView textView , TextView textView2 , TextView textView3 , TextView textView4 ) {
invoke ( alertDialog , textView , textView2 , textView3 , textView4 ) ;
return Unit . a ;
}
public final void invoke ( AlertDialog alertDialog , TextView textView , TextView textView2 , TextView textView3 , TextView textView4 ) {
m . checkNotNullParameter ( alertDialog , " dialog " ) ;
m . checkNotNullParameter ( textView , " dialogHeader " ) ;
m . checkNotNullParameter ( textView2 , " dialogBody " ) ;
m . checkNotNullParameter ( textView3 , " dialogCancel " ) ;
m . checkNotNullParameter ( textView4 , " dialogConfirm " ) ;
textView . setText ( R . string . usage_statistics_disable_modal_title ) ;
textView2 . setText ( R . string . usage_statistics_disable_modal_body ) ;
textView3 . setText ( R . string . usage_statistics_disable_modal_cancel ) ;
textView3 . setOnClickListener ( new AnonymousClass1 ( this , alertDialog ) ) ;
textView4 . setText ( R . string . usage_statistics_disable_modal_confirm ) ;
textView4 . setOnClickListener ( new AnonymousClass2 ( this , alertDialog ) ) ;
}
}
public WidgetSettingsPrivacy$configurePrivacyControls$1 ( WidgetSettingsPrivacy widgetSettingsPrivacy , Context context ) {
this . this$0 = widgetSettingsPrivacy ;
this . $context = context ;
}
public final void call ( Boolean bool ) {
2021-11-05 21:05:33 +00:00
CheckedSetting checkedSetting = WidgetSettingsPrivacy . access$getBinding$p ( this . this$0 ) . f2063z ;
2021-08-09 22:50:52 +00:00
m . checkNotNullExpressionValue ( checkedSetting , " binding.settingsPrivacyStatistics " ) ;
checkedSetting . setEnabled ( false ) ;
m . checkNotNullExpressionValue ( bool , " consented " ) ;
if ( bool . booleanValue ( ) ) {
WidgetSettingsPrivacy widgetSettingsPrivacy = this . this$0 ;
boolean booleanValue = bool . booleanValue ( ) ;
2021-11-05 21:05:33 +00:00
CheckedSetting checkedSetting2 = WidgetSettingsPrivacy . access$getBinding$p ( this . this$0 ) . f2063z ;
2021-08-09 22:50:52 +00:00
m . checkNotNullExpressionValue ( checkedSetting2 , " binding.settingsPrivacyStatistics " ) ;
WidgetSettingsPrivacy . access$toggleConsent ( widgetSettingsPrivacy , booleanValue , RestAPIParams . Consents . Type . USAGE_STATS , checkedSetting2 ) ;
return ;
}
WidgetSettingsPrivacy . access$confirmConsent ( this . this$0 , this . $context , new AnonymousClass1 ( this , bool ) ) ;
}
}