- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
36 lines
947 B
Java
36 lines
947 B
Java
package androidx.core.app;
|
|
|
|
import android.app.Dialog;
|
|
import android.os.Build;
|
|
import android.view.View;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.RequiresApi;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class DialogCompat {
|
|
private DialogCompat() {
|
|
}
|
|
|
|
@NonNull
|
|
public static View requireViewById(@NonNull Dialog dialog, int i) {
|
|
if (Build.VERSION.SDK_INT >= 28) {
|
|
return (View) Api28Impl.requireViewById(dialog, i);
|
|
}
|
|
View findViewById = dialog.findViewById(i);
|
|
if (findViewById != null) {
|
|
return findViewById;
|
|
}
|
|
throw new IllegalArgumentException("ID does not reference a View inside this Dialog");
|
|
}
|
|
|
|
@RequiresApi(28)
|
|
public static class Api28Impl {
|
|
private Api28Impl() {
|
|
}
|
|
|
|
public static <T> T requireViewById(Dialog dialog, int i) {
|
|
return (T) dialog.requireViewById(i);
|
|
}
|
|
}
|
|
}
|