fix: bugfix
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -934,12 +934,22 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
|
||||
//todo do - 发送图片消息
|
||||
private fun sendImgMsg() {
|
||||
if (VipHelper.roomPicScreen(UserModel.get().cacheLoginUserInfo)) {
|
||||
activity?.let {
|
||||
PhotoPickActivity.startImg(it)
|
||||
}
|
||||
} else {
|
||||
dialogManager?.showOkDialog(R.string._ver_24_sentImgVipError.getString())
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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()) {
|
||||
message = ResourcesKtxKt.getString(R.string._ver_24_cpInRoomTips, cpNickStr,cpNameStr, nickStr);
|
||||
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);
|
||||
}
|
||||
textStyles.add(cpNick);
|
||||
textStyles.add(nick);
|
||||
|
||||
} else if (data.isCpUpMic()) {
|
||||
message = ResourcesKtxKt.getString(R.string._ver_24_cpUpMicTips, cpNameStr, nickStr,cpNickStr);
|
||||
|
@@ -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()
|
||||
|
||||
}
|
||||
|
@@ -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 {
|
||||
binding.tvDiamondTab.visibility = View.GONE
|
||||
binding.groupDiamond.visibility = View.GONE
|
||||
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
|
||||
|
@@ -144,34 +144,44 @@ object RoomHelperManager {
|
||||
fun sendPicMsg(fragment: BaseRoomFragment<*, *>, data: Intent?) {
|
||||
fragment?.context?.let { context ->
|
||||
data?.data?.let { uri ->
|
||||
val date = Date(System.currentTimeMillis())
|
||||
val dateFormat = SimpleDateFormat("MMddHHmmssSS")
|
||||
val nowTime = dateFormat.format(date)
|
||||
val localeUri = Uri.parse("file://${FileHelper.getRootCacheDir()?.path}/${nowTime}.jpg")
|
||||
try {
|
||||
val date = Date(System.currentTimeMillis())
|
||||
val dateFormat = SimpleDateFormat("MMddHHmmssSS")
|
||||
val nowTime = dateFormat.format(date)
|
||||
val localeUri = Uri.parse("file://${FileHelper.getRootCacheDir()?.path}/${nowTime}.jpg")
|
||||
|
||||
val isCopy = MyUriUtils.copyFileToUrl(context, uri, localeUri)
|
||||
if (isCopy) {
|
||||
if (MyUriUtils.isGif(context, localeUri)) {
|
||||
ToastUtils.show(R.string.error_file_type)
|
||||
val isCopy = MyUriUtils.copyFileToUrl(context, uri, localeUri)
|
||||
if (isCopy) {
|
||||
if (MyUriUtils.isGif(context, localeUri)) {
|
||||
ToastUtils.show(R.string.error_file_type)
|
||||
} else {
|
||||
FileModel.get().uploadFile(localeUri.path)
|
||||
.compose(fragment.bindToLifecycle())
|
||||
.doOnSuccess { ossUrl ->
|
||||
"图片上传oss成功".doToastDeBug()
|
||||
try {
|
||||
postSendPic(AvRoomDataManager.get().roomUid, ossUrl)
|
||||
.compose(fragment.bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
R.string.sent_success.doToast()
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}
|
||||
.subscribe()
|
||||
} catch (e: Exception) {
|
||||
R.string.avroom_activity_roomblacklistactivity_015.doToast()
|
||||
}
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
}
|
||||
} else {
|
||||
FileModel.get().uploadFile(localeUri.path)
|
||||
.compose(fragment.bindToLifecycle())
|
||||
.doOnSuccess { ossUrl ->
|
||||
"图片上传oss成功".doToastDeBug()
|
||||
postSendPic(AvRoomDataManager.get().roomUid, ossUrl)
|
||||
.compose(fragment.bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
R.string.sent_success.doToast()
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}
|
||||
.subscribe()
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.doToast()
|
||||
}.subscribe()
|
||||
R.string.avroom_activity_roomblacklistactivity_015.doToast()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
R.string.avroom_activity_roomblacklistactivity_015.doToast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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" />
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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" />
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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 & %3$s كلاهما على الميكروفون!</string>
|
||||
<string name="_ver_24_lucky_bag_room_notify_coin">نرسل حقيبة الحظ عملة! تعال وانضم إلينا!</string>
|
||||
<string name="Sweet_Duo">ثنائي رائع</string>
|
||||
|
@@ -158,9 +158,16 @@ object MyUriUtils {
|
||||
try {
|
||||
val contentResolver = context.contentResolver
|
||||
contentResolver?.openInputStream(uri)?.use { uriStream ->
|
||||
contentResolver?.openOutputStream(outUri, "wt")?.use { outStream ->
|
||||
uriStream.copyTo(outStream)
|
||||
return true
|
||||
try {
|
||||
contentResolver?.openOutputStream(outUri, "wt")?.use { outStream ->
|
||||
try {
|
||||
uriStream.copyTo(outStream)
|
||||
return true
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
@@ -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,11 +130,19 @@ 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) {
|
||||
this.setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
|
||||
if (minSize != null && maxSize != null) {
|
||||
this.setAutoSizeTextTypeUniformWithConfiguration(minSize, maxSize, 1, TypedValue.COMPLEX_UNIT_SP)
|
||||
} else {
|
||||
this.setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
|
||||
}
|
||||
} else {
|
||||
TextViewCompat.setAutoSizeTextTypeWithDefaults(this,TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM)
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user