本文整理了Java中android.view.Window.setDimAmount()
方法的一些代码示例,展示了Window.setDimAmount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setDimAmount()
方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:setDimAmount
暂无
代码示例来源:origin: k9mail/k-9
private void setDialogBackgroundDim() {
Dialog dialog = getDialog();
if (dialog == null) {
return;
}
dialog.getWindow().setDimAmount(BACKGROUND_DIM_AMOUNT);
}
代码示例来源:origin: Bigkoo/Android-PickerView
dialogWindow.setDimAmount(0.1f);
代码示例来源:origin: stackoverflow.com
protected void onCreate(Bundle savedInstanceState) {
Window window = getWindow();
window.setDimAmount(0); //Making the window dim transparent
window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
}
代码示例来源:origin: Popalay/Tutors
@Override
public void onStart() {
super.onStart();
final Window window = getDialog().getWindow();
if (window != null) {
window.setBackgroundDrawableResource(android.R.color.transparent);
window.setDimAmount(0f);
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
}
}
代码示例来源:origin: kaixuanluo/pc-android-controller-android
@Override
protected void onCreate(Bundle savedInstanceState) {
// setTheme(android.R.style.Theme_Dialog);//这个在这里设置 之后导致 的问题是 背景很黑
super.onCreate(savedInstanceState);
//如下代码 只是想 启动一个透明的Activity 而上一个activity又不被pause
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
getWindow().setDimAmount(0f);
// requestScreenShot();
// PermissionsChecker pc = new PermissionsChecker(this);
// if (pc.lacksPermissions("android.permission.CAPTURE_VIDEO_OUTPUT",
// "android.permission.CAPTURE_SECURE_VIDEO_OUTPUT")) {
// } else {
MediaProjectionManager mediaProjectionManager = (MediaProjectionManager)
getSystemService(Context.MEDIA_PROJECTION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
startActivityForResult(
mediaProjectionManager.createScreenCaptureIntent(),
REQUEST_MEDIA_PROJECTION);
}
// }
}
内容来源于网络,如有侵权,请联系作者删除!