初始化
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.weight.pop;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ConfigRecordBean;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
|
||||
/**
|
||||
* @ClassName CenterPop
|
||||
* @Author 用户
|
||||
* @Date 2022/8/2 17:18
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CenterPop extends CenterPopupView {
|
||||
private Context ctx;
|
||||
private ConfigRecordBean.DataDTO data;
|
||||
|
||||
public CenterPop(@NonNull Context context, ConfigRecordBean.DataDTO data) {
|
||||
super(context);
|
||||
this.ctx = context;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.pop_withdrawal;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
TextView tvMoney = findViewById(R.id.tvMoney);
|
||||
TextView tvFwf = findViewById(R.id.tvFwf);
|
||||
TextView tvFl = findViewById(R.id.tvFl);
|
||||
Button tvCancel = findViewById(R.id.tv_cancel);
|
||||
Button tvConfirm = findViewById(R.id.tv_confirm);
|
||||
|
||||
//初始化数据
|
||||
tvMoney.setText(data.getAmount());
|
||||
tvFwf.setText(data.getChargeNum());
|
||||
String minCharge = data.getMinCharge();
|
||||
double v1 = Double.parseDouble(minCharge) / 100;
|
||||
tvFl.setText(data.getChargeRate() + "% (最低¥" + v1 + "0)");
|
||||
|
||||
tvCancel.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
tvConfirm.setOnClickListener(v -> {
|
||||
if (listener!=null){
|
||||
listener.okClick("");
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private OnOkListener listener;
|
||||
|
||||
public CenterPop setOnOkListener(OnOkListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface OnOkListener {
|
||||
void okClick(String item);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user