| | |
| | | import com.tejia.lijin.app.util.ad.AdUtil; |
| | | import com.tejia.lijin.app.util.ad.ExpressAdContainer; |
| | | import com.tejia.lijin.app.util.ad.ExpressAdManager; |
| | | import com.tejia.lijin.app.util.ui.dialog.DialogUtil; |
| | | import com.wpc.library.util.SystemCommon; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public static class Builder { |
| | | private Activity context; |
| | | IDialogButtonClick dialogButtonClickListener; |
| | | private String btnName; |
| | | private String link; |
| | | private Integer iconResourceId; |
| | | private String message; |
| | | |
| | | public Builder(Activity context) { |
| | | this.context = context; |
| | | } |
| | | |
| | | |
| | | public Builder setLeftBtnInfo(String btnName, String link) { |
| | | this.btnName = btnName; |
| | | this.link = link; |
| | | return this; |
| | | } |
| | | |
| | | public Builder setMessage(String message) { |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | |
| | | |
| | | public Builder setIconResource(Integer resourceId) { |
| | | this.iconResourceId = resourceId; |
| | | return this; |
| | | } |
| | | |
| | | public Builder setOnButtonClickListener(IDialogButtonClick dialogCloseListener) { |
| | | this.dialogButtonClickListener = dialogCloseListener; |
| | |
| | | AQuery mAquery = new AQuery(layout); |
| | | final TextView tv_create = mAquery.id(R.id.tv_create).getTextView(); |
| | | final TextView tv_fanli = mAquery.id(R.id.tv_fanli).getTextView(); |
| | | //icon_goods_detail_notify |
| | | if (iconResourceId != null) { |
| | | //隐藏 |
| | | mAquery.id(R.id.iv_icon).visibility(View.VISIBLE); |
| | | mAquery.id(R.id.iv_icon).image(iconResourceId); |
| | | } else { |
| | | mAquery.id(R.id.iv_icon).visibility(View.GONE); |
| | | } |
| | | |
| | | if (message != null) { |
| | | mAquery.id(R.id.tv_message).text(message); |
| | | } |
| | | |
| | | |
| | | if (!StringUtils.isNullOrEmpty(btnName)) { |
| | | tv_create.setVisibility(View.VISIBLE); |
| | | tv_create.setText(btnName); |
| | | } else { |
| | | tv_create.setVisibility(View.GONE); |
| | | tv_create.setText(btnName); |
| | | } |
| | | |
| | | |
| | | GradientDrawable gradientDrawable = new GradientDrawable(); |
| | | gradientDrawable.setStroke(1, Color.parseColor("#F53245")); |
| | |
| | | tv_create.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (!StringUtils.isNullOrEmpty(link)) { |
| | | context.startActivity(new Intent(context, ShareBrowserActivity.class).putExtra("url", link)); |
| | | } |
| | | if (dialogButtonClickListener != null) |
| | | dialogButtonClickListener.onLeftClick(); |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | mAquery.id(R.id.iv_close).clicked(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | DialogUtil.dismiss(dialog); |
| | | } |
| | | }); |
| | | |
| | | |
| | | dialog.addContentView(layout, new FrameLayout.LayoutParams( |
| | | FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); |