import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | ||||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | ||||
import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | ||||
import com.parkingwang.keyboard.PopupKeyboard; | |||||
import com.scwang.smart.refresh.layout.api.RefreshLayout; | import com.scwang.smart.refresh.layout.api.RefreshLayout; | ||||
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | ||||
*/ | */ | ||||
public class BusinessDetectionActivity extends AppActivity | public class BusinessDetectionActivity extends AppActivity | ||||
implements OnRefreshLoadMoreListener, StatusAction { | implements OnRefreshLoadMoreListener, StatusAction { | ||||
private PopupKeyboard popupKeyboard; | |||||
private ActivityBusinessDetectionBinding binding; | private ActivityBusinessDetectionBinding binding; | ||||
private int page = 1; | private int page = 1; | ||||
private int orderStep = 0; | private int orderStep = 0; | ||||
binding.rlStatusRefresh.setOnRefreshListener(this); | binding.rlStatusRefresh.setOnRefreshListener(this); | ||||
SearchCarInfoUtils searchUtils = new SearchCarInfoUtils(this, new SearchCarInfoUtils.OnCustomReqCallback() { | SearchCarInfoUtils searchUtils = new SearchCarInfoUtils(this, new SearchCarInfoUtils.OnCustomReqCallback() { | ||||
@Override | @Override | ||||
public void request(String vehicle, int vehicleColor) { | |||||
public void request(String vehicle, int vehicleColor, PopupKeyboard mPopupKeyboard) { | |||||
licensePlate = vehicle; | licensePlate = vehicle; | ||||
licensePlateColor = vehicleColor; | licensePlateColor = vehicleColor; | ||||
popupKeyboard = mPopupKeyboard; | |||||
} | } | ||||
}); | }); | ||||
searchUtils.setExpandParams(true,true); | searchUtils.setExpandParams(true,true); | ||||
@SuppressLint("NotifyDataSetChanged") | @SuppressLint("NotifyDataSetChanged") | ||||
@Override | @Override | ||||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent1) { | ||||
if (popupKeyboard != null){ | |||||
popupKeyboard.dismiss(BusinessDetectionActivity.this); | |||||
} | |||||
int totalSize = Integer.parseInt(bizContent1.getTotalCount()); // 获取总的数据条数 | int totalSize = Integer.parseInt(bizContent1.getTotalCount()); // 获取总的数据条数 | ||||
if (page == 1) { | if (page == 1) { | ||||
adapter.replaceData(bizContent1.getData()); | adapter.replaceData(bizContent1.getData()); | ||||
@Override | @Override | ||||
public void onError(String err, Response<Result> resp) { | public void onError(String err, Response<Result> resp) { | ||||
super.onError(err, resp); | super.onError(err, resp); | ||||
if (popupKeyboard != null){ | |||||
popupKeyboard.dismiss(BusinessDetectionActivity.this); | |||||
} | |||||
showError(new StatusLayout.OnRetryListener() { | showError(new StatusLayout.OnRetryListener() { | ||||
@Override | @Override | ||||
public void onRetry(StatusLayout layout) { | public void onRetry(StatusLayout layout) { |
import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | import com.huntersun.vkyes.etcopencard.src.action.StatusAction; | ||||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | ||||
import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | import com.huntersun.vkyes.etcopencard.src.widget.StatusLayout; | ||||
import com.parkingwang.keyboard.PopupKeyboard; | |||||
import com.scwang.smart.refresh.layout.api.RefreshLayout; | import com.scwang.smart.refresh.layout.api.RefreshLayout; | ||||
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; | ||||
private CheckRunningCardListAdapter adapter; | private CheckRunningCardListAdapter adapter; | ||||
private String curVehicleId; | private String curVehicleId; | ||||
private EditText etSearch; | |||||
private PopupKeyboard popupKeyboard; | |||||
@Override | @Override | ||||
protected View getLayoutView() { | protected View getLayoutView() { | ||||
new SearchCarInfoUtils(this,new SearchCarInfoUtils.OnCustomReqCallback() { | new SearchCarInfoUtils(this,new SearchCarInfoUtils.OnCustomReqCallback() { | ||||
@Override | @Override | ||||
public void request(String vehicleId) { | |||||
public void request(String vehicleId, PopupKeyboard mPopupKeyboard) { | |||||
binding.rlStatusRefresh.setVisibility(View.VISIBLE); | binding.rlStatusRefresh.setVisibility(View.VISIBLE); | ||||
curVehicleId = vehicleId; | curVehicleId = vehicleId; | ||||
//etSearch = et; | |||||
popupKeyboard = mPopupKeyboard; | |||||
getList(); | getList(); | ||||
} | } | ||||
}); | }); | ||||
MyRetrofit.newInstance(IFCode.IFCODE152, params, new MyRetrofit.ReturnResult() { | MyRetrofit.newInstance(IFCode.IFCODE152, params, new MyRetrofit.ReturnResult() { | ||||
@Override | @Override | ||||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | ||||
FunHelper.closeKeyboard(etSearch); | |||||
//FunHelper.closeKeyboard(etSearch); | |||||
if (popupKeyboard != null) popupKeyboard.dismiss(CheckRunningWaterStep1Activity.this); | |||||
if (FunHelper.isEmpty(bizContent.cards)) { | if (FunHelper.isEmpty(bizContent.cards)) { | ||||
postDelayed(CheckRunningWaterStep1Activity.this::showEmpty, 300); | postDelayed(CheckRunningWaterStep1Activity.this::showEmpty, 300); | ||||
return; | return; | ||||
@Override | @Override | ||||
public void onError(Response<Result> resp) { | public void onError(Response<Result> resp) { | ||||
if (popupKeyboard != null) popupKeyboard.dismiss(CheckRunningWaterStep1Activity.this); | |||||
showError(new StatusLayout.OnRetryListener() { | showError(new StatusLayout.OnRetryListener() { | ||||
@Override | @Override | ||||
public void onRetry(StatusLayout layout) { | public void onRetry(StatusLayout layout) { |
import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | import com.huntersun.vkyes.etcopencard.src.aop.SingleClick; | ||||
import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | import com.huntersun.vkyes.etcopencard.src.app.AppActivity; | ||||
import com.huntersun.vkyes.etcopencard.src.other.CodeCountDown; | import com.huntersun.vkyes.etcopencard.src.other.CodeCountDown; | ||||
import com.parkingwang.keyboard.PopupKeyboard; | |||||
import java.util.HashMap; | import java.util.HashMap; | ||||
import java.util.Map; | import java.util.Map; | ||||
public class EditCarInfoStep1Activity extends AppActivity { | public class EditCarInfoStep1Activity extends AppActivity { | ||||
private ActivityEditCarInfoStep1Binding binding; | private ActivityEditCarInfoStep1Binding binding; | ||||
private EditText etSearch; | |||||
private PopupKeyboard popupKeyboard; | |||||
private String curVehicleId; | private String curVehicleId; | ||||
private ResultBean.BizContent curBizContent; | private ResultBean.BizContent curBizContent; | ||||
private CodeCountDown mCountDownTimerUtils; | private CodeCountDown mCountDownTimerUtils; | ||||
@Override | @Override | ||||
protected View getLayoutView() { | protected View getLayoutView() { | ||||
binding = ActivityEditCarInfoStep1Binding.inflate(getLayoutInflater()); | binding = ActivityEditCarInfoStep1Binding.inflate(getLayoutInflater()); | ||||
binding.LLUserInfo.setVisibility(View.GONE); | binding.LLUserInfo.setVisibility(View.GONE); | ||||
new SearchCarInfoUtils(this, new SearchCarInfoUtils.OnCustomReqCallback() { | new SearchCarInfoUtils(this, new SearchCarInfoUtils.OnCustomReqCallback() { | ||||
@Override | @Override | ||||
public void request(String vehicleId) { | |||||
//etSearch = et; | |||||
public void request(String vehicleId, PopupKeyboard mPopupKeyboard) { | |||||
popupKeyboard = mPopupKeyboard; | |||||
curVehicleId = vehicleId; | curVehicleId = vehicleId; | ||||
getCarInfo(); | getCarInfo(); | ||||
} | } | ||||
MyRetrofit.newInstance(IFCode.IFCODE154, params, new MyRetrofit.ReturnResult() { | MyRetrofit.newInstance(IFCode.IFCODE154, params, new MyRetrofit.ReturnResult() { | ||||
@Override | @Override | ||||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | ||||
FunHelper.closeKeyboard(etSearch); | |||||
//FunHelper.closeKeyboard(etSearch); | |||||
if (popupKeyboard != null) popupKeyboard.dismiss(EditCarInfoStep1Activity.this); | |||||
if (bizContent == null || FunHelper.isEmpty(bizContent.vehicles)) { | if (bizContent == null || FunHelper.isEmpty(bizContent.vehicles)) { | ||||
toast("车俩信息不存在"); | toast("车俩信息不存在"); | ||||
return; | return; | ||||
@Override | @Override | ||||
public void onError(Response<Result> resp) { | public void onError(Response<Result> resp) { | ||||
if (popupKeyboard != null) popupKeyboard.dismiss(EditCarInfoStep1Activity.this); | |||||
binding.LLUserInfo.setVisibility(View.GONE); | binding.LLUserInfo.setVisibility(View.GONE); | ||||
} | } | ||||
}); | }); |
} | } | ||||
if (reqCallback != null) { | if (reqCallback != null) { | ||||
reqCallback.request(inputView.getNumber() + "_" + vehiclePlateColor); | |||||
reqCallback.request(inputView.getNumber() , vehiclePlateColor); | |||||
reqCallback.request(inputView.getNumber() + "_" + vehiclePlateColor,mPopupKeyboard); | |||||
reqCallback.request(inputView.getNumber() , vehiclePlateColor,mPopupKeyboard); | |||||
return; | return; | ||||
} | } | ||||
//自定义请求 | //自定义请求 | ||||
public interface OnCustomReqCallback { | public interface OnCustomReqCallback { | ||||
default void request(String vehicleId){}; | |||||
default void request(String vehicle,int vehicleColor){}; | |||||
default void request(String vehicleId,PopupKeyboard mPopupKeyboard){}; | |||||
default void request(String vehicle,int vehicleColor,PopupKeyboard mPopupKeyboard){}; | |||||
} | } | ||||
} | } |
</LinearLayout> | </LinearLayout> | ||||
</LinearLayout> | </LinearLayout> | ||||
<RelativeLayout | |||||
<LinearLayout | |||||
style="@style/MatchWrap.Horizontal" | style="@style/MatchWrap.Horizontal" | ||||
android:layout_marginTop="@dimen/dp_10" | android:layout_marginTop="@dimen/dp_10" | ||||
android:gravity="center_vertical"> | android:gravity="center_vertical"> | ||||
<Button | <Button | ||||
android:id="@+id/btnSearch" | android:id="@+id/btnSearch" | ||||
style="@style/BtnShortStyle" | style="@style/BtnShortStyle" | ||||
android:layout_width="match_parent" | |||||
android:layout_width="0dp" | |||||
android:layout_weight="1" | |||||
android:layout_height="@dimen/dp_35" | android:layout_height="@dimen/dp_35" | ||||
android:layout_gravity="center_vertical|right" | android:layout_gravity="center_vertical|right" | ||||
android:text="搜索" | android:text="搜索" | ||||
android:layout_alignParentRight="true" | android:layout_alignParentRight="true" | ||||
android:layout_marginLeft="@dimen/dp_5" | android:layout_marginLeft="@dimen/dp_5" | ||||
android:textSize="@dimen/sp_12" /> | android:textSize="@dimen/sp_12" /> | ||||
</RelativeLayout> | |||||
</LinearLayout> | |||||
</LinearLayout> | </LinearLayout> | ||||
</LinearLayout> | </LinearLayout> |