消费记录

This commit is contained in:
18401019693
2023-10-20 15:31:52 +08:00
parent 4ff1089549
commit dff84a30e4
31 changed files with 1223 additions and 14 deletions

View File

@@ -0,0 +1,58 @@
package com.shayu.onetoone.activity;
import android.graphics.Color;
import android.os.Bundle;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.shayu.onetoone.R;
import com.shayu.onetoone.adapter.DiamondExchangeAdapter;
import com.shayu.onetoone.bean.ExchangeModel;
import com.shayu.onetoone.manager.OTONetManager;
import com.shayu.onetoone.manager.RouteManager;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.utils.ToastUtil;
import java.util.List;
@Route(path = RouteManager.ACTIVITY_DIAMOND_EXCHANGE)
public class DiamondExchangeActivity extends AbsOTOActivity {
private RecyclerView diamondExchangeList;
private DiamondExchangeAdapter exchangeAdapter;
@Override
protected int getLayoutId() {
return R.layout.activity_diamond_exchange;
}
@Override
protected void main(Bundle savedInstanceState) {
initView();
initData();
}
private void initView() {
diamondExchangeList = findViewById(R.id.diamond_exchange_list);
diamondExchangeList.addItemDecoration(new ItemDecoration(mContext, Color.parseColor("#ffffff"), 10, 2));
diamondExchangeList.setLayoutManager(new GridLayoutManager(mContext, 3));
exchangeAdapter = new DiamondExchangeAdapter();
diamondExchangeList.setAdapter(exchangeAdapter);
}
private void initData() {
OTONetManager.getInstance(mContext).getExchangeList("yuanbao", new HttpCallback<List<ExchangeModel>>() {
@Override
public void onSuccess(List<ExchangeModel> data) {
exchangeAdapter.addData(data);
}
@Override
public void onError(String error) {
ToastUtil.show(error);
}
});
}
}