1:修改家族展示续签按钮位置
2:修改购买爵位前,先请求一次接口 3:修改所有CP更改为心动 4:修改挚友,初始获取数据变更成40条 5:未实名认证不能进行歌手认证
This commit is contained in:
@@ -41,8 +41,8 @@ class MyFamilyBean {
|
|||||||
var nobility_image: String = "" //贵族
|
var nobility_image: String = "" //贵族
|
||||||
var nickname_color: String = "" //贵族颜色
|
var nickname_color: String = "" //贵族颜色
|
||||||
var free_renewal: Int = 0 //免费续签次数
|
var free_renewal: Int = 0 //免费续签次数
|
||||||
var today_earnings: String = "" //今日收礼收益
|
var today_earnings: Double = 0.0 //今日收礼收益
|
||||||
var yesterday_earnings: String = "" //昨日收礼收益
|
var yesterday_earnings: Double = 0.0 //昨日收礼收益
|
||||||
var is_online: Int = 0 //是否在线 1在线 0离线
|
var is_online: Int = 0 //是否在线 1在线 0离线
|
||||||
var is_show_sign: Int = 0 //是否显示续约按钮 1:显示 0:不显示
|
var is_show_sign: Int = 0 //是否显示续约按钮 1:显示 0:不显示
|
||||||
|
|
||||||
|
|||||||
@@ -228,6 +228,9 @@ public class RoomCPView extends FrameLayout {
|
|||||||
isLoadEffect = false;
|
isLoadEffect = false;
|
||||||
// 标记动画已停止运行
|
// 标记动画已停止运行
|
||||||
isAnimationRunning = false;
|
isAnimationRunning = false;
|
||||||
|
|
||||||
|
// 清除播放器缓存
|
||||||
|
clearPlayerCache();
|
||||||
} finally {
|
} finally {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
@@ -237,7 +240,7 @@ public class RoomCPView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 继续播放下一个动画
|
// 继续播放下一个动画
|
||||||
loadStartAnimation();
|
processNextAnimation();
|
||||||
}, 100); // 添加100毫秒的延迟
|
}, 100); // 添加100毫秒的延迟
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -295,7 +298,7 @@ public class RoomCPView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 继续播放下一个
|
// 继续播放下一个
|
||||||
loadStartAnimation();
|
processNextAnimation();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -352,10 +355,9 @@ public class RoomCPView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载并开始播放动画
|
* 处理并播放队列中的下一个动画
|
||||||
* 从动画队列中取出下一个动画进行播放
|
|
||||||
*/
|
*/
|
||||||
private void loadStartAnimation() {
|
private void processNextAnimation() {
|
||||||
// 检查是否开启特效
|
// 检查是否开启特效
|
||||||
if (!isShow) {
|
if (!isShow) {
|
||||||
return;
|
return;
|
||||||
@@ -368,75 +370,68 @@ public class RoomCPView extends FrameLayout {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String animationPath = null;
|
// 检查动画队列是否为空
|
||||||
|
if (animationQueue.isEmpty()) {
|
||||||
// 对动画列表加锁
|
// 队列为空,重置状态并释放资源
|
||||||
lock.lock();
|
isLoadEffect = false;
|
||||||
try {
|
post(() -> {
|
||||||
// 检查动画队列是否为空
|
destroyEffectView();
|
||||||
if (!animationArray.isEmpty()) {
|
});
|
||||||
// 获取队列中的第一个动画路径
|
return;
|
||||||
animationPath = animationArray.get(0);
|
|
||||||
// 从队列中移除已获取的动画
|
|
||||||
animationArray.remove(0);
|
|
||||||
|
|
||||||
// 设置状态标记
|
|
||||||
isLoadEffect = true;
|
|
||||||
isAnimationRunning = true;
|
|
||||||
} else {
|
|
||||||
// 队列为空,重置状态并释放资源
|
|
||||||
isLoadEffect = false;
|
|
||||||
post(() -> {
|
|
||||||
destroyEffectView();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
// 解锁
|
|
||||||
lock.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果有动画需要播放
|
// 获取并移除队列中的第一个动画任务
|
||||||
if (isLoadEffect && animationPath != null && !TextUtils.isEmpty(animationPath)) {
|
AnimationTask task = animationQueue.poll();
|
||||||
String finalAnimationPath = animationPath;
|
if (task == null) {
|
||||||
post(new Runnable() {
|
return;
|
||||||
@Override
|
}
|
||||||
public void run() {
|
|
||||||
// 处理MP4动画文件(可能是网络URL)
|
|
||||||
handleMP4File(finalAnimationPath, new DownloadCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(String localPath) {
|
|
||||||
post(() -> {
|
|
||||||
// 设置当前播放路径
|
|
||||||
currPlayPath = localPath;
|
|
||||||
// 启动从底部弹起动画
|
|
||||||
startBottomUpAnimation();
|
|
||||||
// 设置播放次数为1次
|
|
||||||
anim_cp.setLoop(1);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
// 设置状态标记
|
||||||
public void onError(String error) {
|
isLoadEffect = true;
|
||||||
LogUtils.e("MP4下载或播放失败: " + error);
|
isAnimationRunning = true;
|
||||||
// 处理失败情况,继续播放下一个
|
|
||||||
post(() -> {
|
// 设置CP数据
|
||||||
// 使用动画队列锁确保线程安全
|
setCPTextData(task.room_head1, task.room_head2, task.room_cp_name1, task.room_cp_name2);
|
||||||
synchronized (animationLock) {
|
|
||||||
lock.lock();
|
// 确保视图可见
|
||||||
try {
|
setVisibility(View.VISIBLE);
|
||||||
// 重置状态标记
|
|
||||||
isLoadEffect = false;
|
// 处理动画文件
|
||||||
isAnimationRunning = false;
|
String animationPath = task.mp4Path;
|
||||||
} finally {
|
if (animationPath != null && !TextUtils.isEmpty(animationPath)) {
|
||||||
lock.unlock();
|
post(() -> {
|
||||||
}
|
// 处理MP4动画文件(可能是网络URL)
|
||||||
}
|
handleMP4File(animationPath, new DownloadCallback() {
|
||||||
// 尝试播放下一个动画
|
@Override
|
||||||
loadStartAnimation();
|
public void onSuccess(String localPath) {
|
||||||
});
|
post(() -> {
|
||||||
|
// 设置当前播放路径
|
||||||
|
currPlayPath = localPath;
|
||||||
|
// 启动从底部弹起动画
|
||||||
|
startBottomUpAnimation();
|
||||||
|
// 设置播放次数为1次
|
||||||
|
anim_cp.setLoop(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String error) {
|
||||||
|
LogUtils.e("MP4下载或播放失败: " + error);
|
||||||
|
// 处理失败情况,继续播放下一个
|
||||||
|
synchronized (animationLock) {
|
||||||
|
lock.lock();
|
||||||
|
try {
|
||||||
|
// 重置状态标记
|
||||||
|
isLoadEffect = false;
|
||||||
|
isAnimationRunning = false;
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
// 尝试播放下一个动画
|
||||||
}
|
processNextAnimation();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,58 +452,18 @@ public class RoomCPView extends FrameLayout {
|
|||||||
// 确保视图已初始化
|
// 确保视图已初始化
|
||||||
reinitView();
|
reinitView();
|
||||||
|
|
||||||
// 设置CP数据
|
// 创建动画任务并添加到队列
|
||||||
setCPTextData(room_head1, room_head2, room_name1, room_name2);
|
AnimationTask task = new AnimationTask(room_head1, room_head2, room_name1, room_name2, mp4Path, null);
|
||||||
|
|
||||||
// 注释:确保头像初始为隐藏状态(如需要可取消注释)
|
// 使用动画队列锁确保线程安全
|
||||||
// room_cp_head1.setVisibility(View.GONE);
|
synchronized (animationLock) {
|
||||||
// room_cp_head2.setVisibility(View.GONE);
|
animationQueue.offer(task);
|
||||||
// room_cp_name1.setVisibility(View.GONE);
|
|
||||||
// room_cp_name2.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
// 确保视图可见
|
// 如果当前没有动画在播放,则开始播放队列中的第一个动画
|
||||||
setVisibility(View.VISIBLE);
|
if (!isAnimationRunning) {
|
||||||
|
processNextAnimation();
|
||||||
// 检查队列是否已初始化
|
|
||||||
if (queue == null) {
|
|
||||||
queue = Executors.newSingleThreadExecutor();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 在后台线程中处理动画
|
|
||||||
queue.execute(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
// 检查动画路径是否有效
|
|
||||||
if (mp4Path == null || mp4Path.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取文件扩展名并转为小写
|
|
||||||
String playImage = mp4Path;
|
|
||||||
String pathExtension = getFileExtension(playImage).toLowerCase();
|
|
||||||
|
|
||||||
// 检查文件格式是否支持(仅支持svga和mp4)
|
|
||||||
if (!("svga".equals(pathExtension) || "mp4".equals(pathExtension))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对动画列表加锁
|
|
||||||
lock.lock();
|
|
||||||
try {
|
|
||||||
// 将动画路径添加到队列
|
|
||||||
animationArray.add(playImage);
|
|
||||||
|
|
||||||
// 如果当前没有动画在加载,则开始加载新动画
|
|
||||||
if (!isLoadEffect) {
|
|
||||||
isLoadEffect = true;
|
|
||||||
loadStartAnimation();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
// 解锁
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -805,7 +760,7 @@ public class RoomCPView extends FrameLayout {
|
|||||||
synchronized (animationLock) {
|
synchronized (animationLock) {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
try {
|
try {
|
||||||
animationArray.clear();
|
animationQueue.clear();
|
||||||
isLoadEffect = false;
|
isLoadEffect = false;
|
||||||
// 重置动画运行状态
|
// 重置动画运行状态
|
||||||
isAnimationRunning = false;
|
isAnimationRunning = false;
|
||||||
@@ -1011,6 +966,19 @@ public class RoomCPView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除播放器缓存
|
||||||
|
* 清除当前播放的视频缓存,但不删除已下载的文件
|
||||||
|
*/
|
||||||
|
private void clearPlayerCache() {
|
||||||
|
if (anim_cp != null) {
|
||||||
|
// 停止当前播放
|
||||||
|
anim_cp.stopPlay();
|
||||||
|
// 重置当前播放路径
|
||||||
|
currPlayPath = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重新初始化视图,以便再次播放
|
* 重新初始化视图,以便再次播放
|
||||||
*/
|
*/
|
||||||
@@ -1030,6 +998,7 @@ public class RoomCPView extends FrameLayout {
|
|||||||
|
|
||||||
// 重置状态
|
// 重置状态
|
||||||
isLoadEffect = false;
|
isLoadEffect = false;
|
||||||
|
isAnimationRunning = false;
|
||||||
isShow = true;
|
isShow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1057,6 +1026,11 @@ public class RoomCPView extends FrameLayout {
|
|||||||
queue = null;
|
queue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清空动画队列
|
||||||
|
synchronized (animationLock) {
|
||||||
|
animationQueue.clear();
|
||||||
|
}
|
||||||
|
|
||||||
// 隐藏并移除整个视图
|
// 隐藏并移除整个视图
|
||||||
setVisibility(View.GONE);
|
setVisibility(View.GONE);
|
||||||
if (getParent() != null) {
|
if (getParent() != null) {
|
||||||
|
|||||||
@@ -61,11 +61,7 @@ public class NobleDetailsActivity extends BaseMvpActivity<NobleTitlePresenter, A
|
|||||||
gridView = mBinding.gridView;
|
gridView = mBinding.gridView;
|
||||||
mGiftWallAdapter=new GridNobleAdapter();
|
mGiftWallAdapter=new GridNobleAdapter();
|
||||||
mBinding.imLjkt.setOnClickListener(v -> {
|
mBinding.imLjkt.setOnClickListener(v -> {
|
||||||
Intent intent = new Intent(this, NoblePaymentActivity.class);
|
MvpPre.getNobilityPrice(xlid);
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putString("lid",xlid);
|
|
||||||
intent.putExtras( bundle);
|
|
||||||
startActivity(intent);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +148,11 @@ public class NobleDetailsActivity extends BaseMvpActivity<NobleTitlePresenter, A
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getNobilityPrice(NobilityPrice nobilityPrice) {
|
public void getNobilityPrice(NobilityPrice nobilityPrice) {
|
||||||
|
Intent intent = new Intent(this, NoblePaymentActivity.class);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("lid",xlid);
|
||||||
|
intent.putExtras( bundle);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
|
|||||||
@@ -74,11 +74,7 @@ public class NobleTitleActivity extends BaseMvpActivity<NobleTitlePresenter, Act
|
|||||||
intent.putExtras(bundle);
|
intent.putExtras(bundle);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}else if (id== R.id.im_me_noble_xf) {
|
}else if (id== R.id.im_me_noble_xf) {
|
||||||
Intent intent = new Intent(this, NoblePaymentActivity.class);
|
MvpPre.getNobilityPrice(lid);
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putString("lid",lid);
|
|
||||||
intent.putExtras(bundle);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,7 +247,11 @@ public class NobleTitleActivity extends BaseMvpActivity<NobleTitlePresenter, Act
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getNobilityPrice(NobilityPrice nobilityPrice) {
|
public void getNobilityPrice(NobilityPrice nobilityPrice) {
|
||||||
|
Intent intent = new Intent(this, NoblePaymentActivity.class);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("lid",lid);
|
||||||
|
intent.putExtras(bundle);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 在 Activity 或 Fragment 中
|
// 在 Activity 或 Fragment 中
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class BosomFriendFragment : BaseMvpFragment<UserHomepagePresenter?, FragmentBoso
|
|||||||
page = 1 // 重置页码
|
page = 1 // 重置页码
|
||||||
// 如果已经初始化完成,立即获取数据
|
// 如果已经初始化完成,立即获取数据
|
||||||
if (isAdded) {
|
if (isAdded) {
|
||||||
MvpPre?.getFriendList(userId, page.toString(), "10") // 获取第一页数据
|
MvpPre?.getFriendList(userId, page.toString(), "40") // 获取第一页数据
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class BosomFriendFragment : BaseMvpFragment<UserHomepagePresenter?, FragmentBoso
|
|||||||
override fun initData() {
|
override fun initData() {
|
||||||
// 根据userId获取挚友列表数据
|
// 根据userId获取挚友列表数据
|
||||||
if (userId.isNotEmpty()) {
|
if (userId.isNotEmpty()) {
|
||||||
MvpPre?.getFriendList(userId, page.toString(), "10") // 初始加载第一页数据
|
MvpPre?.getFriendList(userId, page.toString(), "40") // 初始加载第一页数据
|
||||||
}
|
}
|
||||||
|
|
||||||
// 观察ViewModel中的数据变化
|
// 观察ViewModel中的数据变化
|
||||||
@@ -157,19 +157,19 @@ class BosomFriendFragment : BaseMvpFragment<UserHomepagePresenter?, FragmentBoso
|
|||||||
// 设置下拉刷新
|
// 设置下拉刷新
|
||||||
mBinding.smartRefreshLayout.setOnRefreshListener {
|
mBinding.smartRefreshLayout.setOnRefreshListener {
|
||||||
page = 1 // 重置页码
|
page = 1 // 重置页码
|
||||||
MvpPre?.getFriendList(userId, page.toString(), "10")
|
MvpPre?.getFriendList(userId, page.toString(), "40")
|
||||||
}
|
}
|
||||||
|
|
||||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(object :
|
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(object :
|
||||||
OnRefreshLoadMoreListener {
|
OnRefreshLoadMoreListener {
|
||||||
override fun onLoadMore(refreshLayout: RefreshLayout) {
|
override fun onLoadMore(refreshLayout: RefreshLayout) {
|
||||||
page++
|
page++
|
||||||
MvpPre?.getFriendList(userId, page.toString(), "10")
|
MvpPre?.getFriendList(userId, page.toString(), "40")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onRefresh(refreshLayout: RefreshLayout) {
|
override fun onRefresh(refreshLayout: RefreshLayout) {
|
||||||
page = 1 // 重置页码
|
page = 1 // 重置页码
|
||||||
MvpPre?.getFriendList(userId, page.toString(), "10")
|
MvpPre?.getFriendList(userId, page.toString(), "40")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -261,12 +261,12 @@ class BosomFriendFragment : BaseMvpFragment<UserHomepagePresenter?, FragmentBoso
|
|||||||
|
|
||||||
override fun topRelationCard(s: String?) {
|
override fun topRelationCard(s: String?) {
|
||||||
page = 1 // 重置页码
|
page = 1 // 重置页码
|
||||||
MvpPre?.getFriendList(userId, page.toString(), "10")
|
MvpPre?.getFriendList(userId, page.toString(), "40")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun deleteRelationCard(s: String?) {
|
override fun deleteRelationCard(s: String?) {
|
||||||
page = 1 // 重置页码
|
page = 1 // 重置页码
|
||||||
MvpPre?.getFriendList(userId, page.toString(), "10")
|
MvpPre?.getFriendList(userId, page.toString(), "40")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setFriendListMore(data: List<RelationshipBean?>?) {
|
override fun setFriendListMore(data: List<RelationshipBean?>?) {
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import android.widget.LinearLayout;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.blankj.utilcode.util.LogUtils;
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
|
import com.hjq.toast.ToastUtils;
|
||||||
import com.stx.xhb.xbanner.XBanner;
|
import com.stx.xhb.xbanner.XBanner;
|
||||||
import com.tencent.mm.opensdk.modelbiz.WXOpenCustomerServiceChat;
|
import com.tencent.mm.opensdk.modelbiz.WXOpenCustomerServiceChat;
|
||||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||||
@@ -45,6 +47,7 @@ import com.xscm.modulemain.activity.user.presenter.MePresenter;
|
|||||||
import com.xscm.modulemain.activity.WebViewActivity;
|
import com.xscm.modulemain.activity.WebViewActivity;
|
||||||
import com.xscm.modulemain.dialog.UserNetWorthDialog;
|
import com.xscm.modulemain.dialog.UserNetWorthDialog;
|
||||||
import com.xscm.moduleutil.base.WebUrlConstants;
|
import com.xscm.moduleutil.base.WebUrlConstants;
|
||||||
|
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||||
import com.xscm.moduleutil.widget.ShineTextView;
|
import com.xscm.moduleutil.widget.ShineTextView;
|
||||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||||
import com.xscm.moduleutil.base.CommonAppContext;
|
import com.xscm.moduleutil.base.CommonAppContext;
|
||||||
@@ -271,6 +274,11 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
|||||||
} else if (id == R.id.cl_noble_title) {//爵位展示页面
|
} else if (id == R.id.cl_noble_title) {//爵位展示页面
|
||||||
startActivity(new Intent(getContext(), NobleTitleActivity.class));
|
startActivity(new Intent(getContext(), NobleTitleActivity.class));
|
||||||
} else if (id == R.id.ll_singer) {//歌手认证
|
} else if (id == R.id.ll_singer) {//歌手认证
|
||||||
|
if (!SpUtil.getRealName()) {
|
||||||
|
ToastUtils.show("实名认证后才能进行歌手认证");
|
||||||
|
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
|
||||||
|
return;
|
||||||
|
}
|
||||||
Intent intent = new Intent(getContext(), SingerVerificationActivity.class);
|
Intent intent = new Intent(getContext(), SingerVerificationActivity.class);
|
||||||
intent.putExtra("isSinger", userInfo.getSinger_status());
|
intent.putExtra("isSinger", userInfo.getSinger_status());
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|||||||
@@ -128,7 +128,16 @@ class BosomFriendAdapter(data: MutableList<MultiItemEntity>) : BaseMultiItemQuic
|
|||||||
|
|
||||||
if (remainingSeconds > 0) {
|
if (remainingSeconds > 0) {
|
||||||
val days = remainingSeconds / (24 * 60 * 60)
|
val days = remainingSeconds / (24 * 60 * 60)
|
||||||
val hours = (remainingSeconds % (24 * 60 * 60)) / (60 * 60)
|
val remainingHours = (remainingSeconds % (24 * 60 * 60)) / (60 * 60)
|
||||||
|
val hasRemainingMinutes = (remainingSeconds % (60 * 60)) > 0
|
||||||
|
|
||||||
|
val hours = if (days > 0) {
|
||||||
|
remainingHours
|
||||||
|
} else {
|
||||||
|
// 当天数小于等于0时,如果有剩余分钟,则小时数+1
|
||||||
|
if (hasRemainingMinutes) remainingHours + 1 else remainingHours
|
||||||
|
}.coerceAtLeast(1) // 确保至少显示1小时
|
||||||
|
|
||||||
val timeText = if (days > 0) {
|
val timeText = if (days > 0) {
|
||||||
"${days}天${hours}小时"
|
"${days}天${hours}小时"
|
||||||
} else {
|
} else {
|
||||||
@@ -136,6 +145,7 @@ class BosomFriendAdapter(data: MutableList<MultiItemEntity>) : BaseMultiItemQuic
|
|||||||
}
|
}
|
||||||
holder.setText(R.id.tv_cp_num, timeText)
|
holder.setText(R.id.tv_cp_num, timeText)
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e: NumberFormatException) {
|
} catch (e: NumberFormatException) {
|
||||||
// 时间戳格式错误
|
// 时间戳格式错误
|
||||||
holder.setVisible(R.id.tv_cp_num, false)
|
holder.setVisible(R.id.tv_cp_num, false)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.xscm.modulemain.adapter
|
package com.xscm.modulemain.adapter
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@@ -18,6 +19,7 @@ import com.xscm.moduleutil.utils.ImageUtils
|
|||||||
import com.xscm.moduleutil.utils.MeHeadView
|
import com.xscm.moduleutil.utils.MeHeadView
|
||||||
import com.xscm.moduleutil.utils.SpUtil
|
import com.xscm.moduleutil.utils.SpUtil
|
||||||
import com.xscm.moduleutil.widget.ShineTextView
|
import com.xscm.moduleutil.widget.ShineTextView
|
||||||
|
import java.text.DecimalFormat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名称:羽声语音
|
* 项目名称:羽声语音
|
||||||
@@ -41,6 +43,7 @@ class MyFamilyAdapter(
|
|||||||
fun setOnItemClickListener(listener: OnItemClickListener) {
|
fun setOnItemClickListener(listener: OnItemClickListener) {
|
||||||
onItemClickListener = listener
|
onItemClickListener = listener
|
||||||
}
|
}
|
||||||
|
@SuppressLint("DefaultLocale")
|
||||||
override fun convert(
|
override fun convert(
|
||||||
helper: BaseViewHolder,
|
helper: BaseViewHolder,
|
||||||
item: MyFamilyBean.GroupMembersListsBean
|
item: MyFamilyBean.GroupMembersListsBean
|
||||||
@@ -75,8 +78,12 @@ class MyFamilyAdapter(
|
|||||||
helper.setText(R.id.tv_time, "剩余租期"+item.end_day)
|
helper.setText(R.id.tv_time, "剩余租期"+item.end_day)
|
||||||
helper.setText(R.id.tv_num, "免费续约次数"+ item.free_renewal)
|
helper.setText(R.id.tv_num, "免费续约次数"+ item.free_renewal)
|
||||||
|
|
||||||
helper.setText(R.id.tv_today, item.today_earnings)
|
val decimalFormat = DecimalFormat("#.####")
|
||||||
helper.setText(R.id.tv_yesterday, item.yesterday_earnings)
|
helper.setText(R.id.tv_today, decimalFormat.format(item.today_earnings.toDouble()))
|
||||||
|
helper.setText(R.id.tv_yesterday, decimalFormat.format(item.yesterday_earnings.toDouble()))
|
||||||
|
|
||||||
|
|
||||||
|
// helper.setText(R.id.tv_yesterday, item.yesterday_earnings)
|
||||||
tvName.setText(item.nickname)
|
tvName.setText(item.nickname)
|
||||||
if (item.nickname_color.isNotEmpty()){
|
if (item.nickname_color.isNotEmpty()){
|
||||||
tvName.startColor = Color.parseColor(item.nickname_color)
|
tvName.startColor = Color.parseColor(item.nickname_color)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@mipmap/icon_dialog_u_cp_left_top"
|
android:background="@mipmap/icon_dialog_u_cp_left_top"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="CP"
|
android:text="心动"
|
||||||
android:textColor="@color/white" />
|
android:textColor="@color/white" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
android:layout_toStartOf="@+id/ll_middle"
|
android:layout_toStartOf="@+id/ll_middle"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.xscm.moduleutil.widget.CircularImage
|
||||||
android:id="@+id/user_nav1"
|
android:id="@+id/user_nav1"
|
||||||
android:layout_width="@dimen/dp_50"
|
android:layout_width="@dimen/dp_50"
|
||||||
android:layout_height="@dimen/dp_50"
|
android:layout_height="@dimen/dp_50"
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
android:layout_toEndOf="@+id/ll_middle"
|
android:layout_toEndOf="@+id/ll_middle"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.makeramen.roundedimageview.RoundedImageView
|
<com.xscm.moduleutil.widget.CircularImage
|
||||||
android:id="@+id/user_nav2"
|
android:id="@+id/user_nav2"
|
||||||
android:layout_width="@dimen/dp_50"
|
android:layout_width="@dimen/dp_50"
|
||||||
android:layout_height="@dimen/dp_50"
|
android:layout_height="@dimen/dp_50"
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_today"
|
android:id="@+id/tv_today"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/dp_4"
|
android:layout_marginBottom="@dimen/dp_4"
|
||||||
android:drawableStart="@mipmap/zs_tb"
|
android:drawableStart="@mipmap/zs_tb"
|
||||||
@@ -158,9 +158,10 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_num"
|
app:layout_constraintTop_toBottomOf="@+id/tv_num"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginStart="@dimen/dp_5"
|
android:layout_marginStart="@dimen/dp_5"
|
||||||
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
app:layout_constraintStart_toEndOf="@+id/l1"
|
app:layout_constraintStart_toEndOf="@+id/l1"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/tv_renew"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintHorizontal_weight="1"
|
app:layout_constraintHorizontal_weight="1"
|
||||||
android:layout_marginBottom="@dimen/dp_12"
|
android:layout_marginBottom="@dimen/dp_12"
|
||||||
@@ -188,7 +189,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_yesterday"
|
android:id="@+id/tv_yesterday"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/dp_4"
|
android:layout_marginBottom="@dimen/dp_4"
|
||||||
android:drawableStart="@mipmap/zs_tb"
|
android:drawableStart="@mipmap/zs_tb"
|
||||||
@@ -199,15 +200,13 @@
|
|||||||
tools:text="9999.99"/>
|
tools:text="9999.99"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_renew"
|
android:id="@+id/tv_renew"
|
||||||
android:layout_width="0dp"
|
android:layout_width="@dimen/dp_50"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="续租"
|
android:text="续租"
|
||||||
app:layout_constraintStart_toEndOf="@+id/l2"
|
app:layout_constraintBottom_toBottomOf="@+id/tv_num"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
android:layout_marginStart="@dimen/dp_6"
|
|
||||||
android:layout_marginBottom="@dimen/dp_12"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:paddingHorizontal="@dimen/dp_5"
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
@@ -215,10 +214,8 @@
|
|||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/cs"
|
android:background="@drawable/cs"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_12"
|
||||||
app:layout_constraintHorizontal_weight="0.7"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="invisible"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -330,7 +330,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@mipmap/icon_dialog_u_cp_left_top"
|
android:background="@mipmap/icon_dialog_u_cp_left_top"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="CP"
|
android:text="心动"
|
||||||
android:textColor="@color/white" />
|
android:textColor="@color/white" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user