83 lines
3.4 KiB
Java
83 lines
3.4 KiB
Java
package androidx.lifecycle;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.lifecycle.Lifecycle;
|
|
public class FullLifecycleObserverAdapter implements LifecycleEventObserver {
|
|
private final FullLifecycleObserver mFullLifecycleObserver;
|
|
private final LifecycleEventObserver mLifecycleEventObserver;
|
|
|
|
/* renamed from: androidx.lifecycle.FullLifecycleObserverAdapter$1 reason: invalid class name */
|
|
public static /* synthetic */ class AnonymousClass1 {
|
|
public static final /* synthetic */ int[] $SwitchMap$androidx$lifecycle$Lifecycle$Event;
|
|
|
|
static {
|
|
Lifecycle.Event.values();
|
|
int[] iArr = new int[7];
|
|
$SwitchMap$androidx$lifecycle$Lifecycle$Event = iArr;
|
|
try {
|
|
iArr[Lifecycle.Event.ON_CREATE.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
$SwitchMap$androidx$lifecycle$Lifecycle$Event[Lifecycle.Event.ON_START.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
$SwitchMap$androidx$lifecycle$Lifecycle$Event[Lifecycle.Event.ON_RESUME.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
$SwitchMap$androidx$lifecycle$Lifecycle$Event[Lifecycle.Event.ON_PAUSE.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
$SwitchMap$androidx$lifecycle$Lifecycle$Event[Lifecycle.Event.ON_STOP.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
$SwitchMap$androidx$lifecycle$Lifecycle$Event[Lifecycle.Event.ON_DESTROY.ordinal()] = 6;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
try {
|
|
$SwitchMap$androidx$lifecycle$Lifecycle$Event[Lifecycle.Event.ON_ANY.ordinal()] = 7;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
}
|
|
}
|
|
|
|
public FullLifecycleObserverAdapter(FullLifecycleObserver fullLifecycleObserver, LifecycleEventObserver lifecycleEventObserver) {
|
|
this.mFullLifecycleObserver = fullLifecycleObserver;
|
|
this.mLifecycleEventObserver = lifecycleEventObserver;
|
|
}
|
|
|
|
@Override // androidx.lifecycle.LifecycleEventObserver
|
|
public void onStateChanged(@NonNull LifecycleOwner lifecycleOwner, @NonNull Lifecycle.Event event) {
|
|
switch (event.ordinal()) {
|
|
case 0:
|
|
this.mFullLifecycleObserver.onCreate(lifecycleOwner);
|
|
break;
|
|
case 1:
|
|
this.mFullLifecycleObserver.onStart(lifecycleOwner);
|
|
break;
|
|
case 2:
|
|
this.mFullLifecycleObserver.onResume(lifecycleOwner);
|
|
break;
|
|
case 3:
|
|
this.mFullLifecycleObserver.onPause(lifecycleOwner);
|
|
break;
|
|
case 4:
|
|
this.mFullLifecycleObserver.onStop(lifecycleOwner);
|
|
break;
|
|
case 5:
|
|
this.mFullLifecycleObserver.onDestroy(lifecycleOwner);
|
|
break;
|
|
case 6:
|
|
throw new IllegalArgumentException("ON_ANY must not been send by anybody");
|
|
}
|
|
LifecycleEventObserver lifecycleEventObserver = this.mLifecycleEventObserver;
|
|
if (lifecycleEventObserver != null) {
|
|
lifecycleEventObserver.onStateChanged(lifecycleOwner, event);
|
|
}
|
|
}
|
|
}
|