advanceddialogview/src/main/java/dev/nurujjamanpollob/uicollection/advanceddialogview/AdvancedDialogView.java
/**
     * Method to draw whole dialog UI
     *
     * @param id            layout resource ID
     * @param skipExisting  during inflate new View, If a existing Dialog UI is showing,
     *                      This parameter sets a flag to re-render new view or keep existing one.
     * @param dialogOptions the Dialog DRAW option. currently, it supports views draw from BOTTOM, CENTER, TOP
     */
Method to draw whole dialog UI
@param id            layout resource ID
@param skipExisting  during inflate new View, If a existing Dialog UI is showing,
This parameter sets a flag to re-render new view or keep existing one.
@param dialogOptions the Dialog DRAW option. currently, it supports views draw from BOTTOM, CENTER, TOP
Method to draw whole dialog UI @param id layout resource ID @param skipExisting during inflate new View If a existing Dialog UI is showing This parameter sets a flag to re - render new view or keep existing one . @param dialogOptions the Dialog DRAW option . currently it supports views draw from BOTTOM CENTER TOP
@MainThread
    private void drawDialogUI(int id, boolean skipExisting, DialogOptions dialogOptions) {
        if (!skipExisting) {
            setContentView(R.layout.custom_dialog_layout);
            Window window = getWindow();
            window.getDecorView().setBackgroundColor(Color.TRANSPARENT);
            window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
            rootView = findViewById(R.id.custom_dialog_layout_root);
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            CoordinatorLayout cl = getViewByIdentity(R.id.bottom_view_dialog_root_coordinatorelayout, new CoordinatorLayout(context));
            if (dialogOptions != null) {
                setDialogUiDirectionMode(cl, dialogOptions);
            } else {
                setDialogUiDirectionMode(cl, DialogOptions.DIALOG_GRAVITY_BOTTOM);
            }
            inflater.inflate(id, cl, true);
            cancelDialogOnClickOutside();
            isShowing = true;
            show();
        }
        if (isDialogShowing()) {
            if (uiLoadListener != null) {
                if (rootView != null) {
                    uiLoadListener.onUiLoaded();
                    uiLoadListener.rootUI(rootView);
                }
            }
        }
    }
@ MainThread private void drawDialogUI ( int id , boolean skipExisting , DialogOptions dialogOptions ) { if ( ! skipExisting ) { setContentView ( R . layout . custom_dialog_layout ) ; Window window = getWindow ( ) ; window . getDecorView ( ) . setBackgroundColor ( Color . TRANSPARENT ) ; window . setLayout ( ViewGroup . LayoutParams . MATCH_PARENT , ViewGroup . LayoutParams . MATCH_PARENT ) ; rootView = findViewById ( R . id . custom_dialog_layout_root ) ; LayoutInflater inflater = ( LayoutInflater ) context . getSystemService ( Context . LAYOUT_INFLATER_SERVICE ) ; CoordinatorLayout cl = getViewByIdentity ( R . id . bottom_view_dialog_root_coordinatorelayout , new CoordinatorLayout ( context ) ) ; if ( dialogOptions != null ) { setDialogUiDirectionMode ( cl , dialogOptions ) ; } else { setDialogUiDirectionMode ( cl , DialogOptions . DIALOG_GRAVITY_BOTTOM ) ; } inflater . inflate ( id , cl , true ) ; cancelDialogOnClickOutside ( ) ; isShowing = true ; show ( ) ; } if ( isDialogShowing ( ) ) { if ( uiLoadListener != null ) { if ( rootView != null ) { uiLoadListener . onUiLoaded ( ) ; uiLoadListener . rootUI ( rootView ) ; } } } }
Method to draw whole dialog UI
 @param id            layout resource ID
 @param skipExisting  during inflate new View, If a existing Dialog UI is showing,
                      This parameter sets a flag to re-render new view or keep existing one.
Method to draw whole dialog UI @param id layout resource ID @param skipExisting during inflate new View If a existing Dialog UI is showing This parameter sets a flag to re - render new view or keep existing one .
// Set content view // So, inflate the view and attach to CoordinatorLayout //If Dialog Ui gravity mode is defined // Use default Ui gravity = bottom // Set Dialog click outside listener