fix bugs.
This commit is contained in:
@@ -13,7 +13,7 @@ import com.xscm.moduleutil.utils.ImageUtils;
|
|||||||
*/
|
*/
|
||||||
public class LikeUserAdapter<T> extends BaseQuickAdapter<T, BaseViewHolder> {
|
public class LikeUserAdapter<T> extends BaseQuickAdapter<T, BaseViewHolder> {
|
||||||
public LikeUserAdapter() {
|
public LikeUserAdapter() {
|
||||||
super(R.layout.item_like_user);
|
super(R.layout.item_like_user_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class GsonUtils {
|
|||||||
GSON = new GsonBuilder()
|
GSON = new GsonBuilder()
|
||||||
.serializeNulls() // 序列化 null 值
|
.serializeNulls() // 序列化 null 值
|
||||||
.registerTypeAdapterFactory(new BaseModelTypeAdapterFactory())
|
.registerTypeAdapterFactory(new BaseModelTypeAdapterFactory())
|
||||||
|
.registerTypeAdapter(String.class,new NullToEmptyStringAdapter())
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
return GSON;
|
return GSON;
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.xscm.moduleutil.utils
|
||||||
|
|
||||||
|
import com.google.gson.TypeAdapter
|
||||||
|
import com.google.gson.stream.JsonReader
|
||||||
|
import com.google.gson.stream.JsonToken
|
||||||
|
import com.google.gson.stream.JsonWriter
|
||||||
|
|
||||||
|
class NullToEmptyStringAdapter : TypeAdapter<String>() {
|
||||||
|
override fun write(out: JsonWriter, value: String?) {
|
||||||
|
out.value(value ?: "")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun read(`in`: JsonReader): String {
|
||||||
|
return if (`in`.peek() == JsonToken.NULL) {
|
||||||
|
`in`.nextNull()
|
||||||
|
"" // null → 空字符串
|
||||||
|
} else {
|
||||||
|
`in`.nextString() ?: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -101,6 +101,9 @@ public class CommentDialogFragment extends BaseMvpDialogFragment<CommentPresente
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getCommentList(List<CircleListBean.LikeList> likeLists) {
|
public void getCommentList(List<CircleListBean.LikeList> likeLists) {
|
||||||
|
if (likeLists == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
mBinding.tvNum.setText("已有"+likeLists.size()+"人点赞");
|
mBinding.tvNum.setText("已有"+likeLists.size()+"人点赞");
|
||||||
likeListAdapter.setNewData(likeLists);
|
likeListAdapter.setNewData(likeLists);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,10 +117,11 @@
|
|||||||
<!-- 子评论列表 -->
|
<!-- 子评论列表 -->
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_replies"
|
android:id="@+id/rv_replies"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_9"
|
android:layout_marginTop="@dimen/dp_9"
|
||||||
android:padding="@dimen/dp_12"
|
android:layout_marginStart="@dimen/dp_45"
|
||||||
|
android:padding="@dimen/dp_8"
|
||||||
android:background="@drawable/bg_r12_f9f9f9"
|
android:background="@drawable/bg_r12_f9f9f9"
|
||||||
app:layout_constraintStart_toStartOf="@+id/tv_time"
|
app:layout_constraintStart_toStartOf="@+id/tv_time"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_time" />
|
app:layout_constraintTop_toBottomOf="@+id/tv_time" />
|
||||||
|
|||||||
19
BaseModule/src/main/res/layout/item_like_user_2.xml
Normal file
19
BaseModule/src/main/res/layout/item_like_user_2.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<com.xscm.moduleutil.widget.GifAvatarOvalView
|
||||||
|
android:id="@+id/user_icon"
|
||||||
|
android:layout_width="@dimen/dp_18"
|
||||||
|
android:layout_height="@dimen/dp_18"
|
||||||
|
android:src="@mipmap/default_avatar"
|
||||||
|
android:layout_marginStart="-5dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:riv_oval="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
android:textSize="@dimen/sp_12"
|
||||||
android:layout_marginTop="@dimen/dp_12"
|
android:textColor="@color/black"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:text="回复" />
|
tools:text="回复" />
|
||||||
@@ -18,12 +18,12 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_reply"
|
android:id="@+id/tv_reply"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
android:layout_marginTop="@dimen/dp_4"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
android:layout_marginHorizontal="@dimen/dp_8"
|
||||||
android:layout_marginEnd="@dimen/dp_12"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/tv_name"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/tv_name"
|
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||||
tools:text="回复" />
|
tools:text="回复" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.Manifest;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
@@ -289,7 +290,7 @@ public class ReleaseActivity extends BaseMvpActivity<ReleasePresenter, ActivityR
|
|||||||
RecyclerView recyclerView = dialog.findViewById(R.id.rv_options);
|
RecyclerView recyclerView = dialog.findViewById(R.id.rv_options);
|
||||||
TextView btnCancel = dialog.findViewById(R.id.btn_cancel);
|
TextView btnCancel = dialog.findViewById(R.id.btn_cancel);
|
||||||
TextView btnConfirm = dialog.findViewById(R.id.btn_confirm);
|
TextView btnConfirm = dialog.findViewById(R.id.btn_confirm);
|
||||||
btnConfirm.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
btnConfirm.setTextColor(Color.WHITE);
|
||||||
|
|
||||||
assert recyclerView != null;
|
assert recyclerView != null;
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.xscm.moduleutil.bean.WalletBean
|
|||||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||||
import com.xscm.moduleutil.bean.room.RoomPitBean
|
import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||||
import com.xscm.moduleutil.bean.room.RoomUserBean
|
import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||||
|
import com.xscm.moduleutil.dialog.ConfirmDialog
|
||||||
import com.xscm.moduleutil.utils.ClickUtils
|
import com.xscm.moduleutil.utils.ClickUtils
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -233,7 +234,18 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
R.id.tv_time_right -> {
|
R.id.tv_time_right -> {
|
||||||
|
// 创建并显示确认对话框
|
||||||
|
ConfirmDialog(
|
||||||
|
ActivityUtils.getTopActivity(),
|
||||||
|
"提示",
|
||||||
|
"确定要结束此次签约吗?",
|
||||||
|
"确认",
|
||||||
|
"取消",
|
||||||
|
{ v: View? ->
|
||||||
MvpPre.signEnd(mSignId!!)
|
MvpPre.signEnd(mSignId!!)
|
||||||
|
},
|
||||||
|
{ v: View? -> }, false, 0
|
||||||
|
).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
R.id.iv_help -> {
|
R.id.iv_help -> {
|
||||||
@@ -269,7 +281,7 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
|||||||
mBinding.tvSignDay.visibility = View.GONE
|
mBinding.tvSignDay.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
mBinding.tvTime.text = "倒计时 00:00"
|
mBinding.tvTime.text = "倒计时 00:00:00"
|
||||||
setIvForMai(0)
|
setIvForMai(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,11 @@ public class NoblePaymentActivity extends BaseMvpActivity<NobleTitlePresenter, A
|
|||||||
ToastUtils.show("请先勾选服务条款");
|
ToastUtils.show("请先勾选服务条款");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selectedItem.getType() == null) {
|
||||||
|
ToastUtils.show("请选择支付方式");
|
||||||
|
return;
|
||||||
|
}
|
||||||
MvpPre.appPay(SpUtil.getUserId() + "", money, selectedItem.getType(),lid);
|
MvpPre.appPay(SpUtil.getUserId() + "", money, selectedItem.getType(),lid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class MyFamilyFragment(var data: MyFamilyBean) : BaseFragment<FragmentMyFamilyBi
|
|||||||
}
|
}
|
||||||
|
|
||||||
mBinding.tvFamilyGroup.setOnClickListener {
|
mBinding.tvFamilyGroup.setOnClickListener {
|
||||||
if (myFamilyBean.group_id.isNotEmpty()) {
|
if (!myFamilyBean.group_id.isNullOrEmpty()) {
|
||||||
val intent = Intent(activity, TUIGroupChatActivity::class.java)
|
val intent = Intent(activity, TUIGroupChatActivity::class.java)
|
||||||
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, myFamilyBean.group_id)
|
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, myFamilyBean.group_id)
|
||||||
intent.putExtra(TUIConstants.TUIChat.CHAT_NAME, myFamilyBean.name)
|
intent.putExtra(TUIConstants.TUIChat.CHAT_NAME, myFamilyBean.name)
|
||||||
|
|||||||
@@ -34,11 +34,23 @@ class CountdownTimer {
|
|||||||
job?.cancel()
|
job?.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将毫秒数格式化为 HH:MM:SS 格式的时间字符串
|
||||||
|
* @param milliseconds 毫秒数(支持 0、负数、超大数值)
|
||||||
|
* @return 格式化结果,如 3670000 毫秒 → 01:01:10,125000 毫秒 → 00:02:05
|
||||||
|
*/
|
||||||
fun formatTime(milliseconds: Long): String {
|
fun formatTime(milliseconds: Long): String {
|
||||||
val seconds = (milliseconds / 1000).toInt()
|
// 1. 处理负数/0:转为非负,避免时间为负
|
||||||
val minutes = seconds / 60
|
val nonNegativeMs = if (milliseconds < 0) 0 else milliseconds
|
||||||
val remainingSeconds = seconds % 60
|
// 2. 计算总秒数(向下取整,不足1秒按0算)
|
||||||
return String.format("%02d:%02d", minutes, remainingSeconds)
|
val totalSeconds = (nonNegativeMs / 1000).toInt()
|
||||||
|
// 3. 拆分 小时、分钟、秒
|
||||||
|
val hours = totalSeconds / 3600 // 1小时=3600秒
|
||||||
|
val remainingSecondsAfterHour = totalSeconds % 3600 // 小时剩余秒数
|
||||||
|
val minutes = remainingSecondsAfterHour / 60 // 分钟
|
||||||
|
val seconds = remainingSecondsAfterHour % 60 // 秒
|
||||||
|
// 4. 格式化:HH/MM/SS 均补0为2位(如 1小时1分5秒 → 01:01:05)
|
||||||
|
return String.format("%02d:%02d:%02d", hours, minutes, seconds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@
|
|||||||
android:paddingHorizontal="@dimen/dp_38"
|
android:paddingHorizontal="@dimen/dp_38"
|
||||||
android:paddingTop="@dimen/dp_12"
|
android:paddingTop="@dimen/dp_12"
|
||||||
android:paddingBottom="@dimen/dp_7"
|
android:paddingBottom="@dimen/dp_7"
|
||||||
android:text="我的家庭"
|
android:text="家族成员"
|
||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|||||||
@@ -163,7 +163,7 @@
|
|||||||
android:paddingHorizontal="@dimen/dp_38"
|
android:paddingHorizontal="@dimen/dp_38"
|
||||||
android:paddingTop="@dimen/dp_12"
|
android:paddingTop="@dimen/dp_12"
|
||||||
android:paddingBottom="@dimen/dp_7"
|
android:paddingBottom="@dimen/dp_7"
|
||||||
android:text="我的家庭"
|
android:text="家族成员"
|
||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_14"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ isBuildModule=false
|
|||||||
#org.gradle.deamon=false
|
#org.gradle.deamon=false
|
||||||
android.injected.testOnly=false
|
android.injected.testOnly=false
|
||||||
|
|
||||||
APP_VERSION_NAME=1.0.7.2
|
APP_VERSION_NAME=1.0.7.3
|
||||||
APP_VERSION_CODE=62
|
APP_VERSION_CODE=63
|
||||||
|
|
||||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||||
|
|||||||
Reference in New Issue
Block a user