Class DynamicDialogUtils
java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicDialogUtils
Helper class to perform
DynamicDialog operations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DialogbindDialog(View view, Dialog dialog, int type) Bind the dialog with a window token.static DialogbindDialog(View view, Dialog dialog, int type, int windowAnimations) Bind the dialog with a window token.static intgetDialogTopPadding(Context context) Get top padding of the dialog to maintain uniform layout on all Android versions.static DynamicDialogsetView(DynamicDialog alertDialog, View view) Set custom view to a dialog with top padding to maintain uniform layout on all Android versions.
-
Constructor Details
-
DynamicDialogUtils
public DynamicDialogUtils()
-
-
Method Details
-
getDialogTopPadding
Get top padding of the dialog to maintain uniform layout on all Android versions.Generally, it is required in case of custom view in the dialog.
- Parameters:
context- The context to get the resources.- Returns:
- The top padding of the dialog.
-
bindDialog
public static Dialog bindDialog(@Nullable View view, @NonNull Dialog dialog, int type, @StyleRes int windowAnimations) Bind the dialog with a window token.Useful to display it from a service.
- Parameters:
view- The view to bind the dialog.dialog- The dialog to be displayed.type- The dialog type.windowAnimations- The custom animation used for the window.- Returns:
- The bound dialog with the supplied view.
-
bindDialog
Bind the dialog with a window token. Useful to display it from a service.- Parameters:
view- The view to bind the dialog.dialog- The dialog to be displayed.type- The dialog type.- Returns:
- The bound dialog with the supplied view.