2021-06-27 20:44:35 +00:00
|
|
|
package androidx.activity;
|
|
|
|
|
|
|
|
import androidx.lifecycle.LifecycleOwner;
|
2021-11-01 07:19:03 +00:00
|
|
|
import d0.z.d.m;
|
2021-06-27 20:44:35 +00:00
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: OnBackPressedDispatcher.kt */
|
|
|
|
public final class OnBackPressedDispatcherKt {
|
|
|
|
public static final OnBackPressedCallback addCallback(OnBackPressedDispatcher onBackPressedDispatcher, LifecycleOwner lifecycleOwner, boolean z2, Function1<? super OnBackPressedCallback, Unit> function1) {
|
|
|
|
m.checkNotNullParameter(onBackPressedDispatcher, "$this$addCallback");
|
|
|
|
m.checkNotNullParameter(function1, "onBackPressed");
|
|
|
|
OnBackPressedDispatcherKt$addCallback$callback$1 onBackPressedDispatcherKt$addCallback$callback$1 = new OnBackPressedDispatcherKt$addCallback$callback$1(function1, z2, z2);
|
|
|
|
if (lifecycleOwner != null) {
|
|
|
|
onBackPressedDispatcher.addCallback(lifecycleOwner, onBackPressedDispatcherKt$addCallback$callback$1);
|
|
|
|
} else {
|
|
|
|
onBackPressedDispatcher.addCallback(onBackPressedDispatcherKt$addCallback$callback$1);
|
|
|
|
}
|
|
|
|
return onBackPressedDispatcherKt$addCallback$callback$1;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ OnBackPressedCallback addCallback$default(OnBackPressedDispatcher onBackPressedDispatcher, LifecycleOwner lifecycleOwner, boolean z2, Function1 function1, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
lifecycleOwner = null;
|
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
return addCallback(onBackPressedDispatcher, lifecycleOwner, z2, function1);
|
|
|
|
}
|
|
|
|
}
|