discord-jadx/app/src/main/java/androidx/appcompat/app/AppCompatDialog.java

160 lines
5.0 KiB
Java

package androidx.appcompat.app;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.IdRes;
import androidx.annotation.LayoutRes;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.appcompat.R;
import androidx.appcompat.view.ActionMode;
import androidx.core.view.KeyEventDispatcher;
public class AppCompatDialog extends Dialog implements AppCompatCallback {
private AppCompatDelegate mDelegate;
private final KeyEventDispatcher.Component mKeyDispatcher;
/* renamed from: androidx.appcompat.app.AppCompatDialog$1 reason: invalid class name */
public class AnonymousClass1 implements KeyEventDispatcher.Component {
public AnonymousClass1() {
}
@Override // androidx.core.view.KeyEventDispatcher.Component
public boolean superDispatchKeyEvent(KeyEvent keyEvent) {
return AppCompatDialog.this.superDispatchKeyEvent(keyEvent);
}
}
public AppCompatDialog(Context context) {
this(context, 0);
}
public AppCompatDialog(Context context, int i) {
super(context, getThemeResId(context, i));
this.mKeyDispatcher = new AnonymousClass1();
AppCompatDelegate delegate = getDelegate();
delegate.setTheme(getThemeResId(context, i));
delegate.onCreate(null);
}
public AppCompatDialog(Context context, boolean z2, DialogInterface.OnCancelListener onCancelListener) {
super(context, z2, onCancelListener);
this.mKeyDispatcher = new AnonymousClass1();
}
private static int getThemeResId(Context context, int i) {
if (i != 0) {
return i;
}
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(R.attr.dialogTheme, typedValue, true);
return typedValue.resourceId;
}
@Override // android.app.Dialog
public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
getDelegate().addContentView(view, layoutParams);
}
@Override // android.app.Dialog, android.content.DialogInterface
public void dismiss() {
super.dismiss();
getDelegate().onDestroy();
}
@Override // android.app.Dialog, android.view.Window.Callback
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
return KeyEventDispatcher.dispatchKeyEvent(this.mKeyDispatcher, getWindow().getDecorView(), this, keyEvent);
}
@Override // android.app.Dialog
@Nullable
public <T extends View> T findViewById(@IdRes int i) {
return (T) getDelegate().findViewById(i);
}
public AppCompatDelegate getDelegate() {
if (this.mDelegate == null) {
this.mDelegate = AppCompatDelegate.create(this, this);
}
return this.mDelegate;
}
public ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
@Override // android.app.Dialog
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
@Override // android.app.Dialog
public void onCreate(Bundle bundle) {
getDelegate().installViewFactory();
super.onCreate(bundle);
getDelegate().onCreate(bundle);
}
@Override // android.app.Dialog
public void onStop() {
super.onStop();
getDelegate().onStop();
}
@Override // androidx.appcompat.app.AppCompatCallback
public void onSupportActionModeFinished(ActionMode actionMode) {
}
@Override // androidx.appcompat.app.AppCompatCallback
public void onSupportActionModeStarted(ActionMode actionMode) {
}
@Override // androidx.appcompat.app.AppCompatCallback
@Nullable
public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) {
return null;
}
@Override // android.app.Dialog
public void setContentView(@LayoutRes int i) {
getDelegate().setContentView(i);
}
@Override // android.app.Dialog
public void setContentView(View view) {
getDelegate().setContentView(view);
}
@Override // android.app.Dialog
public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
getDelegate().setContentView(view, layoutParams);
}
@Override // android.app.Dialog
public void setTitle(int i) {
super.setTitle(i);
getDelegate().setTitle(getContext().getString(i));
}
@Override // android.app.Dialog
public void setTitle(CharSequence charSequence) {
super.setTitle(charSequence);
getDelegate().setTitle(charSequence);
}
public boolean superDispatchKeyEvent(KeyEvent keyEvent) {
return super.dispatchKeyEvent(keyEvent);
}
public boolean supportRequestWindowFeature(int i) {
return getDelegate().requestWindowFeature(i);
}
}