|
@@ -21,6 +21,7 @@ import com.cooleshow.base.router.RouterPath;
|
|
|
import com.cooleshow.base.ui.activity.BaseMVPActivity;
|
|
|
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
|
|
|
import com.cooleshow.base.widgets.EmptyViewLayout;
|
|
|
+import com.cooleshow.base.widgets.dialog.CommonDialog;
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -70,7 +71,8 @@ public class AddressListActivity extends BaseMVPActivity<ActivityAddressListBind
|
|
|
addressListAdapter.setDelClickListener(position -> {
|
|
|
delPosition = position;
|
|
|
AddressBean addressBean = dataList.get(position);
|
|
|
- presenter.delAddress(addressBean.id);
|
|
|
+ showTipDialog(addressBean);
|
|
|
+
|
|
|
});
|
|
|
addressListAdapter.setOnItemClickListener((adapter, view, position) -> {
|
|
|
if (mIsCheckAddress) {
|
|
@@ -86,6 +88,28 @@ public class AddressListActivity extends BaseMVPActivity<ActivityAddressListBind
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private void showTipDialog(AddressBean addressBean) {
|
|
|
+ CommonDialog commonDialog = new CommonDialog(AddressListActivity.this);
|
|
|
+ commonDialog.show();
|
|
|
+ commonDialog.setTitle("提示");
|
|
|
+ commonDialog.setContent("是否删除该地址?");
|
|
|
+ commonDialog.setOnCancelClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ commonDialog.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ commonDialog.setOnConfirmClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (presenter != null) {
|
|
|
+ presenter.delAddress(addressBean.id);
|
|
|
+ }
|
|
|
+ commonDialog.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
private void setEmptyView() {
|
|
|
EmptyViewLayout emptyView = new EmptyViewLayout(this);
|
|
|
emptyView.setContent(com.cooleshow.base.R.drawable.icon_empty_content, "暂无数据");
|