Rabbit-R1/android (non root)/java/sources/androidx/navigation/NavGraphBuilder.java

81 lines
5.2 KiB
Java
Raw Normal View History

2024-05-21 16:08:36 -05:00
package androidx.navigation;
import io.sentry.protocol.OperatingSystem;
import java.util.ArrayList;
import java.util.List;
import kotlin.Deprecated;
import kotlin.Metadata;
import kotlin.ReplaceWith;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: NavGraphBuilder.kt */
@NavDestinationDsl
@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0006\b\u0017\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B#\b\u0017\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\b\b\u0001\u0010\u0005\u001a\u00020\u0006\u0012\b\b\u0001\u0010\u0007\u001a\u00020\u0006¢\u0006\u0002\u0010\bB!\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0007\u001a\u00020\t\u0012\b\u0010\n\u001a\u0004\u0018\u00010\\u0006\u0002\u0010\u000bJ\u000e\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u000eJ\b\u0010\u0016\u001a\u00020\u0002H\u0016J\u001e\u0010\u0015\u001a\u00020\u0014\"\b\b\u0000\u0010\u0017*\u00020\u000e2\f\u0010\u0018\u001a\b\u0012\u0004\u0012\u0002H\u00170\u0001J\r\u0010\u0019\u001a\u00020\u0014*\u00020\u000eH\u0086\u0002R\u0014\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u000e0\rX\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0003\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u0010R\u0012\u0010\u0011\u001a\u00020\u00068\u0002@\u0002X\u0083\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0012\u001a\u0004\u0018\u00010\tX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u001a"}, d2 = {"Landroidx/navigation/NavGraphBuilder;", "Landroidx/navigation/NavDestinationBuilder;", "Landroidx/navigation/NavGraph;", "provider", "Landroidx/navigation/NavigatorProvider;", "id", "", "startDestination", "(Landroidx/navigation/NavigatorProvider;II)V", "", "route", "(Landroidx/navigation/NavigatorProvider;Ljava/lang/String;Ljava/lang/String;)V", "destinations", "", "Landroidx/navigation/NavDestination;", "getProvider", "()Landroidx/navigation/NavigatorProvider;", "startDestinationId", "startDestinationRoute", "addDestination", "", "destination", OperatingSystem.JsonKeys.BUILD, "D", "navDestination", "unaryPlus", "navigation-common_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes2.dex */
public class NavGraphBuilder extends NavDestinationBuilder<NavGraph> {
private final List<NavDestination> destinations;
private final NavigatorProvider provider;
private int startDestinationId;
private String startDestinationRoute;
public final NavigatorProvider getProvider() {
return this.provider;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
@Deprecated(message = "Use routes to build your NavGraph instead", replaceWith = @ReplaceWith(expression = "NavGraphBuilder(provider, startDestination = startDestination.toString(), route = id.toString())", imports = {}))
public NavGraphBuilder(NavigatorProvider provider, int i, int i2) {
super(provider.getNavigator(NavGraphNavigator.class), i);
Intrinsics.checkNotNullParameter(provider, "provider");
this.destinations = new ArrayList();
this.provider = provider;
this.startDestinationId = i2;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public NavGraphBuilder(NavigatorProvider provider, String startDestination, String str) {
super(provider.getNavigator(NavGraphNavigator.class), str);
Intrinsics.checkNotNullParameter(provider, "provider");
Intrinsics.checkNotNullParameter(startDestination, "startDestination");
this.destinations = new ArrayList();
this.provider = provider;
this.startDestinationRoute = startDestination;
}
public final <D extends NavDestination> void destination(NavDestinationBuilder<? extends D> navDestination) {
Intrinsics.checkNotNullParameter(navDestination, "navDestination");
this.destinations.add(navDestination.build());
}
public final void unaryPlus(NavDestination navDestination) {
Intrinsics.checkNotNullParameter(navDestination, "<this>");
addDestination(navDestination);
}
public final void addDestination(NavDestination destination) {
Intrinsics.checkNotNullParameter(destination, "destination");
this.destinations.add(destination);
}
@Override // androidx.navigation.NavDestinationBuilder
public NavGraph build() {
NavGraph navGraph = (NavGraph) super.build();
navGraph.addDestinations(this.destinations);
int i = this.startDestinationId;
if (i == 0 && this.startDestinationRoute == null) {
if (getRoute() != null) {
throw new IllegalStateException("You must set a start destination route");
}
throw new IllegalStateException("You must set a start destination id");
}
String str = this.startDestinationRoute;
if (str != null) {
Intrinsics.checkNotNull(str);
navGraph.setStartDestination(str);
} else {
navGraph.setStartDestination(i);
}
return navGraph;
}
}