Inflates the layout of the dialog.

@param activity
The activity, the dialog should belong to, as an instance of the class {@link
Activity}
@return The view, which has been inflated, as an instance of the class {@link View}
320043
@SuppressLint("InflateParams")
    private View inflateLayout(final Activity activity) {
        LayoutInflater inflater = activity.getLayoutInflater();
        View view = inflater.inflate(R.layout.remove_preference_header_dialog, null);
        setView(view);
        return view;
    }
336117
public void show(){
        if(title==null || message==null) {
            throw new RuntimeException("Title or message cannot be null.");
        }

        dialogView = layoutInflater.inflate(R.layout.password_dialog, null);
        ((TextView) dialogView.findViewById(R.id.password_dialog_title)).setText(title);
        ((TextView) dialogView.findViewById(R.id.password_dialog_message)).setText(message);
        final EditText input = dialogView.findViewById(R.id.password_dialog_input);

        input.setInputType(passwordType);

        dialog = builder.setView(dialogView)
                .setPositiveButton(R.string.password_confirm, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        // have to override this listener, otherwise it will close the dialog
                    }
                })
                .setNegativeButton(R.string.password_cancel, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        if(callback!=null){
                            callback.onPasswordCancel();
                        }
                    }
                })
                .create();

        if(dialog.getWindow() != null) {
            if(enterAnimation!=DialogAnimation.Enter.APPEAR || exitAnimation!=DialogAnimation.Exit.DISAPPEAR) {
                int style = DialogAnimation.getStyle(enterAnimation, exitAnimation);
                if (style != -1) {
                    dialog.getWindow().getAttributes().windowAnimations = style;
                } else {
                    Log.w(TAG, "The animation selected is not available. Default animation will be used.");
                }
            }

            if(!dimBackground){
                dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
            }
        }
        else{
            Log.w(TAG, "Could not get window from dialog");
        }
        dialog.setCanceledOnTouchOutside(cancelOnTouchOutside);
        dialog.setCancelable(cancelOnPressBack);
        dialog.show();

        dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                if(callback!=null){
                    String password = input.getText().toString();
                    if(callback.onPasswordCheck(password)){
                        dialog.dismiss();
                        if(token!=null){
                            token.validate();
                        }
                        callback.onPasswordSucceeded();
                    }
                    else{
                        input.setText("");
                        input.setError(context.getResources().getString(R.string.password_incorrect));
                    }
                }
            }
        });
    }
197888
@Override
    public void onActivityResume(Activity activity) {
        HMSAgentLog.d("autoShowFloatWindow:" + isShowFloatWindowCalled);
        if (isShowFloatWindowCalled) {
            showFinal(true, null, ApiClientMgr.INST.getApiClient());
        }
    }
90536
private void inflateTitleView() {
        titleContainer = rootView.findViewById(R.id.title_container);
        titleContainer.removeAllViews();

        if (customTitleView != null) {
            titleContainer.addView(customTitleView);
        } else if (customTitleViewId != -1) {
            LayoutInflater layoutInflater = LayoutInflater.from(getContext());
            View view = layoutInflater.inflate(customTitleViewId, titleContainer, false);
            titleContainer.addView(view);
        } else {
            LayoutInflater layoutInflater = LayoutInflater.from(getContext());
            View view = layoutInflater.inflate(R.layout.bottom_sheet_title, titleContainer, false);
            titleContainer.addView(view);
        }

        if (getStyle() == Style.LIST) {
            int padding = getContext().getResources()
                    .getDimensionPixelSize(R.dimen.bottom_sheet_list_item_horizontal_padding);
            titleContainer.setPadding(padding, 0, padding, 0);
        } else {
            int padding = getContext().getResources()
                    .getDimensionPixelSize(R.dimen.bottom_sheet_grid_item_horizontal_padding);
            titleContainer.setPadding(padding, 0, padding, 0);
        }

        View titleView = titleContainer.findViewById(android.R.id.title);
        titleTextView = titleView instanceof TextView ? (TextView) titleView : null;
    }
673345
private void inflateView() {
        parentView = createParentView();
        view = createView();
        view.setOnFocusChangeListener(createFocusChangeListener());
        view.setBackgroundResource(R.drawable.validateable_view_background);
        setLineColor(getAccentColor());

        if (parentView != null) {
            parentView.addView(view, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
            addView(parentView, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        } else {
            addView(view, LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        }
    }
854013
private void inflateContentContainer() {
        if (contentContainer == null) {
            contentContainer = new RelativeLayout(getContext());
            contentContainer.setId(R.id.content_container);
            LinearLayout.LayoutParams layoutParams =
                    new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0);
            layoutParams.weight = 1;
            contentContainer.setLayoutParams(layoutParams);
        } else {
            contentContainer.removeAllViews();
        }
    }
968340
private void inflate() {
        ((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.ebm__menu, this, true);

        mOverlay = findViewById(R.id.ebm__menu_overlay);

        mMidContainer = findViewById(R.id.ebm__menu_middle_container);
        mLeftContainer = findViewById(R.id.ebm__menu_left_container);
        mRightContainer = findViewById(R.id.ebm__menu_right_container);

        mMidText = (TextView) findViewById(R.id.ebm__menu_middle_text);
        mLeftText = (TextView) findViewById(R.id.ebm__menu_left_text);
        mRightText = (TextView) findViewById(R.id.ebm__menu_right_text);

        mCloseBtn = (ImageButton) findViewById(R.id.ebm__menu_close_image);
        mMidBtn = (ImageButton) findViewById(R.id.ebm__menu_middle_image);
        mRightBtn = (ImageButton) findViewById(R.id.ebm__menu_right_image);
        mLeftBtn = (ImageButton) findViewById(R.id.ebm__menu_left_image);

        sWidth = ScreenHelper.getScreenWidth(getContext());
        sHeight = ScreenHelper.getScreenHeight(getContext());

        mMidBtn.setEnabled(false);
        mRightBtn.setEnabled(false);
        mLeftBtn.setEnabled(false);

        mCloseBtn.setOnClickListener(this);
        mMidBtn.setOnClickListener(this);
        mRightBtn.setOnClickListener(this);
        mLeftBtn.setOnClickListener(this);
        mOverlay.setOnClickListener(this);
    }
198436
@TargetApi(VERSION_CODES.KITKAT)
    public static void showSystemUI(Activity activity) {
        View decorView = activity.getWindow().getDecorView();
        decorView.setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
        );
    }
581341
static CalligraphyActivityFactory get(Activity activity) {
        if (!(activity.getLayoutInflater() instanceof CalligraphyLayoutInflater)) {
            throw new RuntimeException("This activity does not wrap the Base Context! See CalligraphyContextWrapper.wrap(Context)");
        }
        return (CalligraphyActivityFactory) activity.getLayoutInflater();
    }
114302
public static void starthHomeActivity(@Nullable Activity activity) {
		if (activity != null) {
			if (activity.getClass() != AbstractApplication.get().getHomeActivityClass()) {
				Intent intent = new Intent(activity, AbstractApplication.get().getHomeActivityClass());
				intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				activity.startActivity(intent);
			}
		} else {
			LOGGER.warn("Null activity. Ignoring launch of " + AbstractApplication.get().getHomeActivityClass().getSimpleName());
		}
	}
589045
public DrawerBuilder withFooter(@LayoutRes int footerViewRes) {
        if (mActivity == null) {
            throw new RuntimeException("please pass an activity first to use this call");
        }

        if (footerViewRes != -1) {
            //i know there should be a root, bit i got none here
            this.mFooterView = mActivity.getLayoutInflater().inflate(footerViewRes, null, false);
        }

        return this;
    }
109582
public DialogPlusBuilder setFooter(@NonNull View view, boolean fixed) {
    this.footerView = view;
    this.fixedFooter = fixed;
    return this;
  }
700839
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState)
    {
        int theme = getArguments().getInt("theme");
        int initialYear = getArguments().getInt("year");
        int initialMonth = getArguments().getInt("month");
        int initialDay = getArguments().getInt("day");
        Date minDate = (Date) getArguments().getSerializable("minDate");
        Date maxDate = (Date) getArguments().getSerializable("maxDate");

        // Unless we inflate using a cloned inflater with a Holo theme,
        // on Lollipop devices the DatePicker will be the new-style
        // DatePicker, which is not what we want. So we will
        // clone the inflater that we're given but with our specified
        // theme, then inflate the layout with this new inflater.

        Context contextThemeWrapper = new ContextThemeWrapper(
                getActivity(),
                theme == DateTimePicker.HOLO_DARK ?
                         android.R.style.Theme_Holo :
                         android.R.style.Theme_Holo_Light);

        LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);

        View v = localInflater.inflate(R.layout.hlklib_date_time_picker_fragment_date, container, false);

        mDatePicker = (CustomDatePicker) v.findViewById(R.id.hlklib_datetimepicker_date_picker);
        // block keyboard popping up on touch
        mDatePicker.setDescendantFocusability(DatePicker.FOCUS_BLOCK_DESCENDANTS);
        mDatePicker.init(
            initialYear,
            initialMonth,
            initialDay,
            new OnDateChangedListener() {

                @Override
                public void onDateChanged(DatePicker view, int year,
                        int monthOfYear, int dayOfMonth)
                {
                    mCallback.onDateChanged(year, monthOfYear, dayOfMonth);
                }
            });

        if (minDate != null)
            mDatePicker.setMinDate(minDate.getTime());

        if (maxDate != null)
            mDatePicker.setMaxDate(maxDate.getTime());

        return v;
    }
1236993
public AccountHeaderBuilder withAccountHeader(@LayoutRes int resLayout) {
        if (mActivity == null) {
            throw new RuntimeException("please pass an activity first to use this call");
        }

        if (resLayout != -1) {
            this.mAccountHeaderContainer = mActivity.getLayoutInflater().inflate(resLayout, null, false);
        } else {
            if (mCompactStyle) {
                this.mAccountHeaderContainer = mActivity.getLayoutInflater().inflate(R.layout.material_drawer_compact_header, null, false);
            } else {
                this.mAccountHeaderContainer = mActivity.getLayoutInflater().inflate(R.layout.material_drawer_header, null, false);
            }
        }

        return this;
    }
1113357
def init_layout(self):
        
        super(AndroidDialog, self).init_layout()

        #: Set the content
        for view in self.child_widgets():
            self.dialog.setContentView(view)
            break

        #: Show it if needed
        d = self.declaration
        if d.show:
            self.set_show(d.show)
258989
public static boolean show(final Activity activity) {
        final SharedPreferences preferences = activity.getSharedPreferences(PREFERENCES_EULA,
                Activity.MODE_PRIVATE);
        if (!preferences.getBoolean(PREFERENCE_EULA_ACCEPTED, false)) {
            final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            builder.setTitle("License");
            builder.setCancelable(true);
            builder.setPositiveButton("Accept", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    accept(preferences);
                    if (activity instanceof OnEulaAgreedTo) {
                        ((OnEulaAgreedTo) activity).onEulaAgreedTo();
                    }
                }
            });
            builder.setNegativeButton("Refuse", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    refuse(activity);
                }
            });
            builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
                public void onCancel(DialogInterface dialog) {
                    refuse(activity);
                }
            });
            builder.setMessage(readEula(activity));
            builder.create().show();
            return false;
        }
        return true;
    }
36269
public static Navigate from(@NonNull Activity activity) {
        return new Navigate(null, activity, null, null);
    }