本文整理汇总了Java中android.support.v7.app.AlertDialog.getWindow方法的典型用法代码示例。如果您正苦于以下问题:Java AlertDialog.getWindow方法的具体用法?Java AlertDialog.getWindow怎么用?Java AlertDialog.getWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.app.AlertDialog
的用法示例。
在下文中一共展示了AlertDialog.getWindow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
@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;
}
示例2: buildSheet
import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
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;
}
示例3: buildCenterSheet
import android.support.v7.app.AlertDialog; //导入方法依赖的package包/类
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;
}