fix: bugfix

This commit is contained in:
eggmanQQQ
2025-03-03 15:26:59 +08:00
parent 201c12d381
commit 47aa4a078b
15 changed files with 124 additions and 72 deletions

View File

@@ -115,7 +115,7 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
if (mIsGiftReview) {
if (position.isVerify(mGiftDataSelect)) {
val data = mGiftDataSelect[position]
data.count = data.count.plus(1)
data.count = data.count.plus(1).coerceAtMost(99)
mGiftAdapter.notifyItemChanged(position,1)
mGiftDataSelectPos.forEach { (t, u) ->
if (u.giftId == data.giftId) {
@@ -128,7 +128,7 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
}else{
if (position.isVerify(mGiftData)) {
val data = mGiftData[position]
data.count = data.count.plus(1)
data.count = data.count.plus(1).coerceAtMost(99)
mGiftAdapter.notifyItemChanged(position,1)
mGiftDataSelectPos[position] = data
}

View File

@@ -934,14 +934,24 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
//todo do - 发送图片消息
private fun sendImgMsg() {
if (VipHelper.roomPicScreen(UserModel.get().cacheLoginUserInfo)) {
activity?.let {
PhotoPickActivity.startImg(it)
UserModel.get().cacheLoginUserInfo?.let {
UserModel.get().getUserInfoFromServerUpdate(it.uid,true)
.compose(bindToLifecycle())
.doOnSuccess { user->
if (VipHelper.roomPicScreen(user)) {
activity?.let { act->
PhotoPickActivity.startImg(act)
}
} else {
dialogManager?.showOkDialog(R.string._ver_24_sentImgVipError.getString())
}
}
.doOnError {
it?.message?.doToast()
}
.subscribe()
}
}
@SuppressLint("CheckResult")
fun sendMsg(msg: String) {

View File

@@ -1750,7 +1750,7 @@ public class MessageView extends FrameLayout {
TextView tvCpContent = baseViewHolder.itemView.findViewById(R.id.cpTv);
if (tvContent != null && tvCpContent != null ) {
OtherExtKt.setAutoSizeModel(tvCpContent);
OtherExtKt.setAutoSizeModel(tvCpContent,8,14);
TextSpannableBuilder text = new TextSpannableBuilder(tvContent);
MsgAttachment attachment = chatRoomMessage.getAttachment();
@@ -1886,16 +1886,15 @@ public class MessageView extends FrameLayout {
if (data.isCpInRoom()) {
if (OtherExtKt.isRtl(getContext())) {
message = ResourcesKtxKt.getString(R.string._ver_24_cpInRoomTips, cpNickStr, nickStr,cpNameStr);
} else {
message = ResourcesKtxKt.getString(R.string._ver_24_cpInRoomTips, cpNickStr,cpNameStr, nickStr);
}
tvCpContent.setBackgroundResource(R.drawable.ic_msg_room_msg_cp_bg_enter);
if (OtherExtKt.isRtl(tvCpContent.getContext())) {
textStyles.add(cpNick);
textStyles.add(nick);
} else {
textStyles.add(cpNick);
textStyles.add(nick);
}
} else if (data.isCpUpMic()) {
message = ResourcesKtxKt.getString(R.string._ver_24_cpUpMicTips, cpNameStr, nickStr,cpNickStr);

View File

@@ -8,7 +8,6 @@ import com.chwl.app.R
import com.chwl.app.application.IReportConstants
import com.chwl.app.application.ReportManager
import com.chwl.app.avroom.adapter.CommonVPAdapter
import com.chwl.app.avroom.dialog.RoomLuckyBagDialog
import com.chwl.app.base.BaseViewBindingFragment
import com.chwl.app.databinding.FragmentHomeBinding
import com.chwl.app.home.adapter.HomeIndicatorAdapter
@@ -16,7 +15,6 @@ import com.chwl.app.ui.search.SearchActivity
import com.chwl.app.ui.widget.magicindicator.ViewPagerHelper
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
import com.chwl.app.utils.HomeUIManager
import com.chwl.app.utils.RoomHelperManager
import com.chwl.core.DemoCache
/**
@@ -44,11 +42,9 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
// val i = 1/0
// DemoActivity.start(it)
RoomHelperManager.test {
RoomLuckyBagDialog().show(context)
}
// R.string._ver_24_cpInRoomTips.getString("string-1", "string-2", "string-3").doToastDeBug()
// R.string._ver_24_cpUpMicTips.getString("string-1", "string-2", "string-3").doToastDeBug()
// RoomHelperManager.test {
// RoomLuckyBagDialog().show(context)
// }
// GiftDialog(it,3224,false,false,false).show()
}

View File

@@ -85,27 +85,33 @@ class GiveGoldToUserActivity : BaseViewBindingActivity<ActivityGiveGoldToUserBin
}
val initInfo = InitialModel.get().cacheInitInfo
val userInfo = UserModel.get().cacheLoginUserInfo
val diamondList = initInfo?.giveDiamondErbanNoList
val giftList = initInfo?.giveGiftErbanNoList
val diamondList = initInfo?.giveDiamondErbanNoList //金币
val giftList = initInfo?.giveGiftErbanNoList // ,礼物
val levelSep = userInfo?.userLevelVo?.experLevelSeq ?: 0
if (diamondList?.contains(userInfo?.erbanNo) == true || levelSep >= (initInfo?.giveDiamondExperLevel
?: 0)
) {
if (userInfo?.isRechargeUser == true) {
binding.tvDiamondTab.visibility = View.VISIBLE
binding.groupDiamond.visibility = View.VISIBLE
} else {
if (diamondList?.contains(userInfo?.erbanNo) == true || levelSep >= (initInfo?.giveDiamondExperLevel ?: 0)) {
binding.tvDiamondTab.visibility = View.VISIBLE
binding.groupDiamond.visibility = View.VISIBLE
} else {
binding.tvDiamondTab.visibility = View.GONE
binding.groupDiamond.visibility = View.GONE
}
if (giftList?.contains(userInfo?.erbanNo) == true || levelSep >= (initInfo?.giveGiftExperLevel
?: 0)
) {
}
if (giftList?.contains(userInfo?.erbanNo) == true || levelSep >= (initInfo?.giveGiftExperLevel ?: 0)) {
binding.tvGiftTab.visibility = View.VISIBLE
binding.groupGift.visibility = View.VISIBLE
} else {
binding.tvGiftTab.visibility = View.GONE
binding.groupGift.visibility = View.GONE
}
binding.viewPagerEntrance.addOnPageChangeListener(object : OnPageSelectedListener() {
override fun onPageSelected(position: Int) {
centerIndex = position

View File

@@ -144,6 +144,7 @@ object RoomHelperManager {
fun sendPicMsg(fragment: BaseRoomFragment<*, *>, data: Intent?) {
fragment?.context?.let { context ->
data?.data?.let { uri ->
try {
val date = Date(System.currentTimeMillis())
val dateFormat = SimpleDateFormat("MMddHHmmssSS")
val nowTime = dateFormat.format(date)
@@ -158,6 +159,7 @@ object RoomHelperManager {
.compose(fragment.bindToLifecycle())
.doOnSuccess { ossUrl ->
"图片上传oss成功".doToastDeBug()
try {
postSendPic(AvRoomDataManager.get().roomUid, ossUrl)
.compose(fragment.bindToLifecycle())
.doOnSuccess {
@@ -167,11 +169,19 @@ object RoomHelperManager {
it?.message?.doToast()
}
.subscribe()
} catch (e: Exception) {
R.string.avroom_activity_roomblacklistactivity_015.doToast()
}
}
.doOnError {
it?.message?.doToast()
}.subscribe()
}
} else {
R.string.avroom_activity_roomblacklistactivity_015.doToast()
}
} catch (e: Exception) {
R.string.avroom_activity_roomblacklistactivity_015.doToast()
}
}
}

View File

@@ -72,6 +72,8 @@
app:borderColor="#ffd168"
app:borderRadius="50dp"
app:borderWidth="2dp"
android:padding="2dp"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tabLayout" />

View File

@@ -21,7 +21,9 @@
android:layout_height="77dp"
app:borderColor="@color/color_FFEA5C"
app:borderWidth="1dp"
android:padding="1dp"
app:borderRadius="50dp"
android:scaleType="centerCrop"
android:src="@drawable/default_avatar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -17,11 +17,15 @@
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toStartOf="@+id/tv_pay_diamond"
android:layout_marginStart="10dp"
android:textColor="@color/color_1F1A4E"
android:textSize="14sp"
android:lines="1"
android:ellipsize="end"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/erBanNo"

View File

@@ -16,12 +16,15 @@
<com.chwl.core.widget.img.MyCircleImageView
android:id="@+id/avatar"
android:layout_width="26dp"
android:src="@drawable/default_avatar"
android:layout_height="26dp"
android:layout_marginStart="9dp"
android:scaleType="centerCrop"
android:layout_marginTop="9dp"
app:borderColor="@color/color_FFEA5C"
app:borderRadius="50dp"
app:borderWidth="1dp"
app:borderRadius="25dp"
android:padding="1dp"
app:borderWidth="2dp"
app:layout_constraintStart_toStartOf="@id/bg"
app:layout_constraintTop_toTopOf="@id/bg" />

View File

@@ -15,7 +15,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@android:color/white"
android:textSize="15sp"
android:textSize="@dimen/sp_15"
tools:text="@string/layout_list_item_chatrrom_msg_01"
tools:textColor="#000" />
@@ -29,7 +29,7 @@
app:layout_constraintStart_toStartOf="parent"
android:gravity="start|center_vertical"
android:textColor="@android:color/white"
android:textSize="13sp"
android:textSize="@dimen/sp_13"
android:maxLines="2"
android:ellipsize="end"
android:paddingStart="9dp"

View File

@@ -12,10 +12,14 @@
android:layout_width="match_parent"
android:layout_height="100dp"/>
<ImageView
<com.chwl.core.widget.img.MyCircleImageView
android:id="@+id/avatar"
android:layout_width="36dp"
android:layout_height="36dp"
app:borderColor="#ffd168"
app:borderWidth="2dp"
app:borderRadius="25dp"
android:padding="1dp"
android:layout_marginStart="18dp"
android:layout_marginBottom="7dp"
android:src="@drawable/default_avatar"

View File

@@ -5406,7 +5406,7 @@
<string name="_ver_24_lucky_bag_bili_sent">أرسلت حقيبة الحظ</string>
<string name="_ver_24_Mins_s">دقائق</string>
<string name="_ver_24_cpInRoomTips">لقد دخل %2$s %3$s من %1$s إلى الغرفة.</string>
<string name="_ver_24_cpInRoomTips">لقد دخل %s %s من %s إلى الغرفة.</string>
<string name="_ver_24_cpUpMicTips">%1$s %2$s &amp; %3$s كلاهما على الميكروفون!</string>
<string name="_ver_24_lucky_bag_room_notify_coin">نرسل حقيبة الحظ عملة! تعال وانضم إلينا!</string>
<string name="Sweet_Duo">ثنائي رائع</string>

View File

@@ -158,9 +158,16 @@ object MyUriUtils {
try {
val contentResolver = context.contentResolver
contentResolver?.openInputStream(uri)?.use { uriStream ->
try {
contentResolver?.openOutputStream(outUri, "wt")?.use { outStream ->
try {
uriStream.copyTo(outStream)
return true
} catch (e: Exception) {
}
}
} catch (e: Exception) {
}
}
} catch (e: Exception) {

View File

@@ -5,6 +5,7 @@ import android.graphics.Color
import android.os.Build
import android.text.Spannable
import android.util.Log
import android.util.TypedValue
import android.view.View
import android.view.ViewGroup
import android.view.ViewGroup.MarginLayoutParams
@@ -129,13 +130,21 @@ fun TextView.setString(str:String) {
this.text = str
}
fun TextView.setAutoSizeModel() {
fun TextView.setAutoSizeModel(minSize:Int?=null,maxSize:Int?=null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (minSize != null && maxSize != null) {
this.setAutoSizeTextTypeUniformWithConfiguration(minSize, maxSize, 1, TypedValue.COMPLEX_UNIT_SP)
} else {
this.setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
}
} else {
if (minSize != null && maxSize != null) {
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(this,minSize, maxSize, 1, TypedValue.COMPLEX_UNIT_SP)
} else {
TextViewCompat.setAutoSizeTextTypeWithDefaults(this,TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM)
}
}
}
fun String?.isVerify() : Boolean {