전체 화면 Dialog 예

1435 단어
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);

좋은 웹페이지 즐겨찾기