1:完成我的家族功能
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/27 16:47
|
||||
* 用途:
|
||||
*/
|
||||
class FamilyEarnings {
|
||||
|
||||
var id: Int=0
|
||||
var nickname: String=""
|
||||
var avatar: String=""
|
||||
var user_code: String=""
|
||||
var earnings: String=""
|
||||
var createtime: Long=0
|
||||
var gift_name: String=""
|
||||
var gift_price: String=""
|
||||
|
||||
/* id 列表 id
|
||||
|
||||
nickname 用户昵称
|
||||
|
||||
avatar
|
||||
|
||||
user_code
|
||||
|
||||
earnings 收益
|
||||
createtime
|
||||
|
||||
gift_name 礼物名称
|
||||
|
||||
gift_price 礼物价格*/
|
||||
|
||||
}
|
||||
@@ -40,6 +40,7 @@ public class GiftBoxBean {
|
||||
private List<DailyTasksBean> daily_tasks;
|
||||
private List<DailyTasksBean> daily_tasks_special;
|
||||
private List<DailyTasksBean> usual_tasks;
|
||||
private List<DailyTasksBean> teacher_tasks;
|
||||
|
||||
@Data
|
||||
public static class DailyTasksBean {
|
||||
@@ -54,6 +55,7 @@ public class GiftBoxBean {
|
||||
private int processing_type;//跳转状态:
|
||||
private String processing_type_str;//跳转状态
|
||||
private String from_id;
|
||||
private int reward_type;//1:金币 2:钻石
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/26 18:45
|
||||
* 用途:
|
||||
*/
|
||||
class MyFamilyBean {
|
||||
var group_id: String = "" //群组id
|
||||
var name: String = "" //家族名称
|
||||
var user_id: Int = 0 //族长id
|
||||
var group_members_num: Int = 0 //签约次数 群组人数
|
||||
var group_earnings: String = "" //总计收益
|
||||
|
||||
var group_owner_info: GroupOwnerInfoBean? = null //族长信息
|
||||
|
||||
class GroupOwnerInfoBean {
|
||||
|
||||
var nickname: String = "" //昵称
|
||||
var avatar: String = "" //头像
|
||||
var dress: String = "" //头像框
|
||||
var user_code: String = "" //用户id
|
||||
var icon: List<String> = arrayListOf()
|
||||
var mic_cycle: String = "" //麦圈
|
||||
var nobility_image: String = "" //贵族
|
||||
var nickname_color: String = "" //贵族颜色
|
||||
}
|
||||
|
||||
var group_members_lists: List<GroupMembersListsBean> = arrayListOf() //
|
||||
|
||||
class GroupMembersListsBean{
|
||||
var market_value: String = "" //身价
|
||||
var nickname: String = ""
|
||||
var avatar: String = ""
|
||||
var user_code: String = ""
|
||||
var user_id: Int = 0
|
||||
var end_time: Long = 0 //签约到期时间点
|
||||
var dress: String = ""
|
||||
var icon: List<String> = arrayListOf()
|
||||
var mic_cycle: String = "" //麦圈
|
||||
var nobility_image: String = "" //贵族
|
||||
var nickname_color: String = "" //贵族颜色
|
||||
var free_renewal: String = "" //免费续签次数
|
||||
var today_earnings: String = "" //今日收礼收益
|
||||
var yesterday_earnings: String = "" //昨日收礼收益
|
||||
var is_online: Int = 0 //是否在线 1在线 0离线
|
||||
var is_show_sign: Int = 0 //是否显示续约按钮 1:显示 0:不显示
|
||||
|
||||
var sign_times: Int = 0 //非首签签约时长
|
||||
var sign_user_ratio : Int = 0 //非首签签约比例
|
||||
var end_day: String = "" //签约剩余时长
|
||||
|
||||
}
|
||||
|
||||
/* "group_id": "string",
|
||||
"name": "string",
|
||||
"user_id": "string",
|
||||
"group_members_num": "string",
|
||||
"group_earnings": "string",
|
||||
"group_owner_info": {
|
||||
"nickname": "string",
|
||||
"avatar": "string",
|
||||
"dress": "string",
|
||||
"user_code": "string",
|
||||
"icon": [
|
||||
"string"
|
||||
],
|
||||
"mic_cycle": "string",
|
||||
"nobility_image": "string",
|
||||
"nickname_color": "string"
|
||||
},
|
||||
"group_members_lists": [
|
||||
{
|
||||
"market_value": "string",
|
||||
"nickname": "string",
|
||||
"avatar": "string",
|
||||
"user_code": "string",
|
||||
"user_id": "string",
|
||||
"end_time": "string",
|
||||
"dress": "string",
|
||||
"icon": [
|
||||
"string"
|
||||
],
|
||||
"mic_cycle": "string",
|
||||
"nobility_image": "string",
|
||||
"nickname_color": "string",
|
||||
"free_renewal": "string",
|
||||
"today_earnings": "string",
|
||||
"yesterday_earnings": "string"
|
||||
}
|
||||
]
|
||||
}*/
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
private int singer_status;//歌手认证状态0-待审核,1-通过,2-拒绝 -1:未认证
|
||||
private int singer_level;//歌手等级
|
||||
private CpInfo cp_info;
|
||||
|
||||
private int market_value;//身价
|
||||
|
||||
/*"cp_info": {
|
||||
"name": "string",
|
||||
@@ -116,7 +116,7 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
if(!name.isEmpty()) {
|
||||
if (!name.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
@@ -129,6 +129,7 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
public String avatar;
|
||||
public String dress;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class UserInfo2 implements Serializable {
|
||||
public String user_id;
|
||||
|
||||
@@ -859,4 +859,15 @@ public interface ApiServer {
|
||||
@GET(Constants.GET_CP_ZONE)
|
||||
Call<BaseModel<HeartCpBean>> getCpRoom(@Query("user_id") String userId);
|
||||
|
||||
|
||||
@GET(Constants.POST_MY_FAMILY)
|
||||
Call<BaseModel<MyFamilyBean>> myFamily();
|
||||
|
||||
@GET(Constants.POST_MY_JOIN_FAMILY)
|
||||
Call<BaseModel<MyFamilyBean>> myJoinFamily();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_FAMILY_EARNINGS)
|
||||
Call<BaseModel<List<FamilyEarnings>>> familyEarnings( @Field("user_id") String user_id,@Field("page") int page,@Field("start_time") String start_time,@Field("end_time") String end_time);
|
||||
|
||||
}
|
||||
|
||||
@@ -4194,8 +4194,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void onNextRetu
|
||||
(Response<BaseModel<String>> response, BaseObserver<String> observer) {
|
||||
public void onNextRetu(Response<BaseModel<String>> response, BaseObserver<String> observer) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<String> string = response.body();
|
||||
if (string != null) {
|
||||
@@ -4582,5 +4581,90 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void myFamily(int type,BaseObserver<MyFamilyBean> observer) {
|
||||
if (type==1) {
|
||||
sApiServer.myFamily().enqueue(new Callback<BaseModel<MyFamilyBean>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<MyFamilyBean>> call, Response<BaseModel<MyFamilyBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<MyFamilyBean> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1) {
|
||||
observer.onNext(baseModel.getData()!=null ? baseModel.getData() : new MyFamilyBean());
|
||||
} else if (baseModel.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<MyFamilyBean>> call, Throwable t) {
|
||||
LogUtils.e("myFamily", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}else {
|
||||
sApiServer.myJoinFamily().enqueue(new Callback<BaseModel<MyFamilyBean>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<MyFamilyBean>> call, Response<BaseModel<MyFamilyBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<MyFamilyBean> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1) {
|
||||
observer.onNext(baseModel.getData()!=null ? baseModel.getData() : new MyFamilyBean());
|
||||
} else if (baseModel.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
}
|
||||
} else {
|
||||
observer.onNext(new MyFamilyBean());
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<MyFamilyBean>> call, Throwable t) {
|
||||
LogUtils.e("myJoinFamily", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void familyEarnings(String user_id,int page,String start_time,String end_time,BaseObserver<List<FamilyEarnings>> observer) {
|
||||
sApiServer.familyEarnings(user_id,page,start_time,end_time).enqueue(new Callback<BaseModel<List<FamilyEarnings>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<FamilyEarnings>>> call, Response<BaseModel<List<FamilyEarnings>>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<FamilyEarnings>> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1) {
|
||||
observer.onNext(baseModel.getData()!=null?baseModel.getData():new ArrayList<FamilyEarnings>());
|
||||
} else if (baseModel.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<FamilyEarnings>>> call, Throwable t) {
|
||||
LogUtils.e("familyEarnings", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -280,6 +280,9 @@ public class Constants {
|
||||
public static final String GET_ROOM_GIFT = "/api/Room/room_give_gift";//直播间送礼
|
||||
public static final String POST_CP_GIVE_GIFT = "/api/UserCp/cpGiveGift";//用户CP礼物回赠
|
||||
public static final String GET_CP_ZONE = "/api/UserCp/cpZone";//心动空间
|
||||
public static final String POST_MY_FAMILY = "/api/Family/myFamily";//我的家族
|
||||
public static final String POST_MY_JOIN_FAMILY = "/api/Family/myJoinFamily";//我加入的家族
|
||||
public static final String POST_FAMILY_EARNINGS = "/api/Family/familyEarnings";//家族收益详情
|
||||
public static final String GET_ROOM_USER = "/api/Room/room_user_home";//房间内点击头像
|
||||
public static final String APPLY_PIT = "/api/RoomPit/apply_pit";//申请上麦
|
||||
public static final String DOWN_PIT = "/api/RoomPit/down_pit";//下麦
|
||||
|
||||
@@ -106,29 +106,34 @@ public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, Act
|
||||
mBinding.rvTaskToday.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
|
||||
List<TaskItem> sections = new ArrayList<>();
|
||||
// 每日任务
|
||||
// 每日任务
|
||||
sections.add(new TaskItem("今日任务", giftBoxBean.getTasks().getDaily_tasks()));
|
||||
// 特殊任务
|
||||
sections.add(new TaskItem("特殊任务", giftBoxBean.getTasks().getDaily_tasks_special()));
|
||||
// 平台任务
|
||||
// 特殊任务
|
||||
sections.add(new TaskItem("特殊任务", giftBoxBean.getTasks().getDaily_tasks_special()));//
|
||||
// 师徒任务
|
||||
if (giftBoxBean.getTasks().getTeacher_tasks() != null && giftBoxBean.getTasks().getTeacher_tasks().size() > 0) {
|
||||
sections.add(new TaskItem("师徒任务", giftBoxBean.getTasks().getTeacher_tasks()));
|
||||
}
|
||||
|
||||
// 平台任务
|
||||
sections.add(new TaskItem("平台任务", giftBoxBean.getTasks().getUsual_tasks()));
|
||||
mTaskDataAdapter = new TaskSectionAdapter(sections);
|
||||
mBinding.rvTaskToday.setAdapter(mTaskDataAdapter);
|
||||
mTaskDataAdapter.setOnItemClickListener(new TaskSectionAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(TaskItem taskItem, GiftBoxBean.TaskDataBean.DailyTasksBean item) {
|
||||
if (taskItem.getTitle().equals("今日任务") || taskItem.getTitle().equals("平台任务")) {
|
||||
if (item.getTask_status()==2) {
|
||||
if (taskItem.getTitle().equals("今日任务") || taskItem.getTitle().equals("平台任务") || taskItem.getTitle().equals("师徒任务")) {
|
||||
if (item.getTask_status() == 2) {
|
||||
MvpPre.dailyTasksReceive(item.getTask_id() + "");
|
||||
}
|
||||
} else {
|
||||
if (item.getTask_status() == 2){
|
||||
if (item.getTask_status() == 2) {
|
||||
MvpPre.dailyTasksReceive(item.getTask_id() + "");
|
||||
}else if (item.getTask_status() == 1) {
|
||||
} else if (item.getTask_status() == 1) {
|
||||
mBinding.coolWaitView.setVisibility(View.VISIBLE);
|
||||
// if (item.getTask_id() == 9) {
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(DailyTasksActivity.this, item.getFrom_id(), "", item.getTask_id() + "");
|
||||
finish();
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(DailyTasksActivity.this, item.getFrom_id(), "", item.getTask_id() + "");
|
||||
finish();
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("roomId", item.getFrom_id()).withString("taskId", item.getTask_id() + "").navigation();
|
||||
// } else {
|
||||
// RoomManager.getInstance().fetchRoomDataAndEnter(DailyTasksActivity.this, item.getFrom_id(), "", item.getTask_id() + "");
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
package com.xscm.modulemain.activity.user.activity
|
||||
|
||||
import android.util.Log
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener
|
||||
import com.xscm.modulemain.BaseMvpActivity
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.conacts.UserFamilyConacts
|
||||
import com.xscm.modulemain.activity.user.presenter.UserFamilyPresenter
|
||||
import com.xscm.modulemain.adapter.TotalRevenueAdapter
|
||||
import com.xscm.modulemain.databinding.ActivityTotalRevenueBinding
|
||||
import com.xscm.moduleutil.bean.FamilyEarnings
|
||||
import com.xscm.moduleutil.bean.MyFamilyBean
|
||||
import com.xscm.moduleutil.widget.CommonEmptyView
|
||||
import com.xscm.moduleutil.widget.DoubleTimePickerBottomSheet
|
||||
import com.xscm.moduleutil.widget.DoubleTimePickerBottomSheet.OnTimeRangeSelectedListener
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -19,37 +25,119 @@ import java.util.Locale
|
||||
*/
|
||||
class TotalRevenueActivity : BaseMvpActivity<UserFamilyPresenter, ActivityTotalRevenueBinding>(),
|
||||
UserFamilyConacts.View {
|
||||
|
||||
var page = 1
|
||||
var type = "1"
|
||||
var revenueType = "1"
|
||||
private var page = 1
|
||||
private var userId: Int = 0
|
||||
private var adapter: TotalRevenueAdapter? = null
|
||||
override fun bindPresenter(): UserFamilyPresenter? {
|
||||
return UserFamilyPresenter(this, this)
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
super.initView()
|
||||
userId = intent.getIntExtra("userId",0)
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
mBinding.topBar.tvTitle.text = "总收益"
|
||||
|
||||
MvpPre?.familyEarnings(
|
||||
userId.toString(),
|
||||
page,
|
||||
mBinding.tv2.text.toString(),
|
||||
mBinding.tv22.text.toString())
|
||||
|
||||
adapter= TotalRevenueAdapter()
|
||||
mBinding.totalView.adapter = adapter
|
||||
val commonEmptyView = CommonEmptyView(this)
|
||||
commonEmptyView.setImg(R.mipmap.ic_empty)
|
||||
commonEmptyView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FFBDBDBC))
|
||||
adapter?.bindToRecyclerView(mBinding.totalView)
|
||||
adapter?.setEmptyView(commonEmptyView)
|
||||
|
||||
mBinding.rl3.setOnClickListener({ v ->
|
||||
val dialog = DoubleTimePickerBottomSheet()
|
||||
dialog.setOnTimeRangeSelectedListener(OnTimeRangeSelectedListener { startDate: Date?, endDate: Date? ->
|
||||
// 处理选择的时间范围
|
||||
val sdf = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
||||
val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
|
||||
Log.d("SelectedTime", "开始时间:" + sdf.format(startDate))
|
||||
mBinding.tv2.setText(sdf.format(startDate))
|
||||
Log.d("SelectedTime", "结束时间:" + sdf.format(endDate))
|
||||
mBinding.tv22.setText(sdf.format(endDate))
|
||||
page = 1
|
||||
|
||||
MvpPre?.familyEarnings(
|
||||
userId.toString(),
|
||||
page,
|
||||
mBinding.tv2.text.toString(),
|
||||
mBinding.tv22.text.toString()
|
||||
)
|
||||
})
|
||||
val fragmentManager = supportFragmentManager
|
||||
|
||||
dialog.show(fragmentManager,"DoubleTimePickerBottomSheet")
|
||||
dialog.show(fragmentManager, "DoubleTimePickerBottomSheet")
|
||||
})
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(object :OnRefreshLoadMoreListener{
|
||||
override fun onRefresh(refreshLayout: RefreshLayout) {
|
||||
page++
|
||||
MvpPre?.familyEarnings(
|
||||
userId.toString(),
|
||||
page,
|
||||
mBinding.tv2.text.toString(),
|
||||
mBinding.tv22.text.toString()
|
||||
)
|
||||
}
|
||||
|
||||
override fun onLoadMore(refreshLayout: RefreshLayout) {
|
||||
page = 1 // 重置页码
|
||||
MvpPre?.familyEarnings(
|
||||
userId.toString(),
|
||||
page,
|
||||
mBinding.tv2.text.toString(),
|
||||
mBinding.tv22.text.toString()
|
||||
)
|
||||
}
|
||||
|
||||
} )
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.activity_total_revenue
|
||||
}
|
||||
|
||||
override fun myFamily(data: MyFamilyBean) {
|
||||
}
|
||||
|
||||
override fun familyEarnings(data: List<FamilyEarnings>) {
|
||||
mBinding.smartRefreshLayout.finishRefresh()
|
||||
mBinding.smartRefreshLayout.finishLoadMore()
|
||||
// 检查数据是否为空
|
||||
if (data.isEmpty()) {
|
||||
return
|
||||
}
|
||||
|
||||
adapter?.let { adapter ->
|
||||
when {
|
||||
// 第一页数据为空
|
||||
page == 1 && data.isEmpty() -> {
|
||||
}
|
||||
// 第一页有数据
|
||||
page == 1 && data.isNotEmpty() -> {
|
||||
adapter.setNewData(data)
|
||||
}
|
||||
// 非第一页数据为空(没有更多数据)
|
||||
page > 1 && data.isEmpty() -> {
|
||||
// 显示没有更多数据的提示
|
||||
// 设置一个特殊的空视图,表示没有更多数据
|
||||
// 重要:page--,因为这次加载没有新数据
|
||||
page--
|
||||
}
|
||||
// 非第一页有数据
|
||||
else -> {
|
||||
adapter.addData(data)
|
||||
}
|
||||
}
|
||||
// 通知数据更新
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,29 +2,38 @@ package com.xscm.modulemain.activity.user.activity
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.ImageView
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import com.xscm.modulemain.BaseMvpActivity
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.conacts.UserFamilyConacts
|
||||
import com.xscm.modulemain.activity.user.fragment.MyFamilyFragment
|
||||
import com.xscm.modulemain.activity.user.fragment.JoinedFamilyFragment
|
||||
import com.xscm.modulemain.activity.user.presenter.UserFamilyPresenter
|
||||
import com.xscm.modulemain.adapter.FamilyPagerAdapter
|
||||
import com.xscm.modulemain.databinding.ActivityUserFamilyBinding
|
||||
import com.xscm.moduleutil.bean.FamilyEarnings
|
||||
import com.xscm.moduleutil.bean.MyFamilyBean
|
||||
|
||||
/**
|
||||
* @Author qx
|
||||
* @Time 2025/11/25 17:11
|
||||
* @Description 我的家族
|
||||
*/
|
||||
* @Author qx
|
||||
* @Time 2025/11/25 17:11
|
||||
* @Description 我的家族
|
||||
*/
|
||||
class UserFamilyActivity : BaseMvpActivity<UserFamilyPresenter, ActivityUserFamilyBinding>(),
|
||||
UserFamilyConacts.View {
|
||||
|
||||
private lateinit var mAdapter: FamilyPagerAdapter
|
||||
private var myFamilyFragment: MyFamilyFragment? = null
|
||||
private var joinedFamilyFragment: JoinedFamilyFragment? = null
|
||||
private var familyPagerAdapter: FamilyPagerAdapter? = null
|
||||
var type: Int = 1
|
||||
|
||||
override fun bindPresenter(): UserFamilyPresenter? {
|
||||
return UserFamilyPresenter(this,this)
|
||||
return UserFamilyPresenter(this, this)
|
||||
}
|
||||
|
||||
override fun doDone() {
|
||||
@@ -40,46 +49,40 @@ class UserFamilyActivity : BaseMvpActivity<UserFamilyPresenter, ActivityUserFami
|
||||
mBinding.topBar.setColor(getResources().getColor(R.color.white))
|
||||
setupViewPager()
|
||||
setupTabLayout()
|
||||
}
|
||||
|
||||
// 初始加载第一个tab的数据
|
||||
MvpPre?.myFamily(type)
|
||||
}
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.activity_user_family
|
||||
return R.layout.activity_user_family
|
||||
}
|
||||
|
||||
private fun setupViewPager() {
|
||||
mAdapter = FamilyPagerAdapter(this)
|
||||
mBinding.viewPager.adapter = mAdapter
|
||||
// 初始化Fragment
|
||||
myFamilyFragment = MyFamilyFragment(MyFamilyBean())
|
||||
joinedFamilyFragment = JoinedFamilyFragment(MyFamilyBean())
|
||||
|
||||
// 设置ViewPager适配器
|
||||
familyPagerAdapter = FamilyPagerAdapter(this)
|
||||
familyPagerAdapter?.addFragment(myFamilyFragment!!)
|
||||
familyPagerAdapter?.addFragment(joinedFamilyFragment!!)
|
||||
|
||||
mBinding.viewPager.adapter = familyPagerAdapter
|
||||
|
||||
}
|
||||
|
||||
private fun setupTabLayout() {
|
||||
// 设置TabLayout的内部padding为0,确保tab与边框贴合
|
||||
|
||||
// 使用TabLayoutMediator将TabLayout与ViewPager2关联
|
||||
TabLayoutMediator(mBinding.tabLayout, mBinding.viewPager) { tab, position ->
|
||||
// 创建自定义Tab视图
|
||||
val customView = LayoutInflater.from(this).inflate(R.layout.custom_tab_family, null)
|
||||
val tabTitle = customView.findViewById<TextView>(R.id.tab_title)
|
||||
|
||||
when (position) {
|
||||
0 -> {
|
||||
tabTitle.text = "我的家族"
|
||||
}
|
||||
1 -> {
|
||||
tabTitle.text = "我加入的家族"
|
||||
}
|
||||
}
|
||||
|
||||
// 设置Tab的初始状态
|
||||
if (position == 0) {
|
||||
tabTitle.setBackgroundResource(R.mipmap.user_tab_bj)
|
||||
tabTitle.setTextColor(Color.BLACK)
|
||||
} else {
|
||||
tabTitle.setBackgroundResource(0)
|
||||
tabTitle.setTextColor(Color.WHITE)
|
||||
}
|
||||
|
||||
tab.customView = customView
|
||||
tab.customView = createTabView(
|
||||
when (position) {
|
||||
0 -> "我的家族"
|
||||
else -> "我加入的家族"
|
||||
},
|
||||
position == 0
|
||||
)
|
||||
}.attach()
|
||||
|
||||
// 设置Tab选中监听
|
||||
@@ -91,6 +94,18 @@ class UserFamilyActivity : BaseMvpActivity<UserFamilyPresenter, ActivityUserFami
|
||||
tabTitle.setTextColor(Color.BLACK)
|
||||
tabTitle.setBackgroundResource(R.mipmap.user_tab_bj)
|
||||
}
|
||||
|
||||
// 根据Tab位置加载数据
|
||||
when (tab.position) {
|
||||
0 -> {
|
||||
type = 1
|
||||
MvpPre?.myFamily(type)
|
||||
}
|
||||
1 -> {
|
||||
type = 2
|
||||
MvpPre?.myFamily(type)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTabUnselected(tab: TabLayout.Tab) {
|
||||
@@ -107,4 +122,64 @@ class UserFamilyActivity : BaseMvpActivity<UserFamilyPresenter, ActivityUserFami
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建Tab视图
|
||||
*/
|
||||
private fun createTabView(title: String, isSelected: Boolean): View {
|
||||
val customView = LayoutInflater.from(this).inflate(R.layout.custom_tab_family, null)
|
||||
val tabTitle = customView.findViewById<TextView>(R.id.tab_title)
|
||||
tabTitle.text = title
|
||||
|
||||
if (isSelected) {
|
||||
tabTitle.setBackgroundResource(R.mipmap.user_tab_bj)
|
||||
tabTitle.setTextColor(Color.BLACK)
|
||||
} else {
|
||||
tabTitle.setBackgroundResource(0)
|
||||
tabTitle.setTextColor(Color.WHITE)
|
||||
}
|
||||
|
||||
return customView
|
||||
}
|
||||
|
||||
/**
|
||||
* ViewPager2适配器
|
||||
*/
|
||||
inner class FamilyPagerAdapter(activity: FragmentActivity) : FragmentStateAdapter(activity) {
|
||||
private val fragments = mutableListOf<Fragment>()
|
||||
|
||||
fun addFragment(fragment: Fragment) {
|
||||
fragments.add(fragment)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = fragments.size
|
||||
|
||||
override fun createFragment(position: Int): Fragment = fragments[position]
|
||||
}
|
||||
|
||||
override fun myFamily(data: MyFamilyBean) {
|
||||
// 这个方法现在由Fragment处理,Activity通过FamilyDataCallback接收数据
|
||||
if (data.group_owner_info!=null ) {
|
||||
// 如果是"我的家族"数据,更新MyFamilyFragment
|
||||
if (type == 1) {
|
||||
myFamilyFragment?.setMyFamilyBean(data)
|
||||
}else{
|
||||
joinedFamilyFragment?.setMyFamilyBean(data)
|
||||
}
|
||||
// 如果是"我加入的家族"数据,可以在这里处理JoinedFamilyFragment的数据更新
|
||||
} else {
|
||||
// 如果是"我加入的家族"没有数据
|
||||
if (type == 2) {
|
||||
ToastUtils.showLong("您还没有加入任何家族")
|
||||
// 切换回"我的家族"tab
|
||||
mBinding.tabLayout.selectTab(mBinding.tabLayout.getTabAt(0))
|
||||
} else {
|
||||
ToastUtils.showLong("没有数据")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun familyEarnings(data: List<FamilyEarnings>) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.xscm.modulemain.activity.user.conacts
|
||||
|
||||
import android.R
|
||||
import android.app.Activity
|
||||
import com.xscm.moduleutil.activity.IPresenter
|
||||
import com.xscm.moduleutil.activity.IView
|
||||
import com.xscm.moduleutil.bean.FamilyEarnings
|
||||
import com.xscm.moduleutil.bean.MyFamilyBean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
@@ -11,10 +14,15 @@ import com.xscm.moduleutil.activity.IView
|
||||
*/
|
||||
class UserFamilyConacts {
|
||||
interface View : IView<Activity>{
|
||||
fun myFamily(data: MyFamilyBean)
|
||||
|
||||
fun familyEarnings(data: List<FamilyEarnings>)
|
||||
}
|
||||
|
||||
interface IPre : IPresenter {
|
||||
fun myFamily(type: Int) //1: 我的家族 2:我加入的家族
|
||||
|
||||
fun familyEarnings(user_id:String, page: Int, start_time: String, end_time: String)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,124 @@
|
||||
package com.xscm.modulemain.activity.user.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.tencent.imsdk.v2.V2TIMConversation
|
||||
import com.tencent.qcloud.tuicore.TUIConstants
|
||||
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIGroupChatActivity
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.activity.TotalRevenueActivity
|
||||
import com.xscm.modulemain.activity.user.activity.UserHomepageActivity
|
||||
import com.xscm.modulemain.adapter.MyFamilyAdapter
|
||||
import com.xscm.modulemain.databinding.FragmentJoinedFamilyBinding
|
||||
import com.xscm.moduleutil.base.BaseFragment
|
||||
import com.xscm.moduleutil.bean.MyFamilyBean
|
||||
import com.xscm.moduleutil.widget.CommonEmptyView
|
||||
|
||||
/**
|
||||
* @Author qx
|
||||
* @Time 2025/11/25 17:20
|
||||
* @Description 我加入的家族Fragment
|
||||
*/
|
||||
class JoinedFamilyFragment : Fragment() {
|
||||
|
||||
private var _binding: FragmentJoinedFamilyBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentJoinedFamilyBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
class JoinedFamilyFragment(var data: MyFamilyBean) : BaseFragment<FragmentJoinedFamilyBinding>() {
|
||||
private var dataList = mutableListOf<MyFamilyBean.GroupMembersListsBean>()
|
||||
private var adapter: MyFamilyAdapter? = null
|
||||
private var userId: Int = 0
|
||||
private var myFamilyBean : MyFamilyBean= MyFamilyBean()
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
myFamily1(data)
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
|
||||
mBinding.tvZsyNum2.setOnClickListener {
|
||||
val intent= Intent(activity, TotalRevenueActivity::class.java)
|
||||
intent.putExtra("userId",userId)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
mBinding.tvFamilyGroup.setOnClickListener {
|
||||
if (myFamilyBean.group_members_lists.isNotEmpty()) {
|
||||
val intent = Intent(activity, TUIGroupChatActivity::class.java)
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, myFamilyBean.group_id)
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_NAME, myFamilyBean.name)
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_GROUP)
|
||||
startActivity(intent)
|
||||
}else{
|
||||
ToastUtils.showLong("家族群至少需要签约一位徒弟")
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.headView.setOnClickListener { view ->
|
||||
val intent = Intent(activity, UserHomepageActivity::class.java)
|
||||
intent.putExtra("userId", myFamilyBean.user_id.toString())
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.fragment_joined_family
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(): JoinedFamilyFragment {
|
||||
return JoinedFamilyFragment()
|
||||
fun newInstance(data: MyFamilyBean): JoinedFamilyFragment {
|
||||
return JoinedFamilyFragment(data)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置数据
|
||||
*/
|
||||
fun setMyFamilyBean(myBean: MyFamilyBean) {
|
||||
this.myFamilyBean = myBean
|
||||
myFamily1(myBean)
|
||||
}
|
||||
|
||||
fun myFamily1(data: MyFamilyBean) {
|
||||
|
||||
myFamilyBean= data
|
||||
userId = data.user_id
|
||||
dataList.clear()
|
||||
dataList.addAll(data.group_members_lists)
|
||||
|
||||
mBinding.headView.setData(data.group_owner_info?.avatar,data.group_owner_info?.dress,data.group_owner_info?.nobility_image)
|
||||
mBinding.tvUserName.text = data.group_owner_info?.nickname
|
||||
if (data.group_owner_info?.nickname_color?.isNotEmpty()==true){
|
||||
mBinding.tvUserName.startColor = Color.parseColor(data.group_owner_info?.nickname_color)
|
||||
mBinding.tvUserName.shineColor = Color.parseColor(data.group_owner_info?.nickname_color)
|
||||
mBinding.tvUserName.endColor = Color.parseColor(data.group_owner_info?.nickname_color)
|
||||
mBinding.tvUserName.isShine = true
|
||||
mBinding.tvUserName.shineType = 0
|
||||
}
|
||||
|
||||
mBinding.tvUserId.setText("ID: ${data.group_owner_info?.user_code}")
|
||||
mBinding.tvZsyNum.text = data.group_earnings
|
||||
mBinding.tvSignNum.setText("群组人数:${data.group_members_num}")
|
||||
|
||||
adapter = MyFamilyAdapter(activity!!,userId, R.layout.item_family_members, dataList)
|
||||
mBinding.recyclerView.adapter = adapter
|
||||
val commonEmptyView = CommonEmptyView(activity!!)
|
||||
commonEmptyView.setImg(R.mipmap.ic_empty)
|
||||
commonEmptyView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FFBDBDBC))
|
||||
adapter?.bindToRecyclerView(mBinding.recyclerView)
|
||||
adapter?.setEmptyView(commonEmptyView)
|
||||
adapter?.setOnItemChildClickListener { adapter, view, position ->
|
||||
if (view.id == R.id.iv_head) {
|
||||
val item = dataList[position]
|
||||
val intent = Intent(activity, UserHomepageActivity::class.java)
|
||||
intent.putExtra("userId", item.user_id.toString() + "")
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
package com.xscm.modulemain.activity.user.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import com.blankj.utilcode.util.ActivityUtils
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.tencent.imsdk.v2.V2TIMConversation
|
||||
import com.tencent.qcloud.tuicore.TUIConstants
|
||||
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIGroupChatActivity
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.activity.HeartCpActivity
|
||||
import com.xscm.modulemain.activity.user.activity.TotalRevenueActivity
|
||||
import com.xscm.modulemain.activity.user.conacts.UserFamilyConacts
|
||||
import com.xscm.modulemain.activity.user.presenter.UserFamilyPresenter
|
||||
import com.xscm.modulemain.activity.user.activity.UserHomepageActivity
|
||||
import com.xscm.modulemain.adapter.MyFamilyAdapter
|
||||
import com.xscm.modulemain.databinding.FragmentMyFamilyBinding
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment
|
||||
import com.xscm.moduleutil.base.BaseFragment
|
||||
import com.xscm.moduleutil.bean.MyFamilyBean
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog
|
||||
import com.xscm.moduleutil.widget.CommonEmptyView
|
||||
|
||||
@@ -18,11 +24,12 @@ import com.xscm.moduleutil.widget.CommonEmptyView
|
||||
* @Time 2025/11/25 17:20
|
||||
* @Description 我的家族Fragment
|
||||
*/
|
||||
class MyFamilyFragment : BaseMvpFragment<UserFamilyPresenter, FragmentMyFamilyBinding>(), UserFamilyConacts.View {
|
||||
class MyFamilyFragment(var data: MyFamilyBean) : BaseFragment<FragmentMyFamilyBinding>() {
|
||||
|
||||
override fun bindPresenter(): UserFamilyPresenter? {
|
||||
return UserFamilyPresenter(this, activity!!)
|
||||
}
|
||||
private var dataList = mutableListOf<MyFamilyBean.GroupMembersListsBean>()
|
||||
private var adapter: MyFamilyAdapter? = null
|
||||
private var userId: Int = 0
|
||||
private var myFamilyBean : MyFamilyBean= MyFamilyBean()
|
||||
|
||||
|
||||
override fun onDestroyView() {
|
||||
@@ -30,19 +37,35 @@ class MyFamilyFragment : BaseMvpFragment<UserFamilyPresenter, FragmentMyFamilyBi
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
myFamily1(data)
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
mBinding.tvZsyNum2.setOnClickListener {
|
||||
val intent= Intent(activity, TotalRevenueActivity::class.java)
|
||||
intent.putExtra("userId",userId)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
val commonEmptyView = CommonEmptyView(getContext()!!)
|
||||
commonEmptyView.setImg(R.mipmap.ic_empty)
|
||||
commonEmptyView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FFBDBDBC))
|
||||
// manageAdapter.bindToRecyclerView(mBinding.recycleView)
|
||||
// manageAdapter.setEmptyView(commonEmptyView)
|
||||
mBinding.tvFamilyGroup.setOnClickListener {
|
||||
if (myFamilyBean.group_members_lists.isNotEmpty()) {
|
||||
val intent = Intent(activity, TUIGroupChatActivity::class.java)
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, myFamilyBean.group_id)
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_NAME, myFamilyBean.name)
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_GROUP)
|
||||
startActivity(intent)
|
||||
}else{
|
||||
ToastUtils.showLong("家族群至少需要签约一位徒弟")
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.headView.setOnClickListener { view ->
|
||||
val intent = Intent(activity, UserHomepageActivity::class.java)
|
||||
intent.putExtra("userId", myFamilyBean.user_id.toString())
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -50,17 +73,23 @@ class MyFamilyFragment : BaseMvpFragment<UserFamilyPresenter, FragmentMyFamilyBi
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(): MyFamilyFragment {
|
||||
return MyFamilyFragment()
|
||||
fun newInstance(data: MyFamilyBean): MyFamilyFragment {
|
||||
return MyFamilyFragment(data)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置数据
|
||||
*/
|
||||
fun setMyFamilyBean(myBean: MyFamilyBean) {
|
||||
this.myFamilyBean = myBean
|
||||
myFamily1(myBean)
|
||||
}
|
||||
|
||||
private fun queren1(
|
||||
type: Int,
|
||||
content: String?,
|
||||
giftid: String?,
|
||||
userId: String,
|
||||
roomId: String?
|
||||
) {
|
||||
// 创建并显示确认对话框
|
||||
ConfirmDialog(
|
||||
@@ -83,4 +112,44 @@ class MyFamilyFragment : BaseMvpFragment<UserFamilyPresenter, FragmentMyFamilyBi
|
||||
).show()
|
||||
}
|
||||
|
||||
fun myFamily1(data: MyFamilyBean) {
|
||||
|
||||
myFamilyBean= data
|
||||
userId = data.user_id
|
||||
dataList.clear()
|
||||
dataList.addAll(data.group_members_lists)
|
||||
|
||||
mBinding.headView.setData(data.group_owner_info?.avatar,data.group_owner_info?.dress,data.group_owner_info?.nobility_image)
|
||||
mBinding.tvUserName.text = data.group_owner_info?.nickname
|
||||
if (data.group_owner_info?.nickname_color?.isNotEmpty() == true){
|
||||
mBinding.tvUserName.startColor = Color.parseColor(data.group_owner_info?.nickname_color)
|
||||
mBinding.tvUserName.shineColor = Color.parseColor(data.group_owner_info?.nickname_color)
|
||||
mBinding.tvUserName.endColor = Color.parseColor(data.group_owner_info?.nickname_color)
|
||||
mBinding.tvUserName.isShine = true
|
||||
mBinding.tvUserName.shineType = 0
|
||||
}
|
||||
|
||||
mBinding.tvUserId.setText("ID: ${data.group_owner_info?.user_code}")
|
||||
mBinding.tvZsyNum.text = data.group_earnings
|
||||
mBinding.tvSignNum.setText("签约次数:${data.group_members_num}")
|
||||
|
||||
adapter = MyFamilyAdapter(activity!!,userId, R.layout.item_family_members, dataList)
|
||||
mBinding.recyclerView.adapter = adapter
|
||||
val commonEmptyView = CommonEmptyView(activity!!)
|
||||
commonEmptyView.setImg(R.mipmap.ic_empty)
|
||||
commonEmptyView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FFBDBDBC))
|
||||
adapter?.bindToRecyclerView(mBinding.recyclerView)
|
||||
adapter?.setEmptyView(commonEmptyView)
|
||||
adapter?.setOnItemChildClickListener { adapter, view, position ->
|
||||
if (view.id == R.id.tv_renew) {
|
||||
val item = dataList[position]
|
||||
queren1(1, "是否确认免费续约", item.user_id.toString())
|
||||
}else if (view.id == R.id.iv_head) {
|
||||
val item = dataList[position]
|
||||
val intent = Intent(activity, UserHomepageActivity::class.java)
|
||||
intent.putExtra("userId", item.user_id.toString())
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,54 @@ package com.xscm.modulemain.activity.user.presenter
|
||||
|
||||
import android.content.Context
|
||||
import com.xscm.modulemain.activity.user.conacts.UserFamilyConacts
|
||||
import com.xscm.moduleutil.bean.FamilyEarnings
|
||||
import com.xscm.moduleutil.bean.MyFamilyBean
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.presenter.BasePresenter
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/25 17:01
|
||||
* 用途:
|
||||
*/
|
||||
class UserFamilyPresenter (view: UserFamilyConacts.View,context: Context) : BasePresenter<UserFamilyConacts.View>(view,context), UserFamilyConacts.IPre{
|
||||
class UserFamilyPresenter(val view: UserFamilyConacts.View, context: Context) :
|
||||
BasePresenter<UserFamilyConacts.View>(view, context), UserFamilyConacts.IPre {
|
||||
override fun myFamily(type: Int) {
|
||||
api.myFamily(type, object : BaseObserver<MyFamilyBean>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(t: MyFamilyBean) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=WeakReference(view);
|
||||
}
|
||||
MvpRef.get()?.myFamily(t)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
override fun familyEarnings(
|
||||
user_id: String,
|
||||
page: Int,
|
||||
start_time:String,
|
||||
end_time:String
|
||||
) {
|
||||
api.familyEarnings(user_id, page, start_time, end_time, object : BaseObserver<MutableList<FamilyEarnings>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(t: MutableList<FamilyEarnings>) {
|
||||
if (MvpRef==null)
|
||||
MvpRef=WeakReference(view);
|
||||
MvpRef.get()?.familyEarnings(t)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import com.xscm.modulemain.activity.user.fragment.JoinedFamilyFragment
|
||||
import com.xscm.modulemain.activity.user.fragment.MyFamilyFragment
|
||||
|
||||
/**
|
||||
* @Author qx
|
||||
* @Time 2025/11/25 17:25
|
||||
* @Description 家族页面ViewPager2适配器
|
||||
*/
|
||||
class FamilyPagerAdapter(activity: FragmentActivity) : FragmentStateAdapter(activity) {
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return 2
|
||||
}
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return when (position) {
|
||||
0 -> MyFamilyFragment.newInstance()
|
||||
1 -> JoinedFamilyFragment.newInstance()
|
||||
else -> MyFamilyFragment.newInstance()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.google.android.flexbox.FlexboxLayout
|
||||
import com.xscm.modulemain.Application
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.MyFamilyBean
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.utils.MeHeadView
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
import com.xscm.moduleutil.widget.ShineTextView
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/27 9:23
|
||||
* 用途:
|
||||
*/
|
||||
class MyFamilyAdapter(
|
||||
val context: Context,var userId: Int, layoutId: Int, data: MutableList<MyFamilyBean.GroupMembersListsBean>?
|
||||
) :
|
||||
BaseQuickAdapter<MyFamilyBean.GroupMembersListsBean, BaseViewHolder>(layoutId, data) {
|
||||
|
||||
// 定义点击事件回调接口
|
||||
interface OnItemClickListener {
|
||||
fun onItemClick(position: Int, item: MyFamilyBean.GroupMembersListsBean)
|
||||
}
|
||||
|
||||
private var onItemClickListener: OnItemClickListener? = null
|
||||
|
||||
// 设置点击事件监听器
|
||||
fun setOnItemClickListener(listener: OnItemClickListener) {
|
||||
onItemClickListener = listener
|
||||
}
|
||||
override fun convert(
|
||||
helper: BaseViewHolder,
|
||||
item: MyFamilyBean.GroupMembersListsBean
|
||||
) {
|
||||
// 设置整个项的点击事件
|
||||
helper.itemView.setOnClickListener {
|
||||
val position = helper.adapterPosition
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
onItemClickListener?.onItemClick(position, item)
|
||||
}
|
||||
}
|
||||
var flex_entry: FlexboxLayout=helper.getView(R.id.flex_entry)
|
||||
var meHeadView : MeHeadView= helper.getView(R.id.iv_head)
|
||||
var tvName : ShineTextView =helper.getView(R.id.tv_name)
|
||||
meHeadView.setData(item.avatar,item.dress,item.nobility_image)
|
||||
// helper.setText(R.id.tv_name,item.nickname)
|
||||
helper.setText(R.id.tv_net_worth,item.market_value)
|
||||
if (item.is_online==1){
|
||||
helper.setImageResource(R.id.im_online, com.xscm.moduleutil.R.mipmap.members_online)
|
||||
}else{
|
||||
helper.setImageResource(R.id.im_online, com.xscm.moduleutil.R.mipmap.members_offline)
|
||||
}
|
||||
|
||||
helper.setText(R.id.tv_time, "剩余租期"+item.end_day)
|
||||
helper.setText(R.id.tv_num, "免费续约次数"+ item.free_renewal)
|
||||
|
||||
helper.setText(R.id.tv_today, item.today_earnings)
|
||||
helper.setText(R.id.tv_yesterday, item.yesterday_earnings)
|
||||
tvName.setText(item.nickname)
|
||||
if (item.nickname_color.isNotEmpty()){
|
||||
tvName.startColor = Color.parseColor(item.nickname_color)
|
||||
tvName.shineColor = Color.parseColor(item.nickname_color)
|
||||
tvName.endColor = Color.parseColor(item.nickname_color)
|
||||
tvName.isShine = true
|
||||
tvName.shineType = 0
|
||||
|
||||
}
|
||||
if (userId == SpUtil.getUserId()) {
|
||||
if (item.is_show_sign==0){
|
||||
helper.setGone(R.id.tv_renew,false)
|
||||
}else{
|
||||
helper.setGone(R.id.tv_renew,true)
|
||||
}
|
||||
}
|
||||
|
||||
if (item.icon.isNotEmpty()) {
|
||||
flex_entry.isVisible=true
|
||||
for (url in item.icon) {
|
||||
if (url.contains("http")) {
|
||||
val imageView1 = ImageView(Application.getInstance())
|
||||
val params = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
Application.getInstance().getResources()
|
||||
.getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_20)
|
||||
)
|
||||
params.setMargins(
|
||||
0,
|
||||
0,
|
||||
Application.getInstance().getResources()
|
||||
.getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_10),
|
||||
0
|
||||
) // 右边距
|
||||
imageView1.setLayoutParams(params)
|
||||
imageView1.setScaleType(ImageView.ScaleType.FIT_START)
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView1, params)
|
||||
flex_entry.addView(imageView1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
flex_entry.isVisible=false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,31 +30,34 @@ public class TaskDataAdapter extends BaseQuickAdapter<GiftBoxBean.TaskDataBean.D
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftBoxBean.TaskDataBean.DailyTasksBean item) {
|
||||
TextView textView=helper.getView(R.id.task_type);
|
||||
// if (item.getTaskType().equals("1")){
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_lock));
|
||||
// }else if (item.getTaskType().equals("2")){
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_wc));
|
||||
// } else if (item.getTaskType().equals("3")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_sl));
|
||||
// }else if (item.getTaskType().equals("4")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_yq));
|
||||
// }else if (item.getTaskType().equals("5")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_cz));
|
||||
// }else if (item.getTaskType().equals("6")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.ylq));
|
||||
// }
|
||||
TextView textView1= helper.getView(R.id.task_jb);
|
||||
|
||||
// textView.setText(item.getTask_type_str().equals("去完成")?"未完成": (item.getTask_type_str().equals("领取金币")?"待领取":item.getTask_type_str()));
|
||||
if (item.getTask_type_str().equals("去完成")){
|
||||
if (item.getTask_status()==1){
|
||||
textView.setText("未完成");
|
||||
}else if (item.getTask_type_str().equals("领取金币")){
|
||||
}else if (item.getTask_status()==2){
|
||||
textView.setText("");
|
||||
textView.setBackgroundResource(com.xscm.moduleutil.R.mipmap.task_lq);
|
||||
}else {
|
||||
}else if (item.getTask_status()==3){
|
||||
textView.setText("");
|
||||
textView.setBackgroundResource(com.xscm.moduleutil.R.mipmap.task_ylq);
|
||||
}
|
||||
|
||||
// if (item.getTask_type_str().equals("去完成")){
|
||||
// textView.setText("未完成");
|
||||
// }else if (item.getTask_type_str().equals("领取金币") || item.getTask_type_str().equals("领取钻石")){
|
||||
// textView.setText("");
|
||||
// textView.setBackgroundResource(com.xscm.moduleutil.R.mipmap.task_lq);
|
||||
// }else {
|
||||
// textView.setText("");
|
||||
// textView.setBackgroundResource(com.xscm.moduleutil.R.mipmap.task_ylq);
|
||||
// }
|
||||
|
||||
if (item.getReward_type()==1){
|
||||
textView1.setText("金币");
|
||||
}else if (item.getReward_type()==2){
|
||||
textView1.setText("钻石");
|
||||
}
|
||||
|
||||
ImageUtils.loadHeadCC(item.getIcon(), helper.getView(R.id.task_pic));
|
||||
helper.setText(R.id.task_name, item.getTask_name())
|
||||
.setText(R.id.task_jb_number, "+"+item.getGold_reward());
|
||||
|
||||
@@ -48,11 +48,11 @@ public class TaskSectionAdapter extends RecyclerView.Adapter<TaskSectionAdapter.
|
||||
holder.recyclerView.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext()));
|
||||
holder.recyclerView.setAdapter(adapter);
|
||||
adapter.setNewData(section.tasks);
|
||||
if (position==2){
|
||||
holder.view.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
holder.view.setVisibility(View.GONE);
|
||||
}
|
||||
// if (position==2){
|
||||
// holder.view.setVisibility(View.VISIBLE);
|
||||
// }else {
|
||||
// holder.view.setVisibility(View.GONE);
|
||||
// }
|
||||
|
||||
adapter.setItemClickLitener(new TaskDataAdapter.ItemClickLitener() {
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.FamilyEarnings
|
||||
import com.xscm.moduleutil.utils.TimeUtils
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/27 17:03
|
||||
* 用途:收益适配器
|
||||
*/
|
||||
class TotalRevenueAdapter : BaseQuickAdapter<FamilyEarnings?, BaseViewHolder>(R.layout.item_total_revenue) {
|
||||
override fun convert(
|
||||
helper: BaseViewHolder,
|
||||
item: FamilyEarnings?
|
||||
) {
|
||||
helper.setText(R.id.tv_name, item?.nickname)
|
||||
helper.setText(R.id.tv_gift_name, item?.gift_name)
|
||||
helper.setText(R.id.tv_gift_price, item?.gift_price)
|
||||
helper.setText(R.id.tv_time, "时间"+TimeUtils.getDateToStringNoZ(item?.createtime?:0L))
|
||||
helper.setText(R.id.tv_jb, item?.earnings)
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,10 @@ import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.databinding.DialogUserNetWorthBinding
|
||||
import com.xscm.moduleutil.bean.UserInfo
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
@@ -19,6 +21,7 @@ import com.xscm.moduleutil.utils.ColorManager
|
||||
class UserNetWorthDialog(context: Context) :
|
||||
Dialog(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
var userInfo : UserInfo= UserInfo()
|
||||
private lateinit var mBinding: DialogUserNetWorthBinding
|
||||
|
||||
init {
|
||||
@@ -26,11 +29,13 @@ class UserNetWorthDialog(context: Context) :
|
||||
setContentView(mBinding.root)
|
||||
|
||||
setupWindow()
|
||||
setupViews()
|
||||
initView()
|
||||
setupViews()
|
||||
}
|
||||
|
||||
private fun setupViews() {
|
||||
userInfo= SpUtil.getUserInfo()
|
||||
mBinding.tv2.setText(userInfo.market_value.toString())
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/top_bar">
|
||||
|
||||
@@ -71,8 +71,9 @@
|
||||
<ImageView
|
||||
android:id="@+id/iv2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_weight="0.2"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:src="@mipmap/data2" />
|
||||
@@ -92,17 +93,19 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/revenue_view"
|
||||
android:id="@+id/total_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:background="@color/white"
|
||||
android:clipToPadding="false"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:spanCount="1"
|
||||
tools:listitem="@layout/item_total_revenue" />
|
||||
|
||||
|
||||
|
||||
@@ -52,13 +52,14 @@
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp" />
|
||||
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintTop_toBottomOf="@id/tabLayout" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tabLayout"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/l1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="@dimen/dp_7"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
@@ -232,7 +232,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/l2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_7"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
@@ -257,7 +257,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start|center"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="签约竞拍次数越多,签约成交比签约时身价更高,则竞拍溢价就越高"
|
||||
android:text="收礼身价,等于 通过累计收礼的价值,每1000个金币等于1身价"
|
||||
android:textColor="#EDAA19"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
|
||||
@@ -1,17 +1,184 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<layout 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="match_parent"
|
||||
tools:context=".activity.user.fragment.JoinedFamilyFragment">
|
||||
|
||||
<!-- 我加入的家族内容 -->
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="我加入的家族"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
app:srlEnableLoadMore="false"
|
||||
app:srlEnableRefresh="false">
|
||||
<!-- 使用 LinearLayout 作为 SmartRefreshLayout 的唯一子布局 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r12_c5ffc9_f9e9ff_c7ecfa">
|
||||
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
android:id="@+id/headView"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_launcher_background" />
|
||||
|
||||
<com.xscm.moduleutil.widget.ShineTextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:fontFamily="@font/semibold"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:layout_constraintBottom_toBottomOf="@id/headView"
|
||||
app:layout_constraintStart_toEndOf="@id/headView"
|
||||
app:layout_constraintTop_toTopOf="@id/headView"
|
||||
tools:text="家族名称"
|
||||
app:isShine="false"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="家族等级"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_user_name"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_user_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_family_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@drawable/tv_border_background"
|
||||
android:paddingHorizontal="@dimen/dp_12"
|
||||
android:paddingVertical="@dimen/dp_4"
|
||||
android:text="家族群"
|
||||
android:textColor="#3ABC6D"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintBottom_toBottomOf="@id/headView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/headView" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_34"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:background="@drawable/bg_r6_ff6f0_f6d2f2_c2ebff"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/headView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/headView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_zsy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:text="总计收益:"
|
||||
android:textColor="#FF2727"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view"
|
||||
app:layout_constraintStart_toStartOf="@id/view"
|
||||
app:layout_constraintTop_toTopOf="@+id/view" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_zsy_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@mipmap/zs_tb"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="#FF2727"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_zsy"
|
||||
app:layout_constraintTop_toTopOf="@+id/view" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_zsy_num2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="@dimen/dp_6"
|
||||
android:paddingEnd="@dimen/dp_8"
|
||||
android:text="查看更多"
|
||||
android:textColor="#a6000000"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view"
|
||||
app:layout_constraintEnd_toEndOf="@id/view"
|
||||
app:layout_constraintTop_toTopOf="@+id/view" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sign_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_12"
|
||||
android:background="@mipmap/sign_num_bg"
|
||||
android:paddingHorizontal="@dimen/dp_10"
|
||||
android:paddingVertical="@dimen/dp_4"
|
||||
android:text="签约次数:2"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@mipmap/bg_family_members"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="@dimen/dp_38"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingBottom="@dimen/dp_7"
|
||||
android:text="我的家庭"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="1"
|
||||
tools:listitem="@layout/item_family_members" />
|
||||
</LinearLayout>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true">
|
||||
app:srlEnableLoadMore="false"
|
||||
app:srlEnableRefresh="false">
|
||||
<!-- 使用 LinearLayout 作为 SmartRefreshLayout 的唯一子布局 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -40,7 +40,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_launcher_background" />
|
||||
|
||||
<TextView
|
||||
<com.xscm.moduleutil.widget.ShineTextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -51,7 +51,8 @@
|
||||
app:layout_constraintBottom_toBottomOf="@id/headView"
|
||||
app:layout_constraintStart_toEndOf="@id/headView"
|
||||
app:layout_constraintTop_toTopOf="@id/headView"
|
||||
tools:text="家族名称" />
|
||||
tools:text="家族名称"
|
||||
app:isShine="false"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_id"
|
||||
@@ -64,6 +65,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_user_name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_family_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
android:layout_marginVertical="@dimen/dp_6"
|
||||
android:background="@drawable/bg_r12_fffac5_f9e9ff_c7d3fa">
|
||||
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_marginStart="@dimen/dp_22"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
<com.xscm.moduleutil.widget.ShineTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -27,6 +27,7 @@
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textSize="@dimen/sp_16"
|
||||
app:isShine="false"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_head"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_head"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_head"
|
||||
@@ -138,6 +139,7 @@
|
||||
android:text="收礼盈利"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_today"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
@@ -184,6 +186,7 @@
|
||||
android:text="收礼盈利"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_yesterday"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
|
||||
@@ -29,5 +29,6 @@
|
||||
android:id="@+id/v"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:visibility="gone"
|
||||
android:background="@color/color_transparent" />
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user