admin
2021-06-07 01e23be6118d68d38a71d186296d440eadcaa197
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package com.tejia.lijin.app.ui.dialog;
 
import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
 
import com.wpc.library.util.SystemCommon;
import com.wpc.library.util.common.DimenUtils;
import com.tejia.lijin.app.R;
 
import java.util.List;
 
/**
 * 我的粉丝提醒内容列表弹框
 */
public class MyTeamNotifyContentListDialog extends Dialog {
    public MyTeamNotifyContentListDialog(Context context) {
        super(context);
        this.setCancelable(false);
    }
 
    public MyTeamNotifyContentListDialog(Context context, int theme) {
        super(context, theme);
        this.setCancelable(false);
    }
 
    public static class Builder {
        private Context context;
 
        public Builder(Context context) {
            this.context = context;
        }
 
        private String title;
 
        public Builder setTitle(String title) {
            this.title = title;
            return this;
        }
 
        private List<String> msgList;
 
        public Builder setMessage(List<String> msgList) {
            this.msgList = msgList;
            return this;
        }
 
        public CopyLinkDialog create() {
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            // instantiate the dialog with the custom Theme
            final CopyLinkDialog dialog = new CopyLinkDialog(context, R.style.Dialog1);
            View layout = inflater.inflate(R.layout.dialog_myteam_content_list_notify, null);
            dialog.addContentView(layout, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
            LinearLayout ll_content = layout.findViewById(R.id.ll_content);
            TextView popups_title = layout.findViewById(R.id.popups_title);
            popups_title.setText(title);
            layout.findViewById(R.id.popups_close).setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    dialog.dismiss();
                }
            });
            layout.findViewById(R.id.popups_dual).setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    dialog.dismiss();
                }
            });
 
            for (String st : msgList) {
                View item = inflater.inflate(R.layout.item_multiplecontentpopups, null);
                item.setPadding(0, 0, 0, DimenUtils.dip2px(context, 10));
                TextView tv_content = item.findViewById(R.id.item_multiplecontentpopups_txt);
                tv_content.setText(st);
                ll_content.addView(item);
            }
 
            dialog.setContentView(layout);
 
            android.view.WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
            params.width = (int) ((SystemCommon.getScreenWidth(context) * 19) / 25);
            params.height = android.view.WindowManager.LayoutParams.WRAP_CONTENT;
            dialog.getWindow().setAttributes(params);
            dialog.setCanceledOnTouchOutside(false);
            return dialog;
        }
 
 
    }
}