admin
2021-03-27 214f9edd2fe20c20e32630e9b5380cc6271c1eb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.weikou.beibeivideo.ui.dialog;
 
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
 
import com.weikou.beibeivideo.R;
 
/**
 * 用户协议弹框
 */
public class JumpVideoLoadingDialog extends Dialog {
 
    private static String TAG = JumpVideoLoadingDialog.class.getName();
 
    public JumpVideoLoadingDialog(Context context) {
        super(context);
        this.setCancelable(false);
    }
 
    public JumpVideoLoadingDialog(Context context, int theme) {
        super(context, theme);
        this.setCancelable(false);
    }
 
 
    public static class Builder {
        private Activity context;
 
        public Builder(Activity context) {
            this.context = context;
        }
 
        public JumpVideoLoadingDialog create() {
 
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            final JumpVideoLoadingDialog dialog = new JumpVideoLoadingDialog(context, R.style.DialogNoOverlay);
            dialog.setCanceledOnTouchOutside(true);
            final View layout = inflater.inflate(R.layout.item_jump_video_loading, null);
 
            dialog.setContentView(layout);
 
            WindowManager.LayoutParams params = dialog.getWindow()
                    .getAttributes();
            params.width = WindowManager.LayoutParams.MATCH_PARENT;
            params.height = WindowManager.LayoutParams.MATCH_PARENT;
            dialog.getWindow().setAttributes(params);
            return dialog;
        }
    }
 
    public interface MeasureCallBack {
        public void onMeasure(int height);
    }
}