Java Code Examples for android.support.v7.app.AlertDialog.getWindow()

The following are Jave code examples for showing how to use getWindow() of the android.support.v7.app.AlertDialog class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: OSchina_resources_android   File: ShareDialogBuilder.java   Source Code and License Vote up 6 votes
@SuppressWarnings("deprecation")
@Override
public AlertDialog create() {

    AlertDialog alertDialog = super.create();
    Window window = alertDialog.getWindow();

    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        WindowManager m = window.getWindowManager();
        Display d = m.getDefaultDisplay();
        WindowManager.LayoutParams p = window.getAttributes();
        p.width = d.getWidth();
        window.setAttributes(p);
    }
    this.mAlertDialog = alertDialog;
    return alertDialog;
}
 
Example 2
Project: GitHub   File: Buildable.java   Source Code and License Vote up 5 votes
protected BuildBean buildSheet(BuildBean bean) {
    AlertDialog.Builder builder = new AlertDialog.Builder(bean.mContext);
    SheetHolder holder = new SheetHolder(bean.mContext, true);
    builder.setView(holder.rootView);
    AlertDialog dialog = builder.create();
    bean.alertDialog = dialog;
    if (bean.isVertical && !TextUtils.isEmpty(bean.bottomTxt)) {
        Window window = dialog.getWindow();
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    holder.assingDatasAndEvents(bean.mContext, bean);
    return bean;
}
 
Example 3
Project: KUtils   File: Buildable.java   Source Code and License Vote up 5 votes
protected BuildBean buildCenterSheet(BuildBean bean) {
    AlertDialog.Builder builder = new AlertDialog.Builder(bean.mContext);
    SheetHolder holder = new SheetHolder(bean.mContext);
    builder.setView(holder.rootView);
    AlertDialog dialog = builder.create();
    bean.alertDialog = dialog;
    if (bean.isVertical && !TextUtils.isEmpty(bean.bottomTxt)) {
        Window window = dialog.getWindow();
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    holder.assingDatasAndEvents(bean.mContext, bean);
    return bean;
}
 
Example 4
Project: KUtils-master   File: Buildable.java   Source Code and License Vote up 5 votes
protected BuildBean buildCenterSheet(BuildBean bean) {
    AlertDialog.Builder builder = new AlertDialog.Builder(bean.mContext);
    SheetHolder holder = new SheetHolder(bean.mContext);
    builder.setView(holder.rootView);
    AlertDialog dialog = builder.create();
    bean.alertDialog = dialog;
    if (bean.isVertical && !TextUtils.isEmpty(bean.bottomTxt)) {
        Window window = dialog.getWindow();
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    }
    holder.assingDatasAndEvents(bean.mContext, bean);
    return bean;
}