全屏Dialog示例
【全屏Dialog示例】final Dialog dialog = new Dialog(context,R.style.weighting_activity);
Window window = dialog.getWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {// 在android4.4以上的手机,修改成沉寖式的样式
try {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.requestFeature(Window.FEATURE_NO_TITLE);
/* set it to be full screen */
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}dialog.show();
Uri uri = Uri.parse("res:///" + R.drawable.virtual_create);
DraweeController controller = Fresco.newDraweeControllerBuilder().setUri(uri).setAutoPlayAnimations(true).build();
AbstractAnimatedDrawable animatable = (AbstractAnimatedDrawable) controller.getAnimatable();
android.view.WindowManager.LayoutParams attributes = window.getAttributes();
attributes.width = ViewGroup.LayoutParams.MATCH_PARENT;
attributes.height = ViewGroup.LayoutParams.MATCH_PARENT;
attributes.windowAnimations = 0;
window.setAttributes(attributes);
dialog.setContentView(R.layout.layout_virtualrole_gif);
SimpleDraweeView draweeView = (SimpleDraweeView) window.findViewById(R.id.body_trend);
draweeView.setController(controller);
推荐阅读
- 逻辑回归的理解与python示例
- Spring|Spring Cloud Feign实现文件上传下载的示例代码
- C语言进阶栈帧示例详解教程
- OpenCV|OpenCV-Python实战(18)——深度学习简介与入门示例
- JS下兼容性比较好的全屏方法
- 关于启动页全屏的正确姿势
- c#中task与thread区别及其使用的方法示例
- locust实例
- L3U1P2|L3U1P2 Dialogue(Missing the flight)
- 自定义dialog在xml设置宽高失效的解决