@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAlert.installContent(); }
@Override public void dismiss() { if (mSearchView != null) mSearchView.hideKeyboard(); super.dismiss(); }
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (mAlert.onKeyDown(keyCode, event)) { return true; } return super.onKeyDown(keyCode, event); }
@Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (mAlert.onKeyUp(keyCode, event)) { return true; } return super.onKeyUp(keyCode, event); }
@Override public void setTitle(CharSequence title) { super.setTitle(title); mAlert.setTitle(title); }
public DynamicAlertController(Context context, AppCompatDialog di, Window window) { mContext = context; mDialog = di; mWindow = window; mHandler = new ButtonHandler(di); final TypedArray a = context.obtainStyledAttributes(null, R.styleable.DynamicDialog, R.attr.alertDialogStyle, 0); mAlertDialogLayout = a.getResourceId(R.styleable.DynamicDialog_android_layout, 0); mButtonPanelSideLayout = a.getResourceId(R.styleable.DynamicDialog_buttonPanelSideLayout, 0); mListLayout = a.getResourceId(R.styleable.DynamicDialog_listLayout, 0); mMultiChoiceItemLayout = a.getResourceId(R.styleable.DynamicDialog_multiChoiceItemLayout, 0); mSingleChoiceItemLayout = a .getResourceId(R.styleable.DynamicDialog_singleChoiceItemLayout, 0); mListItemLayout = a.getResourceId(R.styleable.DynamicDialog_listItemLayout, 0); mShowTitle = a.getBoolean(R.styleable.DynamicDialog_showTitle, true); mButtonIconDimen = a.getDimensionPixelSize(R.styleable.DynamicDialog_buttonIconDimen, 0); a.recycle(); /* We use a custom title so never request a window title */ di.supportRequestWindowFeature(Window.FEATURE_NO_TITLE); }
public void installContent() { final int contentView = selectContentView(); mDialog.setContentView(contentView); setupView(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(view); } }
@Override public void dismiss() { mAdapter.setDevices(null); super.dismiss(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Window window = getWindow(); if (window != null) { if (Build.VERSION.SDK_INT >= 21) { window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); } window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); } }
@Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { mOnClickListener.onClick(dialog.mDialog, position); if (!mIsSingleChoice) { dialog.mDialog.dismiss(); } } });
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Aesthetic.Companion.get() .colorPrimary() .take(1) .subscribe(new Consumer<Integer>() { @Override public void accept(Integer integer) throws Exception { findViewById(android.R.id.content).setBackgroundColor(integer); } }); } }