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;
|
}
|
|
|
}
|
}
|