-
-
Notifications
You must be signed in to change notification settings - Fork 18
CustomViewDialog
extends SimpleDialog
Extend this class to create a dialog with a custom view.
It is strongly recommended to create a TAG field which will be used as a default tag for receiving results:
public static final String TAG = "YourTag";If you want to use the builder, make sure to overwrite the .build() function:
public static MyDialog build() {
return new MyDialog();
}protected abstract View onCreateContentView(Bundle savedInstanceState)Inflate, setup and return your custom view here.
For inflating, use one of the provided inflate(...) functions to make sure custom theme attributes are applied correctly.
protected Bundle onResult(int which)Overwrite this method to return a Bundle that will be merged into the results returned by OnDialogResultListener.onResult.
protected void onDialogShown()Overwrite this method to take action once the dialog is shown such as settings the initial state of the positive button (see below) or an input focus.
protected boolean acceptsPositiveButtonPress()Overwrite and return false from this function if you don't want the dialog to be closed yet, for example due to an invalid user input.
protected void pressPositiveButton()Simulates a positive button press e.g. due to an IME action.
protected void setPositiveButtonEnabled(boolean enabled)Updates the positive button state.
For exemplary use have a look at the following dialogs (which extend CustomViewDialog):
Javadoc API
Screenshot gallery
Styling dialogs with themes
Fullscreen dialogs
SimpleDialog
CustomViewDialog
CustomListDialog
SimpleCheckDialog
SimpleColorDialog
SimpleColorWheelDialog
SimpleDateDialog
SimpleEMailDialog
SimpleFormDialog
SimpleImageDialog
SimpleInputDialog
SimpleListDialog
SimplePinDialog
SimpleProgressDialog
SimpleTimeDialog