1。充值bug;
2.首页的适配 3.提现记录
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -199,6 +199,11 @@
|
||||
android:taskAffinity="com.xscm.qxlive"
|
||||
android:launchMode="singleTask">
|
||||
</activity>
|
||||
<!-- 微信支付回调Activity(必须放在包名.wxapi路径下) -->
|
||||
<activity
|
||||
android:name=".wxapi.WXPayEntryActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop" />
|
||||
<activity
|
||||
android:name="com.example.modulevocal.activity.RealNameActivity"
|
||||
android:exported="false" />
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.xscm.midi.wxapi;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
|
||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.event.PayEvent;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
|
||||
private IWXAPI api;
|
||||
public static final String APP_ID = CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
api = WXAPIFactory.createWXAPI(this, APP_ID);
|
||||
api.handleIntent(getIntent(), this); // 必须调用,否则无法接收回调
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
setIntent(intent);
|
||||
api.handleIntent(intent, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReq(BaseReq baseReq) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResp(BaseResp resp) {
|
||||
// 支付结果回调(resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX)
|
||||
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
|
||||
switch (resp.errCode) {
|
||||
case BaseResp.ErrCode.ERR_OK:
|
||||
// 支付成功:这里需要调用后台接口确认支付状态(避免本地判断不可靠)
|
||||
|
||||
break;
|
||||
case BaseResp.ErrCode.ERR_USER_CANCEL:
|
||||
checkPayResultFromServer();
|
||||
break;
|
||||
default:
|
||||
// 支付失败
|
||||
checkPayResultFromServer();
|
||||
break;
|
||||
}
|
||||
finish(); // 处理完后关闭页面
|
||||
}
|
||||
}
|
||||
|
||||
// 关键:必须从后台确认支付状态(不能仅依赖前端回调)
|
||||
private void checkPayResultFromServer() {
|
||||
// 调用后台接口,传入订单号查询实际支付状态
|
||||
// 用户取消支付
|
||||
ToastUtils.showShort("支付取消");
|
||||
PayEvent messageEvent = new PayEvent(-2, "支付取消");
|
||||
EventBus.getDefault().post(messageEvent);
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,6 @@ import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.UtilConfig;
|
||||
import com.xscm.moduleutil.utils.config.EnvironmentEnum;
|
||||
import com.xscm.moduleutil.utils.config.EnvironmentPrefs;
|
||||
import com.xscm.moduleutil.utils.IMServiceManager;
|
||||
import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
|
||||
|
||||
@@ -11,7 +11,11 @@ import lombok.Data;
|
||||
public class WithdrawalBean {
|
||||
private String name;
|
||||
private String money;
|
||||
private String status;
|
||||
private int status;
|
||||
private String status_str;
|
||||
private String createtime;
|
||||
private String withdraw_fee;
|
||||
private String surplus_money;
|
||||
private String received_tax_amount;
|
||||
|
||||
}
|
||||
|
||||
@@ -156,6 +156,9 @@ public class RechargeDialogFragment extends BaseMvpDialogFragment<RechargeDialog
|
||||
public void onInputBoxVisibilityChanged(boolean isVisible) {
|
||||
// 根据 isVisible 的值来显示或隐藏输入框
|
||||
mBinding.r4.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
||||
if (isVisible){
|
||||
money="0";
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.rvComment.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
|
||||
@@ -166,7 +166,7 @@ public interface ApiServer {
|
||||
Observable<BaseModel<PlaceholderBean>> guildRanking();
|
||||
|
||||
@GET(Constants.GET_WITHDRAWAL_LIST)
|
||||
Observable<BaseModel<List<WithdrawalBean>>> withdrawalList(@Query("page") String page, @Query("page_limit") String page_limit, @Query("search_stime") String search_stime, @Query("search_etime") String search_etime);
|
||||
Call<BaseModel<List<WithdrawalBean>>> withdrawalList(@Query("page") String page, @Query("page_limit") String page_limit, @Query("search_stime") String search_stime, @Query("search_etime") String search_etime);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_BIND_DETAIL)
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.xscm.moduleutil.http;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.util.Log;
|
||||
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
@@ -526,7 +527,27 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
public void withdrawalList(String page, String page_limit, String search_stime, String search_etime, BaseObserver<List<WithdrawalBean>> observer) {
|
||||
sApiServer.withdrawalList(page, page_limit, search_stime, search_etime).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||
sApiServer.withdrawalList(page,page_limit,search_stime,search_etime).enqueue(new Callback<BaseModel<List<WithdrawalBean>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<WithdrawalBean>>> call, Response<BaseModel<List<WithdrawalBean>>> response) {
|
||||
if (response.code() == 200){
|
||||
BaseModel<List<WithdrawalBean>> baseModel=response.body();
|
||||
if (baseModel.getCode()==1){
|
||||
Log.d("withdrawalList---", "onResponse: "+response.body().toString());
|
||||
|
||||
observer.onNext(baseModel.getData());
|
||||
}else {
|
||||
observer.onNext(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<WithdrawalBean>>> call, Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
// sApiServer.withdrawalList(page, page_limit, search_stime, search_etime).compose(new DefaultTransformer<>()).subscribe(observer);
|
||||
}
|
||||
|
||||
public void bindDetai(String userId, String type,BaseObserver<BindDetail> observer){
|
||||
|
||||
@@ -51,11 +51,11 @@ public class EnvironmentPrefs {
|
||||
// }
|
||||
|
||||
// 默认使用生产环境
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.PRODUCTION.name());
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.TEST.name());
|
||||
try {
|
||||
return EnvironmentEnum.valueOf(envName);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return EnvironmentEnum.PRODUCTION; // 出错时默认返回生产环境
|
||||
return EnvironmentEnum.TEST; // 出错时默认返回生产环境
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl2.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl3.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl4.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl5.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl6.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl6.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -8,8 +8,10 @@
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="color_0DFFB9">#0DFFB9</color>
|
||||
<color name="color_2ADB88">#2ADB88</color>
|
||||
<color name="color_DADADA">#DADADA</color>
|
||||
<color name="color_BB8BE2">#BB8BE2</color>
|
||||
<color name="color_999999">#999999</color>
|
||||
|
||||
<color name="colorPrimaryDark">#FFFFBB00</color>
|
||||
<color name="colorAccent">#FFFFBB00</color>
|
||||
|
||||
@@ -12,7 +12,9 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.adapter.PayMethodAdapter;
|
||||
import com.xscm.moduleutil.adapter.BalanceRechargeAdapter;
|
||||
@@ -26,6 +28,7 @@ import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.RechargeBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.event.PayEvent;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
@@ -38,6 +41,9 @@ import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -74,7 +80,7 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
mBinding.recycleView1.setAdapter(bindTypeAdapter);
|
||||
|
||||
bindTypeAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
// 更新选中项
|
||||
|
||||
bindTypeAdapter.setSelectedPosition(position);
|
||||
|
||||
// 获取当前选中的数据
|
||||
@@ -94,7 +100,9 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_payment) {
|
||||
if (money.equals("0")) {
|
||||
|
||||
LogUtils.d(TAG,"onClick,=--2------"+money);
|
||||
if (money.equals("0")||TextUtils.isEmpty(money)) {
|
||||
money=mBinding.etCustomAmount.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(money)) {
|
||||
ToastUtils.showShort("请选择充值金额");
|
||||
@@ -110,6 +118,9 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
ToastUtils.showShort("请选择支付方式");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LogUtils.d(TAG,"onClick,=--3------"+money);
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType());
|
||||
}
|
||||
}
|
||||
@@ -134,11 +145,14 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
rechargeData.add(customItem);
|
||||
rechargeAdapter = new BalanceRechargeAdapter(rechargeData);
|
||||
rechargeAdapter.setNewData(rechargeData);
|
||||
|
||||
rechargeAdapter.setListener(new BalanceRechargeAdapter.OnRechargeItemClickListener() {
|
||||
@Override
|
||||
public void onClick(RechargeBean rechargeBean) {
|
||||
|
||||
money = rechargeBean.getMoney();
|
||||
coin = rechargeBean.getCoins();
|
||||
|
||||
// mBinding.tvPayment.setText(String.format("立即支付(%s元)", money));
|
||||
}
|
||||
});
|
||||
@@ -147,6 +161,11 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
public void onInputBoxVisibilityChanged(boolean isVisible) {
|
||||
// 根据 isVisible 的值来显示或隐藏输入框
|
||||
mBinding.r4.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
||||
if (isVisible){
|
||||
money="0";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
// mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
@@ -170,6 +189,12 @@ public class RechargeActivity extends BaseMvpActivity<RechargePresenter, Activit
|
||||
mBinding.tvJb.setText(walletBean.getCoin());
|
||||
}
|
||||
|
||||
// 订阅方法:处理 MessageEvent 事件
|
||||
// threadMode 指定处理事件的线程(如主线程、后台线程)
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageEvent(PayEvent event) {
|
||||
money="0";
|
||||
}
|
||||
@Override
|
||||
public void appPay(AppPay appPay) {
|
||||
if (appPay.getAli()!=null) {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
@@ -9,6 +12,8 @@ import com.example.modulevocal.adapter.WithdrawalAdapter;
|
||||
import com.example.modulevocal.conacts.WithdrawalConacts;
|
||||
import com.example.modulevocal.databinding.ActivityWithdrawalListBinding;
|
||||
import com.example.modulevocal.presenter.WithdrawalPresenter;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.BindDetail;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
@@ -18,30 +23,42 @@ import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.widget.DoubleTimePickerBottomSheet;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/12
|
||||
*@description: 提现记录
|
||||
* @author qx
|
||||
* @data 2025/7/12
|
||||
* @description: 提现记录
|
||||
*/
|
||||
public class WithdrawalListActivity extends BaseMvpActivity<WithdrawalPresenter, ActivityWithdrawalListBinding> implements WithdrawalConacts.View{
|
||||
public class WithdrawalListActivity extends
|
||||
BaseMvpActivity<WithdrawalPresenter, ActivityWithdrawalListBinding> implements WithdrawalConacts.View, OnRefreshLoadMoreListener {
|
||||
private int page = 1;
|
||||
private String page_limit = "10";
|
||||
private String search_stime;//开始时间
|
||||
private String search_etime;//结束时间
|
||||
|
||||
private WithdrawalAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("提现记录");
|
||||
MvpPre.withdrawalList("1","50","","");
|
||||
mBinding.rl3.setOnClickListener(v -> {
|
||||
DoubleTimePickerBottomSheet dialog = new DoubleTimePickerBottomSheet();
|
||||
dialog.setOnTimeRangeSelectedListener((startDate, endDate) -> {
|
||||
// 处理选择的时间范围
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:mm", Locale.getDefault());
|
||||
Log.d("SelectedTime", "开始时间:" + sdf.format(startDate));
|
||||
mBinding.tv2.setText(sdf.format(startDate));
|
||||
search_stime = sdf.format(startDate);
|
||||
mBinding.tv2.setText(search_stime);
|
||||
Log.d("SelectedTime", "结束时间:" + sdf.format(endDate));
|
||||
mBinding.tv22.setText(sdf.format(endDate));
|
||||
MvpPre.withdrawalList("1","50",mBinding.tv2.getText().toString(),mBinding.tv22.getText().toString());
|
||||
|
||||
search_etime = sdf.format(endDate);
|
||||
mBinding.tv22.setText(search_etime);
|
||||
page = 1;
|
||||
MvpPre.withdrawalList(page + "", page_limit, search_stime, search_etime);
|
||||
});
|
||||
dialog.show(getSupportFragmentManager(), "DoubleTimePicker");
|
||||
});
|
||||
@@ -49,8 +66,12 @@ public class WithdrawalListActivity extends BaseMvpActivity<WithdrawalPresenter,
|
||||
mBinding.revenueView.setLayoutManager(new LinearLayoutManager(this));
|
||||
adapter = new WithdrawalAdapter();
|
||||
mBinding.revenueView.setAdapter(adapter);
|
||||
//下拉刷新的监听
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(this);
|
||||
MvpPre.withdrawalList(page + "", page_limit, search_stime, search_etime);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_withdrawal_list;
|
||||
@@ -58,7 +79,7 @@ public class WithdrawalListActivity extends BaseMvpActivity<WithdrawalPresenter,
|
||||
|
||||
@Override
|
||||
protected WithdrawalPresenter bindPresenter() {
|
||||
return new WithdrawalPresenter(this,this);
|
||||
return new WithdrawalPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,11 +109,65 @@ public class WithdrawalListActivity extends BaseMvpActivity<WithdrawalPresenter,
|
||||
|
||||
@Override
|
||||
public void withdrawalList(List<WithdrawalBean> list) {
|
||||
adapter.setNewData(list);
|
||||
// 1. 统一处理刷新/加载更多的结束状态(三元运算符简化)
|
||||
mBinding.smartRefreshLayout.finishRefresh(isUpRefresh);
|
||||
mBinding.smartRefreshLayout.finishLoadMore(!isUpRefresh);
|
||||
|
||||
// 2. 处理数据为空的情况(避免addData/setNewData传入null)
|
||||
List<WithdrawalBean> newList = list == null ? Collections.emptyList() : list;
|
||||
|
||||
// 3. 数据更新(区分第一页和加载更多,避免冗余notify)
|
||||
if (page == 1) {
|
||||
adapter.setNewData(newList);
|
||||
// 首次加载空数据时,可显示空视图(根据需求添加)
|
||||
if (newList.isEmpty()) {
|
||||
// 4. 最后再设置空视图
|
||||
View emptyView = LayoutInflater.from(this).inflate(R.layout.layout_empty_no, mBinding.revenueView, false);
|
||||
|
||||
adapter.setEmptyView(emptyView); // 自定义空视图
|
||||
}// 通常setNewData内部会自动notify
|
||||
} else {
|
||||
adapter.addData(newList); // 多数适配器(如BaseQuickAdapter)的addData会自动notify
|
||||
}
|
||||
// 5. 完善"是否有更多数据"逻辑:
|
||||
// - 假设每页最多加载10条,若当前返回数据<=10,说明已无更多
|
||||
// - 修复原代码"list可能为null"的空指针风险(改用newList)
|
||||
boolean hasMore = newList.size() > 10;
|
||||
mBinding.smartRefreshLayout.setNoMoreData(!hasMore);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindDetai(BindDetail bindDetail) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载更多数据
|
||||
*
|
||||
* @param refreshLayout
|
||||
*/
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
isUpRefresh = false;
|
||||
page++;
|
||||
MvpPre.withdrawalList(page + "", page_limit + "", search_stime, search_etime);
|
||||
}
|
||||
|
||||
private boolean isUpRefresh = false;
|
||||
|
||||
/**
|
||||
* 刷新数据
|
||||
*
|
||||
* @param refreshLayout
|
||||
*/
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
isUpRefresh = true;
|
||||
page = 1;
|
||||
MvpPre.withdrawalList(page + "", page_limit + "", search_stime, search_etime);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,36 @@ package com.example.modulevocal.adapter;
|
||||
import static com.xscm.moduleutil.utils.UtilConfig.getContext;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
|
||||
public class WithdrawalAdapter extends BaseQuickAdapter<WithdrawalBean, BaseViewHolder> {
|
||||
// 状态常量(替代魔法值,增强可读性)
|
||||
private static final int STATUS_PENDING = 1; // 待处理
|
||||
private static final int STATUS_APPROVED = 2; // 已通过
|
||||
private static final int STATUS_REJECTED = 3; // 已拒绝
|
||||
private static final int STATUS_PAYING = 4; // 打款中
|
||||
private static final int STATUS_PAY_FAILED = 5; // 打款失败
|
||||
private static final int STATUS_PAID = 6; // 已打款
|
||||
|
||||
// 固定文本常量(避免硬编码,便于统一修改)
|
||||
private static final String TEXT_AMOUNT = "提现金额";
|
||||
private static final String TEXT_FEE = "手续费";
|
||||
private static final String TEXT_TAX = "个人所得税";
|
||||
private static final String TEXT_EXPECTED_DEFAULT = "预计到账(个税扣除前)";
|
||||
private static final String TEXT_EXPECTED_REFUND = "退款金额";
|
||||
private static final String TEXT_EXPECTED_ACTUAL = "实际到账";
|
||||
private static final String TEXT_TAX_CALCULATING = "计算中...";
|
||||
|
||||
|
||||
public WithdrawalAdapter() {
|
||||
super(R.layout.item_withdrawal);
|
||||
}
|
||||
@@ -18,26 +40,127 @@ public class WithdrawalAdapter extends BaseQuickAdapter<WithdrawalBean, BaseView
|
||||
@SuppressLint("ResourceType")
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, WithdrawalBean item) {
|
||||
if (item != null ) {
|
||||
TextView tv_status = helper.getView(R.id.tv_status);
|
||||
helper.setText(R.id.tv_time, item.getCreatetime());
|
||||
helper.setText(R.id.tv_name, item.getName());
|
||||
helper.setText(R.id.tv_jb, item.getMoney());
|
||||
tv_status.setText(item.getStatus_str());
|
||||
if (item.getStatus().equals("1")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_0DFFB9));
|
||||
}else if (item.getStatus().equals("2")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_FF999999));
|
||||
}else if (item.getStatus().equals("3")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_ff8acc));
|
||||
}else if (item.getStatus().equals("4")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_68A5FF));
|
||||
}else if (item.getStatus().equals("5")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_ff8acc));
|
||||
}else if (item.getStatus().equals("6")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_FF999999));
|
||||
}
|
||||
// 1. 基础文本设置(所有状态通用)
|
||||
helper.setText(R.id.tv_amount, TEXT_AMOUNT)
|
||||
.setText(R.id.tv_fee, TEXT_FEE)
|
||||
.setText(R.id.tv_tax, TEXT_TAX)
|
||||
.setText(R.id.tv_fee_value, item != null ? item.getWithdraw_fee() : "")
|
||||
.setText(R.id.tv_amount_value, item != null ? item.getMoney() : "")
|
||||
.setText(R.id.tv_expected_value, item != null ? item.getSurplus_money() : "")
|
||||
.setText(R.id.tv_time, item != null ? item.getCreatetime() : "");
|
||||
|
||||
TextView tvStatus = helper.getView(R.id.tv_status);
|
||||
tvStatus.setText(item != null ? item.getStatus_str() : "");
|
||||
|
||||
// 2. 处理item为空的边界情况
|
||||
if (item == null) {
|
||||
clearStatusUI(helper);
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. 根据状态设置UI(使用switch替代多层if-else)
|
||||
switch (item.getStatus()) {
|
||||
case STATUS_PENDING:
|
||||
setStatusUI(helper,
|
||||
com.xscm.moduleutil.R.mipmap.dcl, // im_x图标
|
||||
com.xscm.moduleutil.R.color.color_0DFFB9, // 状态文本颜色
|
||||
TEXT_EXPECTED_DEFAULT, // 预计到账文本
|
||||
TEXT_TAX_CALCULATING, // 个税文本
|
||||
com.xscm.moduleutil.R.color.color_black); // 预计值颜色
|
||||
break;
|
||||
case STATUS_APPROVED:
|
||||
setStatusUI(helper,
|
||||
com.xscm.moduleutil.R.mipmap.dcl2,
|
||||
com.xscm.moduleutil.R.color.color_999999,
|
||||
TEXT_EXPECTED_DEFAULT,
|
||||
TEXT_TAX_CALCULATING,
|
||||
com.xscm.moduleutil.R.color.color_black);
|
||||
break;
|
||||
case STATUS_REJECTED:
|
||||
setStatusUI(helper,
|
||||
com.xscm.moduleutil.R.mipmap.dcl3,
|
||||
com.xscm.moduleutil.R.color.color_ff8acc,
|
||||
TEXT_EXPECTED_REFUND,
|
||||
item.getReceived_tax_amount(),
|
||||
com.xscm.moduleutil.R.color.color_black);
|
||||
break;
|
||||
case STATUS_PAYING:
|
||||
setStatusUI(helper,
|
||||
com.xscm.moduleutil.R.mipmap.dcl4,
|
||||
com.xscm.moduleutil.R.color.color_68A5FF,
|
||||
TEXT_EXPECTED_DEFAULT,
|
||||
TEXT_TAX_CALCULATING,
|
||||
com.xscm.moduleutil.R.color.color_black);
|
||||
break;
|
||||
case STATUS_PAY_FAILED:
|
||||
setStatusUI(helper,
|
||||
com.xscm.moduleutil.R.mipmap.dcl5,
|
||||
com.xscm.moduleutil.R.color.color_ff8acc,
|
||||
TEXT_EXPECTED_REFUND,
|
||||
item.getReceived_tax_amount(),
|
||||
com.xscm.moduleutil.R.color.color_black);
|
||||
break;
|
||||
case STATUS_PAID:
|
||||
setStatusUI(helper,
|
||||
com.xscm.moduleutil.R.mipmap.dcl6,
|
||||
com.xscm.moduleutil.R.color.color_999999,
|
||||
TEXT_EXPECTED_ACTUAL,
|
||||
item.getReceived_tax_amount(),
|
||||
com.xscm.moduleutil.R.color.color_2ADB88);
|
||||
break;
|
||||
default:
|
||||
// 未知状态处理
|
||||
setStatusUI(helper,
|
||||
0, // 空图标
|
||||
com.xscm.moduleutil.R.color.color_999999,
|
||||
"", "", com.xscm.moduleutil.R.color.color_black);
|
||||
tvStatus.setText("未知状态");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 封装状态相关UI设置(消除重复代码)
|
||||
*
|
||||
* @param helper ViewHolder
|
||||
* @param imXRes im_x的图标资源
|
||||
* @param statusTextColor 状态文本颜色
|
||||
* @param expectedText 预计到账文本
|
||||
* @param taxValue 个税文本
|
||||
* @param expectedValueColor 预计值文本颜色
|
||||
*/
|
||||
private void setStatusUI(BaseViewHolder helper, int imXRes, int statusTextColor,
|
||||
String expectedText, String taxValue, int expectedValueColor) {
|
||||
Context context = helper.itemView.getContext(); // 从itemView获取上下文,更可靠
|
||||
|
||||
// 设置im_x图标
|
||||
if (imXRes != 0) {
|
||||
helper.setBackgroundRes(R.id.im_x, imXRes);
|
||||
}
|
||||
|
||||
// 设置状态文本颜色(使用ContextCompat兼容低版本)
|
||||
TextView tvStatus = helper.getView(R.id.tv_status);
|
||||
tvStatus.setTextColor(ContextCompat.getColor(context, statusTextColor));
|
||||
|
||||
// 设置其他文本
|
||||
helper.setText(R.id.tv_expected, expectedText)
|
||||
.setText(R.id.tv_tax_value, taxValue)
|
||||
.setTextColor(R.id.tv_expected_value, ContextCompat.getColor(context, expectedValueColor));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空状态相关UI(处理item为null的情况)
|
||||
*/
|
||||
private void clearStatusUI(BaseViewHolder helper) {
|
||||
helper.setBackgroundRes(R.id.im_x, 0)
|
||||
.setText(R.id.tv_expected, "")
|
||||
.setText(R.id.tv_tax_value, "")
|
||||
.setTextColor(R.id.tv_expected_value, ContextCompat.getColor(helper.itemView.getContext(), com.xscm.moduleutil.R.color.color_black));
|
||||
|
||||
TextView tvStatus = helper.getView(R.id.tv_status);
|
||||
tvStatus.setTextColor(ContextCompat.getColor(helper.itemView.getContext(), com.xscm.moduleutil.R.color.color_999999));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
@@ -18,74 +18,91 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_bar"
|
||||
>
|
||||
<LinearLayout
|
||||
android:id="@+id/rl3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:background="@drawable/bg_r5_e9e9"
|
||||
android:gravity="center">
|
||||
android:layout_height="@dimen/dp_38"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/bg_r5_e9e9"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_bar">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:text="开始日期"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.2"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
|
||||
android:paddingTop="@dimen/dp_3"
|
||||
android:src="@mipmap/data1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv22"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="结束日期"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.2"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:src="@mipmap/data2" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/revenue_view"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/tv2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@color/color_FFF5F5F5"
|
||||
android:orientation="vertical"
|
||||
tools:listitem="@layout/item_revenue" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_weight="1"
|
||||
android:text="开始日期"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</layout>
|
||||
<ImageView
|
||||
android:id="@+id/iv1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="0.2"
|
||||
|
||||
android:paddingTop="@dimen/dp_3"
|
||||
android:src="@mipmap/data1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv22"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
android:text="结束日期"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="0.2"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:src="@mipmap/data2" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl3"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/revenue_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@color/color_FFF5F5F5"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:listitem="@layout/item_revenue" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
@@ -1,153 +1,164 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_x"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@mipmap/dcl"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
app:layout_constraintBottom_toBottomOf="@+id/cl_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/cl_bg"
|
||||
android:id="@+id/im_x"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/cl_bg" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:id="@+id/cl_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<!-- 提现金额 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_amount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_21"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:textColor="@color/color_FF333333"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/im_x"
|
||||
tools:text="提现金额"/>
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:id="@+id/tv_amount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_21"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_14"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="提现金额" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_amount_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:textColor="@color/color_ff2727"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_amount"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="142.12"/>
|
||||
android:id="@+id/tv_amount_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:textColor="@color/color_ff2727"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_amount"
|
||||
tools:text="142.12" />
|
||||
|
||||
<!-- 手续费 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_fee"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_amount"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_amount"
|
||||
tools:text="手续费"/>
|
||||
android:id="@+id/tv_fee"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_amount"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_amount"
|
||||
tools:text="手续费" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_fee_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_amount_value"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_fee"
|
||||
tools:text="3.21"/>
|
||||
android:id="@+id/tv_fee_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_amount_value"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_fee"
|
||||
tools:text="3.21" />
|
||||
|
||||
<!-- 个人所得税 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_tax"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_fee"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_fee"
|
||||
tools:text="个人所得税"/>
|
||||
android:id="@+id/tv_tax"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_fee"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_fee"
|
||||
tools:text="个人所得税" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tax_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_666666"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_fee_value"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_tax"
|
||||
tools:text="计算中..."/>
|
||||
android:id="@+id/tv_tax_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_fee_value"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_tax"
|
||||
tools:text="计算中..." />
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:background="#F1F2F3"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_tax"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_tax"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_tax_value"
|
||||
android:layout_marginTop="@dimen/dp_12"/>
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:layout_marginStart="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:background="#F1F2F3"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_tax_value"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_tax"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_tax" />
|
||||
|
||||
<!-- 预计到账 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_expected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
app:layout_constraintTop_toBottomOf="@id/view"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_tax"
|
||||
android:id="@+id/tv_expected"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_tax"
|
||||
app:layout_constraintTop_toBottomOf="@id/view"
|
||||
|
||||
tools:text="预计到账(个税扣除前)"/>
|
||||
tools:text="预计到账(个税扣除前)" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_expected_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textColor="@color/color_ff2727"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_expected"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="138.91"/>
|
||||
|
||||
android:id="@+id/tv_expected_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:textColor="@color/color_black"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_expected"
|
||||
tools:text="138.91" />
|
||||
|
||||
<!-- 时间 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_expected"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_expected"
|
||||
tools:text="2024.12.14 11:21:45"/>
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_7"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_expected"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_expected"
|
||||
tools:text="2024.12.14 11:21:45" />
|
||||
|
||||
<!-- 状态 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textColor="#0DFFB9"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_time"
|
||||
tools:text="待处理"/>
|
||||
|
||||
|
||||
android:id="@+id/tv_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:textColor="#0DFFB9"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_time"
|
||||
tools:text="待处理" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
35
modulevocal/src/main/res/layout/layout_empty_no.xml
Normal file
35
modulevocal/src/main/res/layout/layout_empty_no.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/layout_empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@mipmap/common_img_empty" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_empty_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="暂无数据"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -42,6 +42,7 @@ import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.stx.xhb.xbanner.XBanner;
|
||||
import com.xscm.moduleutil.utils.logger.DataLogger;
|
||||
import com.zhpan.bannerview.constants.PageStyle;
|
||||
import com.zhpan.bannerview.utils.BannerUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Logger;
|
||||
@@ -141,7 +142,7 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
carouselBannerAdapter = new CarouselBannerAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(15)
|
||||
.setRevealWidth(250, 250)
|
||||
.setRevealWidth(BannerUtils.dp2px(90), BannerUtils.dp2px(90))
|
||||
.setAdapter(carouselBannerAdapter)
|
||||
.create();
|
||||
// mBinding.bannerViewPager
|
||||
|
||||
Reference in New Issue
Block a user