feat : 代理相关功能 接入 接口
This commit is contained in:
@@ -929,6 +929,14 @@
|
||||
android:name=".pay.activity.GiveGoldActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".pay.activity.GiveGoldAgentsActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".pay.activity.GiveGoldBiliActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
<activity
|
||||
android:name=".pay.activity.GiveGoldDetailActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
@@ -100,7 +100,7 @@ import com.chwl.core.user.event.LoadLoginUserInfoEvent;
|
||||
import com.chwl.core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.chwl.core.user.event.NeedBindPhoneEvent;
|
||||
import com.chwl.core.user.event.NeedCompleteInfoEvent;
|
||||
import com.chwl.core.utils.MyUtil;
|
||||
import com.chwl.core.utils.myutil.MyUtil;
|
||||
import com.chwl.core.utils.SharedPreferenceUtils;
|
||||
import com.chwl.core.utils.StringFormatUtils;
|
||||
import com.chwl.core.utils.WLog;
|
||||
|
@@ -55,7 +55,7 @@ import com.chwl.core.room.model.RoomSettingModel;
|
||||
import com.chwl.core.room.queue.bean.MicMemberInfo;
|
||||
import com.chwl.core.super_admin.util.SuperAdminUtil;
|
||||
import com.chwl.core.utils.LogUtils;
|
||||
import com.chwl.core.utils.MyUriUtils;
|
||||
import com.chwl.core.utils.myutil.MyUriUtils;
|
||||
import com.chwl.core.utils.net.BeanObserver;
|
||||
import com.chwl.core.utils.net.DontWarnObserver;
|
||||
import com.chwl.core.utils.net.RxHelper;
|
||||
|
@@ -22,7 +22,7 @@ import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.gift.bean.RoomBgInfo
|
||||
import com.chwl.core.gift.bean.RoomBgInfoItem
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.utils.MyUriUtils
|
||||
import com.chwl.core.utils.myutil.MyUriUtils
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.setVis
|
||||
|
@@ -7,7 +7,7 @@ import com.chwl.app.avroom.helper.AnimHelper
|
||||
import com.chwl.app.databinding.RoomNotifyCpLevelUpBinding
|
||||
import com.chwl.app.ui.utils.CpUtils
|
||||
import com.chwl.core.gift.bean.CpMsgBean
|
||||
import com.chwl.core.utils.SpanUtils
|
||||
import com.chwl.core.utils.myutil.MySpanUtils
|
||||
import com.example.lib_utils.ktx.getColor
|
||||
import com.example.lib_utils.ktx.getString
|
||||
import com.opensource.svgaplayer.SVGADrawable
|
||||
@@ -26,7 +26,7 @@ class RoomNotifyLevelUpDialog (private val context: Context) : BaseRoomNotifyDia
|
||||
|
||||
override fun init() {
|
||||
cpMsgBean?.let {
|
||||
SpanUtils.with(mBinding.text)
|
||||
MySpanUtils.with(mBinding.text)
|
||||
.append(" ${it.senderNick} ").setForegroundColor(R.color.white.getColor())
|
||||
.append(" ${R.string.avroom_widget_roomeffectview_02.getString()} ").setForegroundColor(R.color.color_fff664.getColor())
|
||||
.append(" ${it.receiverNick} ").setForegroundColor(R.color.white.getColor())
|
||||
|
@@ -141,10 +141,12 @@ import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.user.bean.BaseInfo
|
||||
import com.chwl.core.user.bean.UserInfo
|
||||
import com.chwl.core.utils.LogUtils
|
||||
import com.chwl.core.utils.myutil.MyUtil
|
||||
import com.chwl.core.utils.net.VipLevelNotEnoughException
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.LimitClickUtils
|
||||
import com.chwl.library.common.util.doLog
|
||||
import com.chwl.library.common.util.doToast
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.postSafe
|
||||
import com.chwl.library.common.util.setMargin
|
||||
@@ -1197,6 +1199,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
|
||||
override fun onUpMicBtnClick(position: Int, chatRoomMember: MicMemberInfo?) {
|
||||
if (MyUtil.upMicIng) {
|
||||
"上麦 , 点击频繁限制".doLog()
|
||||
R.string.avroom_dialog_micqueuedialog_01.doToast()
|
||||
return
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().isDatingVipMic(position) && !AvRoomDataManager.get().isDatingVip(AuthModel.get().currentUid)) {
|
||||
DatingVipRuleDialog.newInstance(mContext).show()
|
||||
} else {
|
||||
|
@@ -22,7 +22,7 @@ import com.chwl.app.ui.utils.ImageLoadUtilsV2
|
||||
import com.chwl.app.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
|
||||
import com.chwl.core.Constants
|
||||
import com.chwl.core.gift.bean.GiftInfo
|
||||
import com.chwl.core.utils.MyUriUtils
|
||||
import com.chwl.core.utils.myutil.MyUriUtils
|
||||
import com.chwl.library.common.util.PhotoCompressUtil.compress
|
||||
import com.chwl.library.common.util.PhotoCompressUtil.getCompressCachePath
|
||||
import com.chwl.library.common.util.PhotosCompressCallback
|
||||
|
@@ -181,7 +181,7 @@ import com.chwl.core.treasurefairy.bean.FairyMsgInfoBean;
|
||||
import com.chwl.core.user.UserModel;
|
||||
import com.chwl.core.user.bean.UserInfo;
|
||||
import com.chwl.core.utils.ExtensionUtil;
|
||||
import com.chwl.core.utils.JsonUtils;
|
||||
import com.chwl.core.utils.myutil.MyJsonUtils;
|
||||
import com.chwl.core.utils.LogUtils;
|
||||
import com.chwl.core.utils.extension.StringExtensionKt;
|
||||
import com.chwl.core.utils.net.DontWarnObserver;
|
||||
@@ -3202,7 +3202,7 @@ public class MessageView extends FrameLayout {
|
||||
if (o != null) {
|
||||
String json = JSON.toJSONString(o);
|
||||
// OtherExtKt.doLog(json);
|
||||
String nick = JsonUtils.getString(json, UserInfo.NICK, "");
|
||||
String nick = MyJsonUtils.getString(json, UserInfo.NICK, "");
|
||||
if (OtherExtKt.isVerify(nick)) {
|
||||
senderNick = nick;
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ import com.chwl.app.support.float.BaseFloatView
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils
|
||||
import com.chwl.app.ui.widget.dialog.AllServiceGiftGoRoomTipsDialog
|
||||
import com.chwl.core.noble.bean.AllServiceGiftProtocol
|
||||
import com.chwl.core.utils.SpanUtils
|
||||
import com.chwl.core.utils.myutil.MySpanUtils
|
||||
import com.example.lib_utils.ktx.getColorById
|
||||
import com.example.lib_utils.ktx.getDimension
|
||||
import com.example.lib_utils.ktx.singleClick
|
||||
@@ -73,7 +73,7 @@ class GiftNotify(context: Context) : BaseFloatView(context) {
|
||||
setupTextMarquee(binding.tvNames)
|
||||
|
||||
|
||||
SpanUtils.with(binding.tvGiftCount)
|
||||
MySpanUtils.with(binding.tvGiftCount)
|
||||
.append(data.giftName).setFontSize(R.dimen.sp_11.getDimension().toInt(),false)
|
||||
.append(" X")
|
||||
.append(data.giftNum.toString()).setFontSize(17,true).setBold()
|
||||
|
@@ -161,21 +161,19 @@ class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
|
||||
binding.starLayout.addView(star)
|
||||
}
|
||||
|
||||
if (it.usCoin != -1L) {
|
||||
if (UserModel.get().isArUser) {
|
||||
binding.arView.setVis(true)
|
||||
binding.enView.setVis(false)
|
||||
|
||||
} else {
|
||||
binding.arView.setVis(false)
|
||||
binding.enView.setVis(true)
|
||||
|
||||
}
|
||||
|
||||
binding.arUs.text = it.usCoin.toString()
|
||||
binding.arCoin.text = it.enCoin.toString()
|
||||
binding.enCoin.text = it.enCoin.toString()
|
||||
binding.arGoldUs.text = it.totalGiveGoldUsd.toString()
|
||||
binding.arGold.text = it.totalGiveGold.toString()
|
||||
binding.enGold.text = it.totalGiveGold.toString()
|
||||
|
||||
binding.agentNum.text = it.agentNum.toString()
|
||||
binding.agentNum.text = it.subNum.toString()
|
||||
|
||||
}
|
||||
}.subscribe()
|
||||
@@ -199,7 +197,7 @@ class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
|
||||
binding.enDetail.click {
|
||||
GiveGoldBiliActivity.start(context)
|
||||
}
|
||||
binding.agentNum.click {
|
||||
binding.agent.click {
|
||||
GiveGoldAgentsActivity.start(context)
|
||||
}
|
||||
|
||||
|
@@ -2,18 +2,23 @@ package com.chwl.app.pay.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.widget.ImageView
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseViewBindingActivity
|
||||
import com.chwl.app.bindadapter.BaseBindingAdapter
|
||||
import com.chwl.app.common.EmptyViewHelper
|
||||
import com.chwl.app.databinding.ActivityGiveGoldAgentsBinding
|
||||
import com.chwl.app.databinding.ItemGiveGoldAgentBinding
|
||||
import com.chwl.app.ui.bean.GiveGoldAgentBean
|
||||
import com.chwl.app.ui.bean.RechargeUserInfo
|
||||
import com.chwl.app.ui.utils.loadAvatar
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.utils.extension.toast
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setViewWH
|
||||
import com.chwl.library.net.rxnet.RxNet
|
||||
import com.example.lib_utils.ktx.getString
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import io.reactivex.Single
|
||||
import retrofit2.http.GET
|
||||
|
||||
@@ -27,6 +32,17 @@ class GiveGoldAgentsActivity : BaseViewBindingActivity<ActivityGiveGoldAgentsBin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
|
||||
override fun needSteepStateBar(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
private lateinit var mAdapter : GiveGoldAgentsAdapter
|
||||
|
||||
override fun init() {
|
||||
@@ -34,12 +50,14 @@ class GiveGoldAgentsActivity : BaseViewBindingActivity<ActivityGiveGoldAgentsBin
|
||||
initWhiteTitleBar(R.string._ver_23_Sub_Recharge_Agent_List.getString())
|
||||
|
||||
mAdapter = GiveGoldAgentsAdapter()
|
||||
mAdapter.emptyView = EmptyViewHelper.createEmptyTextView(context,R.string.empty_data.getString())
|
||||
binding.rvList.adapter = mAdapter
|
||||
|
||||
getRechargeUserInfo().compose(bindToLifecycle())
|
||||
getSubList().compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
|
||||
|
||||
if (it.isVerify()) {
|
||||
mAdapter.setNewData(it)
|
||||
}
|
||||
}
|
||||
.doOnError {
|
||||
it?.message?.toast()
|
||||
@@ -49,30 +67,37 @@ class GiveGoldAgentsActivity : BaseViewBindingActivity<ActivityGiveGoldAgentsBin
|
||||
}
|
||||
|
||||
|
||||
public class GiveGoldAgentsAdapter : BaseBindingAdapter<ItemGiveGoldAgentBinding, GiveGoldAgentBean>() {
|
||||
private class GiveGoldAgentsAdapter : BaseBindingAdapter<ItemGiveGoldAgentBinding, GiveGoldAgentBean>() {
|
||||
|
||||
override fun onBindView(viewBinding: ItemGiveGoldAgentBinding, data: GiveGoldAgentBean, pos: Int) {
|
||||
|
||||
viewBinding.avatar
|
||||
viewBinding.nick
|
||||
viewBinding.erBanNo
|
||||
viewBinding.starLayout
|
||||
viewBinding.time
|
||||
viewBinding.coin
|
||||
viewBinding.avatar.loadAvatar(data.avatar?:"")
|
||||
viewBinding.nick.text = data.nick?:""
|
||||
viewBinding.erBanNo.text = data.erbanNo.toString()
|
||||
|
||||
viewBinding.starLayout.removeAllViews()
|
||||
for (i in 0 until 5) {
|
||||
val star = ImageView(viewBinding.starLayout.context)
|
||||
star.setViewWH(15, 15)
|
||||
star.setImageResource( if (i < data.starLevel) R.drawable.icon_star_s else R.drawable.icon_star_n)
|
||||
viewBinding.starLayout.addView(star)
|
||||
}
|
||||
|
||||
viewBinding.coin.text = data.totalGiveGold.toString()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getRechargeUserInfo(): Single<RechargeUserInfo> {
|
||||
return api.getRechargeUserInfo()
|
||||
private fun getSubList(): Single<List<GiveGoldAgentBean>> {
|
||||
return api.getSubList()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private val api: Api = RxNet.create(Api::class.java);
|
||||
interface Api {
|
||||
@GET("/recharge/user/info")
|
||||
fun getRechargeUserInfo(): Single<ServiceResult<RechargeUserInfo>>
|
||||
@GET("/recharge/user/subList")
|
||||
fun getSubList(): Single<ServiceResult<List<GiveGoldAgentBean>>>
|
||||
}
|
||||
|
||||
}
|
@@ -2,28 +2,35 @@ package com.chwl.app.pay.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chwl.app.avroom.bean.LuckyBagDetailEntity.BiliType.RECEIVED
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseViewBindingActivity
|
||||
import com.chwl.app.bindadapter.BaseBindingAdapter
|
||||
import com.chwl.app.common.EmptyViewHelper
|
||||
import com.chwl.app.databinding.ActivityGiveGoldBiliBinding
|
||||
import com.chwl.app.databinding.ItemGiveGoldBiliBinding
|
||||
import com.chwl.app.ui.bean.GiveGoldBiliBean
|
||||
import com.chwl.app.ui.bean.RechargeUserInfo
|
||||
import com.chwl.app.ui.bean.GiveGoldBiliEntity
|
||||
import com.chwl.app.ui.utils.loadAvatar
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.utils.myutil.MyTimeUtils
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.doToast
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.net.rxnet.RxNet
|
||||
import com.example.lib_utils.ktx.getColor
|
||||
import com.example.lib_utils.ktx.getDrawable
|
||||
import com.example.lib_utils.ktx.getString
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadmoreListener
|
||||
import io.reactivex.Single
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Query
|
||||
|
||||
class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding>() {
|
||||
|
||||
@@ -37,7 +44,7 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
|
||||
|
||||
lateinit var mAdapter: GiveGoldBiliAdapter
|
||||
private var mCycle = -1;
|
||||
private var mTab = -1;
|
||||
private var mTabType = -1;
|
||||
|
||||
private var mDataThisCycleEn = mutableListOf<GiveGoldBiliBean>()
|
||||
private var mDataThisCycleAR = mutableListOf<GiveGoldBiliBean>()
|
||||
@@ -51,100 +58,145 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
|
||||
|
||||
override fun init() {
|
||||
|
||||
initWhiteTitleBar(R.string._ver_23_Transfer_History.getString())
|
||||
|
||||
binding.thisCycle.click {
|
||||
switchCycle(it)
|
||||
switchCycle(GiveGoldBiliEntity.Cycle.thisCycle)
|
||||
}
|
||||
binding.LastCycle.click {
|
||||
switchCycle(it)
|
||||
binding.lastCycle.click {
|
||||
switchCycle(GiveGoldBiliEntity.Cycle.lastCycle)
|
||||
}
|
||||
binding.btnUs.click {
|
||||
switchTab(it)
|
||||
binding.btnGoldUs.click {
|
||||
switchTab(GiveGoldBiliEntity.TabType.gold)
|
||||
}
|
||||
binding.btnEn.click {
|
||||
switchTab(it)
|
||||
binding.btnGold.click {
|
||||
switchTab(GiveGoldBiliEntity.TabType.goldUs)
|
||||
}
|
||||
|
||||
binding.tabLayout.setVis(UserModel.get().isArUser)
|
||||
|
||||
binding.time
|
||||
binding.totalCoin
|
||||
|
||||
binding.srlLayout.setOnRefreshLoadmoreListener(object : OnRefreshLoadmoreListener {
|
||||
override fun onRefresh(p0: RefreshLayout?) {
|
||||
|
||||
}
|
||||
|
||||
override fun onLoadmore(p0: RefreshLayout?) {
|
||||
|
||||
loadData()
|
||||
}
|
||||
})
|
||||
mAdapter = GiveGoldBiliAdapter()
|
||||
binding.rvList.layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
|
||||
binding.rvList.adapter = mAdapter
|
||||
mAdapter.emptyView = EmptyViewHelper.createEmptyTextView(context,R.string.empty_data.getString())
|
||||
|
||||
|
||||
binding.tabLayout.setVis(UserModel.get().isArUser)
|
||||
|
||||
|
||||
binding.thisCycle.performClick()
|
||||
if (UserModel.get().isArUser) {
|
||||
binding.btnGoldUs.performClick()
|
||||
} else {
|
||||
binding.btnGold.performClick()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun switchCycle(view: View) {
|
||||
if (mCycle == view.id) return
|
||||
mCycle = view.id
|
||||
private fun switchCycle(type: Int) {
|
||||
if (mCycle == type) return
|
||||
binding.thisCycle.setDrawableEmpty(null,null,null,if (type == GiveGoldBiliEntity.Cycle.thisCycle) R.drawable.e29030_fcc974_draw.getDrawable() else R.drawable.transparent_draw.getDrawable())
|
||||
binding.lastCycle.setDrawableEmpty(null,null,null,if (type == GiveGoldBiliEntity.Cycle.lastCycle) R.drawable.e29030_fcc974_draw.getDrawable() else R.drawable.transparent_draw.getDrawable())
|
||||
|
||||
binding.thisCycle.setTextColor(if (type == GiveGoldBiliEntity.Cycle.thisCycle) R.color.color_313131.getColor() else R.color.color_AFB1B3.getColor())
|
||||
binding.lastCycle.setTextColor(if (type == GiveGoldBiliEntity.Cycle.lastCycle) R.color.color_313131.getColor() else R.color.color_AFB1B3.getColor())
|
||||
|
||||
mCycle = type
|
||||
mAdapter.mCycle = type
|
||||
loadData()
|
||||
}
|
||||
|
||||
private fun switchTab(view: View) {
|
||||
if (mTab == view.id) return
|
||||
mTab = view.id
|
||||
private fun switchTab(type: Int) {
|
||||
if (mTabType == type) return
|
||||
binding.btnGoldUs.changeSoildColor(if (type == GiveGoldBiliEntity.TabType.gold) R.color.color_ff8c03.getColor() else R.color.transparent.getColor())
|
||||
binding.btnGold.changeSoildColor(if (type == GiveGoldBiliEntity.TabType.goldUs) R.color.color_ff8c03.getColor() else R.color.transparent.getColor())
|
||||
|
||||
binding.btnGoldUs.setTextColor(if (type == GiveGoldBiliEntity.TabType.gold) R.color.white.getColor() else R.color.color_AFB1B3.getColor())
|
||||
binding.btnGold.setTextColor(if (type == GiveGoldBiliEntity.TabType.goldUs) R.color.white.getColor() else R.color.color_AFB1B3.getColor())
|
||||
|
||||
mTabType = type
|
||||
mAdapter.mTabType = type
|
||||
loadData()
|
||||
}
|
||||
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
|
||||
override fun needSteepStateBar(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
private fun loadData() {
|
||||
if (mCycle == -1 && mTab == -1) return
|
||||
if (mCycle == -1 && mTabType == -1) return
|
||||
val data = getData(arrayListOf())
|
||||
if (data.isVerify()) {
|
||||
mAdapter.setNewData(data)
|
||||
} else {
|
||||
getRechargeUserInfo(getPageNum(), mCycle, mTab)
|
||||
getHistory(getPageNum(),20, mTabType, mCycle)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
|
||||
if (getPageNum() == 1) {
|
||||
mAdapter.setNewData(getData(arrayListOf()))
|
||||
} else {
|
||||
mAdapter.addData(getData(arrayListOf()))
|
||||
}
|
||||
binding.time.text = it.cycleDateStr?:""
|
||||
binding.totalCoin.text = if (mTabType == GiveGoldBiliEntity.TabType.gold) it.totalGiveGold.toString() else it.totalGiveGoldUsd.toString()
|
||||
|
||||
// if (it.size == 20) {
|
||||
// if (mCycle == binding.thisCycle.id) {
|
||||
// if (mTab == binding.btnEn.id) {
|
||||
// mPageNumThisCycleEn++
|
||||
// } else {
|
||||
// mPageNumThisCycleAR++
|
||||
// }
|
||||
// } else {
|
||||
// if (mTab == binding.btnEn.id) {
|
||||
// mPageNumLastCycleEn++
|
||||
// } else {
|
||||
// mPageNumLastCycleAR++
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// binding.srlLayout.isEnableLoadmore = it.size == 20
|
||||
if (it.diamondGiveHistoryVoList.isVerify()) {
|
||||
if (getPageNum() == 1) {
|
||||
mAdapter.setNewData(getData(it.diamondGiveHistoryVoList))
|
||||
} else {
|
||||
val tranData = tranData(it.diamondGiveHistoryVoList)
|
||||
tranData.isVerify(0){ first->
|
||||
if (mAdapter.data.isVerify()) {
|
||||
val last = mAdapter.data.last()
|
||||
if (last.timeStr == first.timeStr) {
|
||||
first.isHead = false
|
||||
}
|
||||
}
|
||||
}
|
||||
mAdapter.addData(tranData)
|
||||
}
|
||||
|
||||
if (it.diamondGiveHistoryVoList.size == 20) {
|
||||
if (mCycle == binding.thisCycle.id) {
|
||||
if (mTabType == binding.btnGoldUs.id) {
|
||||
mPageNumThisCycleEn++
|
||||
} else {
|
||||
mPageNumThisCycleAR++
|
||||
}
|
||||
} else {
|
||||
if (mTabType == binding.btnGoldUs.id) {
|
||||
mPageNumLastCycleEn++
|
||||
} else {
|
||||
mPageNumLastCycleAR++
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.srlLayout.isEnableLoadmore = it.diamondGiveHistoryVoList.size == 20
|
||||
}
|
||||
binding.srlLayout.finishLoadmore()
|
||||
}
|
||||
.doOnError {
|
||||
|
||||
it?.message?.doToast()
|
||||
binding.srlLayout.finishLoadmore()
|
||||
}.subscribe()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun getData(data: List<GiveGoldBiliBean>): List<GiveGoldBiliBean> {
|
||||
private fun getData(list : List<GiveGoldBiliBean>): List<GiveGoldBiliBean> {
|
||||
val data = tranData(list)
|
||||
|
||||
if (mCycle == binding.thisCycle.id) {
|
||||
if (mTab == binding.btnEn.id) {
|
||||
if (mTabType == binding.btnGoldUs.id) {
|
||||
|
||||
if (data.isVerify()) {
|
||||
if (mDataThisCycleEn.isVerify()) {
|
||||
@@ -169,7 +221,7 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
|
||||
}
|
||||
} else {
|
||||
|
||||
if (mTab == binding.btnEn.id) {
|
||||
if (mTabType == binding.btnGoldUs.id) {
|
||||
if (data.isVerify()) {
|
||||
if (mDataLastCycleEn.isVerify()) {
|
||||
mDataLastCycleEn.addAll(data)
|
||||
@@ -195,15 +247,16 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getPageNum(): Int {
|
||||
if (mCycle == binding.thisCycle.id) {
|
||||
if (mTab == binding.btnEn.id) {
|
||||
if (mTabType == binding.btnGoldUs.id) {
|
||||
return mPageNumThisCycleEn
|
||||
} else {
|
||||
return mPageNumThisCycleAR
|
||||
}
|
||||
} else {
|
||||
if (mTab == binding.btnEn.id) {
|
||||
if (mTabType == binding.btnGoldUs.id) {
|
||||
return mPageNumLastCycleEn
|
||||
} else {
|
||||
return mPageNumLastCycleAR
|
||||
@@ -211,58 +264,64 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
|
||||
}
|
||||
}
|
||||
|
||||
private fun tranData(list: List<GiveGoldBiliBean>) : MutableList<GiveGoldBiliBean>{
|
||||
val data = mutableListOf<GiveGoldBiliBean>()
|
||||
val group = list.groupBy { it.timeStr }
|
||||
|
||||
group.forEach { (t, u) ->
|
||||
u.filterIndexed { index, bean ->
|
||||
if (index == 0){
|
||||
bean.isHead = true
|
||||
}
|
||||
data.add(bean)
|
||||
}
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
public class GiveGoldBiliAdapter : BaseBindingAdapter<ItemGiveGoldBiliBinding, GiveGoldBiliBean>() {
|
||||
|
||||
var mCycle = -1;
|
||||
var mTabType = -1;
|
||||
|
||||
public class GiveGoldBiliAdapter :
|
||||
BaseBindingAdapter<ItemGiveGoldBiliBinding, GiveGoldBiliBean>() {
|
||||
|
||||
override fun onBindView(
|
||||
viewBinding: ItemGiveGoldBiliBinding,
|
||||
data: GiveGoldBiliBean,
|
||||
pos: Int
|
||||
) {
|
||||
|
||||
|
||||
viewBinding.day.setVis(true)
|
||||
viewBinding.day.text = pos.toString()
|
||||
|
||||
viewBinding.avatar
|
||||
viewBinding.nick
|
||||
viewBinding.erBanNo
|
||||
viewBinding.coin
|
||||
viewBinding.time
|
||||
|
||||
|
||||
viewBinding.day.setVis(data.isHead)
|
||||
viewBinding.day.text = MyTimeUtils.millis2String(data.createTime,"yyyy-MM-dd")
|
||||
viewBinding.avatar.loadAvatar(data.targetAvatar)
|
||||
viewBinding.nick.text = data.targetNick?:""
|
||||
viewBinding.erBanNo.text = data.targetErbanNo.toString()
|
||||
viewBinding.coin.text = if (mTabType == GiveGoldBiliEntity.TabType.gold) data.diamondNum.toString() else data.guildUsdNum.toString()
|
||||
viewBinding.time.text = MyTimeUtils.millis2String(data.createTime)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getRechargeUserInfo(
|
||||
pageNum: Int,
|
||||
mCycle: Int,
|
||||
mTab: Int
|
||||
): Single<RechargeUserInfo> {
|
||||
return api.getRechargeUserInfo()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private fun getRechargeUserInfo2(
|
||||
pageNum: Int,
|
||||
mCycle: Int,
|
||||
mTab: Int
|
||||
): Single<RechargeUserInfo> {
|
||||
return api.getRechargeUserInfo()
|
||||
private fun getHistory(
|
||||
pageNo: Int,
|
||||
pageSize: Int,
|
||||
periodType: Int, // 1-这周期 2-上周期
|
||||
type: Int // 1-金币转赠历史 2-代发薪资历史
|
||||
): Single<GiveGoldBiliEntity> {
|
||||
return api.getHistory(pageNo, pageSize, periodType, type)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private val api: Api = RxNet.create(Api::class.java);
|
||||
|
||||
interface Api {
|
||||
@GET("/recharge/user/info")
|
||||
fun getRechargeUserInfo(): Single<ServiceResult<RechargeUserInfo>>
|
||||
|
||||
@GET("/recharge/user/info")
|
||||
fun getRechargeUserInfo2(): Single<ServiceResult<RechargeUserInfo>>
|
||||
@GET("/user/diamond/history")
|
||||
fun getHistory(@Query("pageNo") pageNo: Int,
|
||||
@Query("pageSize") pageSize: Int,
|
||||
@Query("periodType") periodType: Int,
|
||||
@Query("type") type: Int): Single<ServiceResult<GiveGoldBiliEntity>>
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -4,5 +4,17 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GiveGoldAgentBean {
|
||||
|
||||
public long uid;
|
||||
public long id;
|
||||
public long manageUid;
|
||||
public int starLevel = -1;
|
||||
public int hasCharge;
|
||||
public long erbanNo;
|
||||
public String nick;
|
||||
public String avatar;
|
||||
public int isOnline;
|
||||
public int seq;
|
||||
public int starLevelSeq;
|
||||
public double totalGiveGoldUsd;
|
||||
public long totalGiveGold;
|
||||
}
|
||||
|
@@ -1,8 +1,25 @@
|
||||
package com.chwl.app.ui.bean;
|
||||
|
||||
import com.chwl.core.utils.myutil.MyTimeUtils;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GiveGoldBiliBean {
|
||||
|
||||
public boolean isHead;
|
||||
|
||||
public long targetErbanNo;
|
||||
public String targetNick;
|
||||
public String targetAvatar;
|
||||
public double diamondNum;
|
||||
public double guildUsdNum;
|
||||
public String createTimeStr;
|
||||
public long createTime;
|
||||
|
||||
public String getTimeStr() {
|
||||
return MyTimeUtils.millis2String(createTime,"yyyy-MM-dd");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,23 @@
|
||||
package com.chwl.app.ui.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GiveGoldBiliEntity {
|
||||
public List<GiveGoldBiliBean> diamondGiveHistoryVoList;
|
||||
public String cycleDateStr;
|
||||
|
||||
public double totalGiveGoldUsd;
|
||||
public long totalGiveGold;
|
||||
|
||||
public @interface Cycle{
|
||||
public int thisCycle = 1;
|
||||
public int lastCycle = 2;
|
||||
}
|
||||
public @interface TabType{
|
||||
public int gold = 1;
|
||||
public int goldUs = 2;
|
||||
}
|
||||
}
|
@@ -14,8 +14,11 @@ public class RechargeUserInfo {
|
||||
public String avatar;
|
||||
public int isOnline;
|
||||
|
||||
public int agentNum;
|
||||
public long usCoin = -1L;
|
||||
public long enCoin = -1L;
|
||||
|
||||
public double totalGiveGoldUsd;
|
||||
public long totalGiveGold;
|
||||
|
||||
public int subNum;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ import com.chwl.app.databinding.FeedbackActivityBinding
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.core.file.FileModel
|
||||
import com.chwl.core.home.bean.FeedbackTypeBean
|
||||
import com.chwl.core.utils.MyUriUtils
|
||||
import com.chwl.core.utils.myutil.MyUriUtils
|
||||
import com.chwl.library.common.util.PhotoCompressUtil
|
||||
import com.chwl.library.common.util.PhotosCompressCallback
|
||||
import com.chwl.library.utils.ResUtil
|
||||
|
@@ -33,7 +33,7 @@ import com.chwl.core.user.bean.RegionInfoBean
|
||||
import com.chwl.core.user.bean.UserInfo
|
||||
import com.chwl.core.user.bean.UserPhoto
|
||||
import com.chwl.core.utils.CoreLogger
|
||||
import com.chwl.core.utils.MyUriUtils
|
||||
import com.chwl.core.utils.myutil.MyUriUtils
|
||||
import com.chwl.library.common.file.FileHelper
|
||||
import com.chwl.library.common.util.PhotoCompressCallback
|
||||
import com.chwl.library.common.util.PhotoCompressUtil
|
||||
|
@@ -22,7 +22,7 @@ import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.user.bean.UserInfo
|
||||
import com.chwl.core.user.bean.UserPhoto
|
||||
import com.chwl.core.utils.CoreLogger
|
||||
import com.chwl.core.utils.MyUriUtils
|
||||
import com.chwl.core.utils.myutil.MyUriUtils
|
||||
import com.chwl.core.utils.net.BeanObserver
|
||||
import com.chwl.library.common.file.FileHelper
|
||||
import com.chwl.library.common.util.PhotoCompressCallback
|
||||
|
@@ -5,7 +5,7 @@ import android.util.AttributeSet
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.chwl.core.utils.MyUtil
|
||||
import com.chwl.core.utils.myutil.MyUtil
|
||||
import com.chwl.library.common.util.doLog
|
||||
import com.chwl.library.common.util.doLogE
|
||||
|
||||
|
@@ -17,7 +17,7 @@ import com.chwl.core.im.custom.bean.RedPackageLuckyBagAttachment
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.manager.RoomEvent
|
||||
import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.utils.MyUriUtils
|
||||
import com.chwl.core.utils.myutil.MyUriUtils
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.file.FileHelper
|
||||
import com.chwl.library.common.util.doLog
|
||||
|
@@ -154,10 +154,11 @@
|
||||
android:id="@+id/enView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enCoinTitle"
|
||||
android:id="@+id/enGoldTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
@@ -169,7 +170,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/enCoin"
|
||||
android:id="@+id/enGold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
@@ -181,8 +182,8 @@
|
||||
app:dt_drawableRightHeight="30dp"
|
||||
app:dt_drawableRightSrc="@drawable/ic_coin_84"
|
||||
app:dt_drawableRightWidth="30dp"
|
||||
app:layout_constraintStart_toStartOf="@id/enCoinTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/enCoinTitle" />
|
||||
app:layout_constraintStart_toStartOf="@id/enGoldTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/enGoldTitle" />
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/enDetail"
|
||||
@@ -197,9 +198,9 @@
|
||||
app:dt_drawableRightHeight="17dp"
|
||||
app:dt_drawableRightSrc="@drawable/base_ic_arrow_right"
|
||||
app:dt_drawableRightWidth="17dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/enCoin"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/enGold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/enCoin" />
|
||||
app:layout_constraintTop_toTopOf="@+id/enGold" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -208,10 +209,11 @@
|
||||
android:id="@+id/arView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/arUsTitle"
|
||||
android:id="@+id/arGoldUsTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
@@ -219,12 +221,12 @@
|
||||
android:textColor="@color/color_313131"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@id/arCoinTitle"
|
||||
app:layout_constraintEnd_toStartOf="@id/arGoldTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/arUs"
|
||||
android:id="@+id/arGoldUs"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
@@ -233,11 +235,11 @@
|
||||
android:textColor="@color/color_ff8c03"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@id/arUsTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/arUsTitle" />
|
||||
app:layout_constraintStart_toStartOf="@id/arGoldUsTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/arGoldUsTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/arCoinTitle"
|
||||
android:id="@+id/arGoldTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
@@ -246,11 +248,11 @@
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/arUsTitle"
|
||||
app:layout_constraintStart_toEndOf="@id/arGoldUsTitle"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/arCoin"
|
||||
android:id="@+id/arGold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
@@ -262,8 +264,8 @@
|
||||
app:dt_drawableRightHeight="30dp"
|
||||
app:dt_drawableRightSrc="@drawable/ic_coin_84"
|
||||
app:dt_drawableRightWidth="30dp"
|
||||
app:layout_constraintStart_toStartOf="@id/arCoinTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/arCoinTitle" />
|
||||
app:layout_constraintStart_toStartOf="@id/arGoldTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/arGoldTitle" />
|
||||
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
@@ -280,8 +282,8 @@
|
||||
app:dt_drawableRightHeight="17dp"
|
||||
app:dt_drawableRightSrc="@drawable/base_ic_arrow_right"
|
||||
app:dt_drawableRightWidth="17dp"
|
||||
app:layout_constraintStart_toStartOf="@+id/arUs"
|
||||
app:layout_constraintTop_toBottomOf="@id/arUs" />
|
||||
app:layout_constraintStart_toStartOf="@+id/arGoldUs"
|
||||
app:layout_constraintTop_toBottomOf="@id/arGoldUs" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@@ -31,7 +31,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/LastCycle"
|
||||
android:id="@+id/lastCycle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="31dp"
|
||||
@@ -58,14 +58,14 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:background="@drawable/base_shape_f7f7f7_25dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/time">
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/btnUs"
|
||||
android:id="@+id/btnGoldUs"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
@@ -77,7 +77,7 @@
|
||||
app:dt_soildColor="@color/transparent" />
|
||||
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/btnEn"
|
||||
android:id="@+id/btnGold"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
@@ -124,6 +124,7 @@
|
||||
android:id="@+id/srlLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:srlEnableRefresh="false"
|
||||
android:layout_marginTop="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/totalCoin">
|
||||
|
@@ -57,7 +57,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/loading"
|
||||
android:text="@string/_ver_23_Transfer_Past_30_days"
|
||||
android:textColor="@color/color_7b7b7d"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@@ -624,6 +624,7 @@
|
||||
<color name="color_C46C53">#C46C53</color>
|
||||
<color name="color_93570B">#93570B</color>
|
||||
<color name="color_AA6F29">#AA6F29</color>
|
||||
<color name="color_AFB1B3">#AFB1B3</color>
|
||||
<color name="color_EEA473">#EEA473</color>
|
||||
<color name="color_FFC000">#FFC000</color>
|
||||
<color name="color_13E2F5">#13E2F5</color>
|
||||
|
@@ -5466,6 +5466,9 @@ You cannot join again within 24 hours after leaving</string>
|
||||
<string name="_ver_23_Total_Amount_of_Transfer_Coins">Total Amount of Transfer Coins</string>
|
||||
<string name="_ver_23_Sub_Recharge_Agent_List">Sub Recharge Agent List</string>
|
||||
|
||||
<string name="_ver_23_Transfer_Past_30_days">Transfer Past 30 days</string>
|
||||
<string name="_ver_23_Transfer_History">Transfer History</string>
|
||||
|
||||
|
||||
|
||||
<!-- <string name="_ver_23_">xxxx</string>-->
|
||||
|
@@ -38,7 +38,7 @@ import com.chwl.core.miniworld.model.MiniWorldModel;
|
||||
import com.chwl.core.user.UserModel;
|
||||
import com.chwl.core.user.bean.UserInfo;
|
||||
import com.chwl.core.utils.CoreTextUtils;
|
||||
import com.chwl.core.utils.MyUriUtils;
|
||||
import com.chwl.core.utils.myutil.MyUriUtils;
|
||||
import com.chwl.core.utils.SharedPreferenceUtils;
|
||||
import com.chwl.core.utils.net.DontWarnObserver;
|
||||
import com.chwl.library.base.factory.CreatePresenter;
|
||||
|
@@ -18,7 +18,7 @@ import com.chwl.app.base.BaseMvpActivity;
|
||||
import com.chwl.app.music.presenter.AddLocalMusicListPresenter;
|
||||
import com.chwl.core.music.db.bean.LocalMusicBean;
|
||||
import com.chwl.core.music.view.IAddLocalMusicListView;
|
||||
import com.chwl.core.utils.MyUriUtils;
|
||||
import com.chwl.core.utils.myutil.MyUriUtils;
|
||||
import com.chwl.library.base.factory.CreatePresenter;
|
||||
import com.chwl.library.utils.ResUtil;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
|
@@ -2015,7 +2015,7 @@ public final class IMNetEaseManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
//todo do 云信 监听云信上麦
|
||||
//todo do 上麦,云信 监听云信上麦
|
||||
private void chatRoomQueueChangeNotice(ChatRoomMessage msg) {
|
||||
ChatRoomQueueChangeAttachment roomQueueChangeAttachment = (ChatRoomQueueChangeAttachment) msg.getAttachment();
|
||||
//麥上成員信息(uid...) key:坑位 ,content:{"nick":"行走的老者","uid":90972,"gender":1,"avatar":"https://image.zhongjialx.com/Fmtbprx5cGc3KABKjDxs_udJZb3O?imageslim"}
|
||||
@@ -2352,8 +2352,7 @@ public final class IMNetEaseManager {
|
||||
if (size > 0) {
|
||||
for (int j = 0; j < size; j++) {
|
||||
RoomQueueInfo temp = mMicQueueMemberMap.valueAt(j);
|
||||
if (temp.mChatRoomMember != null
|
||||
&& Objects.equals(temp.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
|
||||
if (temp.mChatRoomMember != null && Objects.equals(temp.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
|
||||
//處理同一個人換坑問題
|
||||
temp.mChatRoomMember = null;
|
||||
}
|
||||
@@ -2364,8 +2363,7 @@ public final class IMNetEaseManager {
|
||||
}
|
||||
}
|
||||
RoomQueueInfo tempRoomQueueInfo = mMicQueueMemberMap.get(micPosition);
|
||||
if (tempRoomQueueInfo != null && tempRoomQueueInfo.mChatRoomMember != null
|
||||
&& !Objects.equals(tempRoomQueueInfo.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
|
||||
if (tempRoomQueueInfo != null && tempRoomQueueInfo.mChatRoomMember != null && !Objects.equals(tempRoomQueueInfo.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
|
||||
//被擠下麥的情況
|
||||
noticeDownCrowdedMic(micPosition, tempRoomQueueInfo.mChatRoomMember.getAccount());
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ import com.chwl.core.room.queue.bean.MicMemberInfo;
|
||||
import com.chwl.core.user.UserModel;
|
||||
import com.chwl.core.user.bean.UserInfo;
|
||||
import com.chwl.core.utils.LogUtils;
|
||||
import com.chwl.core.utils.MyUriUtils;
|
||||
import com.chwl.core.utils.myutil.MyUriUtils;
|
||||
import com.chwl.core.vip.bean.UserVipInfo;
|
||||
import com.chwl.library.common.glide.GlideUtils;
|
||||
import com.chwl.library.utils.ListUtils;
|
||||
|
@@ -41,6 +41,7 @@ import com.chwl.core.user.UserModel;
|
||||
import com.chwl.core.user.bean.BaseInfo;
|
||||
import com.chwl.core.user.bean.FirstChargeInfo;
|
||||
import com.chwl.core.user.bean.UserInfo;
|
||||
import com.chwl.core.utils.myutil.MyUtil;
|
||||
import com.chwl.core.utils.net.RxHelper;
|
||||
import com.chwl.core.vip.bean.UserVipInfo;
|
||||
import com.chwl.library.common.util.OtherExtKt;
|
||||
@@ -369,12 +370,12 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
* 执行 : 上麦
|
||||
*/
|
||||
private void doUpMicroPhone(final int micPosition, final String uId, final String roomId, boolean isInviteUpMic, final CallBack<String> callBack, int teamId){
|
||||
MyUtil.INSTANCE.setUpMicIng(true);
|
||||
queryRoomMicInfo(roomId)
|
||||
.map(this::dealMicMemberFromIMNet)
|
||||
.flatMap(this::dealMicChatRoomMemberFromIMNet)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(roomQueueInfoSparseArray -> {
|
||||
|
||||
RoomQueueInfo roomQueueInfo = roomQueueInfoSparseArray.get(micPosition);
|
||||
if (roomQueueInfo == null) {
|
||||
return;
|
||||
@@ -395,11 +396,13 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
callBack.onSuccess(data);
|
||||
MyUtil.INSTANCE.setUpMicIng(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
callBack.onFail(code, error);
|
||||
MyUtil.INSTANCE.setUpMicIng(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -423,6 +426,9 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
}
|
||||
|
||||
})
|
||||
.doOnError(throwable -> {
|
||||
MyUtil.INSTANCE.setUpMicIng(false);
|
||||
})
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
|
@@ -1,23 +0,0 @@
|
||||
package com.chwl.core.utils
|
||||
|
||||
import android.view.View
|
||||
|
||||
object MyUtil {
|
||||
var mAppWidth = 0
|
||||
|
||||
|
||||
fun initAppWidth(view: View?) {
|
||||
view?.post {
|
||||
mAppWidth = view.width
|
||||
}
|
||||
}
|
||||
|
||||
fun getPosRowColumns(pos:Int,col:Int) : Array<Int>{
|
||||
val row = pos / col
|
||||
val column = pos % col
|
||||
return arrayOf(row+1,col+1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.chwl.core.utils;
|
||||
package com.chwl.core.utils.myutil;
|
||||
|
||||
|
||||
import org.json.JSONArray;
|
||||
@@ -13,7 +13,7 @@ import org.json.JSONObject;
|
||||
* desc : utils about json
|
||||
* </pre>
|
||||
*/
|
||||
public final class JsonUtils {
|
||||
public final class MyJsonUtils {
|
||||
|
||||
private static final byte TYPE_BOOLEAN = 0x00;
|
||||
private static final byte TYPE_INT = 0x01;
|
||||
@@ -23,7 +23,7 @@ public final class JsonUtils {
|
||||
private static final byte TYPE_JSON_OBJECT = 0x05;
|
||||
private static final byte TYPE_JSON_ARRAY = 0x06;
|
||||
|
||||
private JsonUtils() {
|
||||
private MyJsonUtils() {
|
||||
throw new UnsupportedOperationException("u can't instantiate me...");
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.chwl.core.utils;
|
||||
package com.chwl.core.utils.myutil;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.res.Resources;
|
||||
@@ -64,7 +64,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class SpanUtils {
|
||||
public class MySpanUtils {
|
||||
|
||||
private static final int COLOR_DEFAULT = 0xFEFFFFFF;
|
||||
|
||||
@@ -80,8 +80,8 @@ public class SpanUtils {
|
||||
|
||||
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
|
||||
|
||||
public static SpanUtils with(final TextView textView) {
|
||||
return new SpanUtils(textView);
|
||||
public static MySpanUtils with(final TextView textView) {
|
||||
return new MySpanUtils(textView);
|
||||
}
|
||||
|
||||
private TextView mTextView;
|
||||
@@ -141,12 +141,12 @@ public class SpanUtils {
|
||||
private final int mTypeImage = 1;
|
||||
private final int mTypeSpace = 2;
|
||||
|
||||
private SpanUtils(TextView textView) {
|
||||
private MySpanUtils(TextView textView) {
|
||||
this();
|
||||
mTextView = textView;
|
||||
}
|
||||
|
||||
public SpanUtils() {
|
||||
public MySpanUtils() {
|
||||
mBuilder = new SerializableSpannableStringBuilder();
|
||||
mText = "";
|
||||
mType = -1;
|
||||
@@ -200,9 +200,9 @@ public class SpanUtils {
|
||||
* <li>{@link Spanned#SPAN_EXCLUSIVE_EXCLUSIVE}</li>
|
||||
* <li>{@link Spanned#SPAN_EXCLUSIVE_INCLUSIVE}</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setFlag(final int flag) {
|
||||
public MySpanUtils setFlag(final int flag) {
|
||||
this.flag = flag;
|
||||
return this;
|
||||
}
|
||||
@@ -211,9 +211,9 @@ public class SpanUtils {
|
||||
* Set the span of foreground's color.
|
||||
*
|
||||
* @param color The color of foreground
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setForegroundColor(@ColorInt final int color) {
|
||||
public MySpanUtils setForegroundColor(@ColorInt final int color) {
|
||||
this.foregroundColor = color;
|
||||
return this;
|
||||
}
|
||||
@@ -222,9 +222,9 @@ public class SpanUtils {
|
||||
* Set the span of background's color.
|
||||
*
|
||||
* @param color The color of background
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setBackgroundColor(@ColorInt final int color) {
|
||||
public MySpanUtils setBackgroundColor(@ColorInt final int color) {
|
||||
this.backgroundColor = color;
|
||||
return this;
|
||||
}
|
||||
@@ -233,9 +233,9 @@ public class SpanUtils {
|
||||
* Set the span of line height.
|
||||
*
|
||||
* @param lineHeight The line height, in pixel.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setLineHeight(@IntRange(from = 0) final int lineHeight) {
|
||||
public MySpanUtils setLineHeight(@IntRange(from = 0) final int lineHeight) {
|
||||
return setLineHeight(lineHeight, ALIGN_CENTER);
|
||||
}
|
||||
|
||||
@@ -249,10 +249,10 @@ public class SpanUtils {
|
||||
* <li>{@link Align#ALIGN_CENTER}</li>
|
||||
* <li>{@link Align#ALIGN_BOTTOM}</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setLineHeight(@IntRange(from = 0) final int lineHeight,
|
||||
@Align final int align) {
|
||||
public MySpanUtils setLineHeight(@IntRange(from = 0) final int lineHeight,
|
||||
@Align final int align) {
|
||||
this.lineHeight = lineHeight;
|
||||
this.alignLine = align;
|
||||
return this;
|
||||
@@ -262,9 +262,9 @@ public class SpanUtils {
|
||||
* Set the span of quote's color.
|
||||
*
|
||||
* @param color The color of quote
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setQuoteColor(@ColorInt final int color) {
|
||||
public MySpanUtils setQuoteColor(@ColorInt final int color) {
|
||||
return setQuoteColor(color, 2, 2);
|
||||
}
|
||||
|
||||
@@ -274,11 +274,11 @@ public class SpanUtils {
|
||||
* @param color The color of quote.
|
||||
* @param stripeWidth The width of stripe, in pixel.
|
||||
* @param gapWidth The width of gap, in pixel.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setQuoteColor(@ColorInt final int color,
|
||||
@IntRange(from = 1) final int stripeWidth,
|
||||
@IntRange(from = 0) final int gapWidth) {
|
||||
public MySpanUtils setQuoteColor(@ColorInt final int color,
|
||||
@IntRange(from = 1) final int stripeWidth,
|
||||
@IntRange(from = 0) final int gapWidth) {
|
||||
this.quoteColor = color;
|
||||
this.stripeWidth = stripeWidth;
|
||||
this.quoteGapWidth = gapWidth;
|
||||
@@ -290,10 +290,10 @@ public class SpanUtils {
|
||||
*
|
||||
* @param first The indent for the first line of the paragraph.
|
||||
* @param rest The indent for the remaining lines of the paragraph.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setLeadingMargin(@IntRange(from = 0) final int first,
|
||||
@IntRange(from = 0) final int rest) {
|
||||
public MySpanUtils setLeadingMargin(@IntRange(from = 0) final int first,
|
||||
@IntRange(from = 0) final int rest) {
|
||||
this.first = first;
|
||||
this.rest = rest;
|
||||
return this;
|
||||
@@ -303,9 +303,9 @@ public class SpanUtils {
|
||||
* Set the span of bullet.
|
||||
*
|
||||
* @param gapWidth The width of gap, in pixel.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setBullet(@IntRange(from = 0) final int gapWidth) {
|
||||
public MySpanUtils setBullet(@IntRange(from = 0) final int gapWidth) {
|
||||
return setBullet(0, 3, gapWidth);
|
||||
}
|
||||
|
||||
@@ -315,11 +315,11 @@ public class SpanUtils {
|
||||
* @param color The color of bullet.
|
||||
* @param radius The radius of bullet, in pixel.
|
||||
* @param gapWidth The width of gap, in pixel.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setBullet(@ColorInt final int color,
|
||||
@IntRange(from = 0) final int radius,
|
||||
@IntRange(from = 0) final int gapWidth) {
|
||||
public MySpanUtils setBullet(@ColorInt final int color,
|
||||
@IntRange(from = 0) final int radius,
|
||||
@IntRange(from = 0) final int gapWidth) {
|
||||
this.bulletColor = color;
|
||||
this.bulletRadius = radius;
|
||||
this.bulletGapWidth = gapWidth;
|
||||
@@ -330,9 +330,9 @@ public class SpanUtils {
|
||||
* Set the span of font's size.
|
||||
*
|
||||
* @param size The size of font.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setFontSize(@IntRange(from = 0) final int size) {
|
||||
public MySpanUtils setFontSize(@IntRange(from = 0) final int size) {
|
||||
return setFontSize(size, false);
|
||||
}
|
||||
|
||||
@@ -341,9 +341,9 @@ public class SpanUtils {
|
||||
*
|
||||
* @param size The size of font.
|
||||
* @param isSp True to use sp, false to use pixel.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setFontSize(@IntRange(from = 0) final int size, final boolean isSp) {
|
||||
public MySpanUtils setFontSize(@IntRange(from = 0) final int size, final boolean isSp) {
|
||||
if (isSp) {
|
||||
final float fontScale = Resources.getSystem().getDisplayMetrics().scaledDensity;
|
||||
this.fontSize = (int) (size * fontScale + 0.5f);
|
||||
@@ -357,9 +357,9 @@ public class SpanUtils {
|
||||
* Set the span of proportion of font.
|
||||
*
|
||||
* @param proportion The proportion of font.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setFontProportion(final float proportion) {
|
||||
public MySpanUtils setFontProportion(final float proportion) {
|
||||
this.proportion = proportion;
|
||||
return this;
|
||||
}
|
||||
@@ -368,9 +368,9 @@ public class SpanUtils {
|
||||
* Set the span of transverse proportion of font.
|
||||
*
|
||||
* @param proportion The transverse proportion of font.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setFontXProportion(final float proportion) {
|
||||
public MySpanUtils setFontXProportion(final float proportion) {
|
||||
this.xProportion = proportion;
|
||||
return this;
|
||||
}
|
||||
@@ -378,9 +378,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Set the span of strikethrough.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setStrikethrough() {
|
||||
public MySpanUtils setStrikethrough() {
|
||||
this.isStrikethrough = true;
|
||||
return this;
|
||||
}
|
||||
@@ -388,9 +388,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Set the span of underline.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setUnderline() {
|
||||
public MySpanUtils setUnderline() {
|
||||
this.isUnderline = true;
|
||||
return this;
|
||||
}
|
||||
@@ -398,9 +398,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Set the span of superscript.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setSuperscript() {
|
||||
public MySpanUtils setSuperscript() {
|
||||
this.isSuperscript = true;
|
||||
return this;
|
||||
}
|
||||
@@ -408,9 +408,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Set the span of subscript.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setSubscript() {
|
||||
public MySpanUtils setSubscript() {
|
||||
this.isSubscript = true;
|
||||
return this;
|
||||
}
|
||||
@@ -418,9 +418,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Set the span of bold.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setBold() {
|
||||
public MySpanUtils setBold() {
|
||||
isBold = true;
|
||||
return this;
|
||||
}
|
||||
@@ -428,9 +428,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Set the span of italic.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setItalic() {
|
||||
public MySpanUtils setItalic() {
|
||||
isItalic = true;
|
||||
return this;
|
||||
}
|
||||
@@ -438,9 +438,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Set the span of bold italic.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setBoldItalic() {
|
||||
public MySpanUtils setBoldItalic() {
|
||||
isBoldItalic = true;
|
||||
return this;
|
||||
}
|
||||
@@ -454,9 +454,9 @@ public class SpanUtils {
|
||||
* <li>serif</li>
|
||||
* <li>sans-serif</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setFontFamily(@NonNull final String fontFamily) {
|
||||
public MySpanUtils setFontFamily(@NonNull final String fontFamily) {
|
||||
this.fontFamily = fontFamily;
|
||||
return this;
|
||||
}
|
||||
@@ -465,9 +465,9 @@ public class SpanUtils {
|
||||
* Set the span of typeface.
|
||||
*
|
||||
* @param typeface The typeface.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setTypeface(@NonNull final Typeface typeface) {
|
||||
public MySpanUtils setTypeface(@NonNull final Typeface typeface) {
|
||||
this.typeface = typeface;
|
||||
return this;
|
||||
}
|
||||
@@ -481,9 +481,9 @@ public class SpanUtils {
|
||||
* <li>{@link Alignment#ALIGN_OPPOSITE}</li>
|
||||
* <li>{@link Alignment#ALIGN_CENTER }</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setHorizontalAlign(@NonNull final Alignment alignment) {
|
||||
public MySpanUtils setHorizontalAlign(@NonNull final Alignment alignment) {
|
||||
this.alignment = alignment;
|
||||
return this;
|
||||
}
|
||||
@@ -498,9 +498,9 @@ public class SpanUtils {
|
||||
* <li>{@link Align#ALIGN_BASELINE}</li>
|
||||
* <li>{@link Align#ALIGN_BOTTOM }</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setVerticalAlign(@Align final int align) {
|
||||
public MySpanUtils setVerticalAlign(@Align final int align) {
|
||||
this.verticalAlign = align;
|
||||
return this;
|
||||
}
|
||||
@@ -510,9 +510,9 @@ public class SpanUtils {
|
||||
* <p>Must set {@code view.setMovementMethod(LinkMovementMethod.getInstance())}</p>
|
||||
*
|
||||
* @param clickSpan The span of click.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setClickSpan(@NonNull final ClickableSpan clickSpan) {
|
||||
public MySpanUtils setClickSpan(@NonNull final ClickableSpan clickSpan) {
|
||||
setMovementMethodIfNeed();
|
||||
this.clickSpan = clickSpan;
|
||||
return this;
|
||||
@@ -525,11 +525,11 @@ public class SpanUtils {
|
||||
* @param color The color of click span.
|
||||
* @param underlineText True to support underline, false otherwise.
|
||||
* @param listener The listener of click span.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setClickSpan(@ColorInt final int color,
|
||||
final boolean underlineText,
|
||||
final View.OnClickListener listener) {
|
||||
public MySpanUtils setClickSpan(@ColorInt final int color,
|
||||
final boolean underlineText,
|
||||
final View.OnClickListener listener) {
|
||||
setMovementMethodIfNeed();
|
||||
this.clickSpan = new ClickableSpan() {
|
||||
|
||||
@@ -554,9 +554,9 @@ public class SpanUtils {
|
||||
* <p>Must set {@code view.setMovementMethod(LinkMovementMethod.getInstance())}</p>
|
||||
*
|
||||
* @param url The url.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setUrl(@NonNull final String url) {
|
||||
public MySpanUtils setUrl(@NonNull final String url) {
|
||||
setMovementMethodIfNeed();
|
||||
this.url = url;
|
||||
return this;
|
||||
@@ -579,10 +579,10 @@ public class SpanUtils {
|
||||
* <li>{@link Blur#OUTER}</li>
|
||||
* <li>{@link Blur#INNER}</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setBlur(@FloatRange(from = 0, fromInclusive = false) final float radius,
|
||||
final Blur style) {
|
||||
public MySpanUtils setBlur(@FloatRange(from = 0, fromInclusive = false) final float radius,
|
||||
final Blur style) {
|
||||
this.blurRadius = radius;
|
||||
this.style = style;
|
||||
return this;
|
||||
@@ -592,9 +592,9 @@ public class SpanUtils {
|
||||
* Set the span of shader.
|
||||
*
|
||||
* @param shader The shader.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setShader(@NonNull final Shader shader) {
|
||||
public MySpanUtils setShader(@NonNull final Shader shader) {
|
||||
this.shader = shader;
|
||||
return this;
|
||||
}
|
||||
@@ -606,12 +606,12 @@ public class SpanUtils {
|
||||
* @param dx X-axis offset, in pixel.
|
||||
* @param dy Y-axis offset, in pixel.
|
||||
* @param shadowColor The color of shadow.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setShadow(@FloatRange(from = 0, fromInclusive = false) final float radius,
|
||||
final float dx,
|
||||
final float dy,
|
||||
final int shadowColor) {
|
||||
public MySpanUtils setShadow(@FloatRange(from = 0, fromInclusive = false) final float radius,
|
||||
final float dx,
|
||||
final float dy,
|
||||
final int shadowColor) {
|
||||
this.shadowRadius = radius;
|
||||
this.shadowDx = dx;
|
||||
this.shadowDy = dy;
|
||||
@@ -624,9 +624,9 @@ public class SpanUtils {
|
||||
* Set the spans.
|
||||
*
|
||||
* @param spans The spans.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils setSpans(@NonNull final Object... spans) {
|
||||
public MySpanUtils setSpans(@NonNull final Object... spans) {
|
||||
if (spans.length > 0) {
|
||||
this.spans = spans;
|
||||
}
|
||||
@@ -637,9 +637,9 @@ public class SpanUtils {
|
||||
* Append the text text.
|
||||
*
|
||||
* @param text The text.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils append(@NonNull final CharSequence text) {
|
||||
public MySpanUtils append(@NonNull final CharSequence text) {
|
||||
apply(mTypeCharSequence);
|
||||
mText = text;
|
||||
return this;
|
||||
@@ -648,9 +648,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Append one line.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendLine() {
|
||||
public MySpanUtils appendLine() {
|
||||
apply(mTypeCharSequence);
|
||||
mText = LINE_SEPARATOR;
|
||||
return this;
|
||||
@@ -659,9 +659,9 @@ public class SpanUtils {
|
||||
/**
|
||||
* Append text and one line.
|
||||
*
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendLine(@NonNull final CharSequence text) {
|
||||
public MySpanUtils appendLine(@NonNull final CharSequence text) {
|
||||
apply(mTypeCharSequence);
|
||||
mText = text + LINE_SEPARATOR;
|
||||
return this;
|
||||
@@ -671,9 +671,9 @@ public class SpanUtils {
|
||||
* Append one image.
|
||||
*
|
||||
* @param bitmap The bitmap of image.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@NonNull final Bitmap bitmap) {
|
||||
public MySpanUtils appendImage(@NonNull final Bitmap bitmap) {
|
||||
return appendImage(bitmap, ALIGN_BOTTOM);
|
||||
}
|
||||
|
||||
@@ -688,9 +688,9 @@ public class SpanUtils {
|
||||
* <li>{@link Align#ALIGN_BASELINE}</li>
|
||||
* <li>{@link Align#ALIGN_BOTTOM }</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@NonNull final Bitmap bitmap, @Align final int align) {
|
||||
public MySpanUtils appendImage(@NonNull final Bitmap bitmap, @Align final int align) {
|
||||
apply(mTypeImage);
|
||||
this.imageBitmap = bitmap;
|
||||
this.alignImage = align;
|
||||
@@ -701,9 +701,9 @@ public class SpanUtils {
|
||||
* Append one image.
|
||||
*
|
||||
* @param drawable The drawable of image.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@NonNull final Drawable drawable) {
|
||||
public MySpanUtils appendImage(@NonNull final Drawable drawable) {
|
||||
return appendImage(drawable, ALIGN_BOTTOM);
|
||||
}
|
||||
|
||||
@@ -718,9 +718,9 @@ public class SpanUtils {
|
||||
* <li>{@link Align#ALIGN_BASELINE}</li>
|
||||
* <li>{@link Align#ALIGN_BOTTOM }</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@NonNull final Drawable drawable, @Align final int align) {
|
||||
public MySpanUtils appendImage(@NonNull final Drawable drawable, @Align final int align) {
|
||||
apply(mTypeImage);
|
||||
this.imageDrawable = drawable;
|
||||
this.alignImage = align;
|
||||
@@ -731,9 +731,9 @@ public class SpanUtils {
|
||||
* Append one image.
|
||||
*
|
||||
* @param uri The uri of image.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@NonNull final Uri uri) {
|
||||
public MySpanUtils appendImage(@NonNull final Uri uri) {
|
||||
return appendImage(uri, ALIGN_BOTTOM);
|
||||
}
|
||||
|
||||
@@ -748,9 +748,9 @@ public class SpanUtils {
|
||||
* <li>{@link Align#ALIGN_BASELINE}</li>
|
||||
* <li>{@link Align#ALIGN_BOTTOM }</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@NonNull final Uri uri, @Align final int align) {
|
||||
public MySpanUtils appendImage(@NonNull final Uri uri, @Align final int align) {
|
||||
apply(mTypeImage);
|
||||
this.imageUri = uri;
|
||||
this.alignImage = align;
|
||||
@@ -761,9 +761,9 @@ public class SpanUtils {
|
||||
* Append one image.
|
||||
*
|
||||
* @param resourceId The resource id of image.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@DrawableRes final int resourceId) {
|
||||
public MySpanUtils appendImage(@DrawableRes final int resourceId) {
|
||||
return appendImage(resourceId, ALIGN_BOTTOM);
|
||||
}
|
||||
|
||||
@@ -778,9 +778,9 @@ public class SpanUtils {
|
||||
* <li>{@link Align#ALIGN_BASELINE}</li>
|
||||
* <li>{@link Align#ALIGN_BOTTOM }</li>
|
||||
* </ul>
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendImage(@DrawableRes final int resourceId, @Align final int align) {
|
||||
public MySpanUtils appendImage(@DrawableRes final int resourceId, @Align final int align) {
|
||||
apply(mTypeImage);
|
||||
this.imageResourceId = resourceId;
|
||||
this.alignImage = align;
|
||||
@@ -791,9 +791,9 @@ public class SpanUtils {
|
||||
* Append space.
|
||||
*
|
||||
* @param size The size of space.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendSpace(@IntRange(from = 0) final int size) {
|
||||
public MySpanUtils appendSpace(@IntRange(from = 0) final int size) {
|
||||
return appendSpace(size, Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
@@ -802,9 +802,9 @@ public class SpanUtils {
|
||||
*
|
||||
* @param size The size of space.
|
||||
* @param color The color of space.
|
||||
* @return the single {@link SpanUtils} instance
|
||||
* @return the single {@link MySpanUtils} instance
|
||||
*/
|
||||
public SpanUtils appendSpace(@IntRange(from = 0) final int size, @ColorInt final int color) {
|
||||
public MySpanUtils appendSpace(@IntRange(from = 0) final int size, @ColorInt final int color) {
|
||||
apply(mTypeSpace);
|
||||
spaceSize = size;
|
||||
spaceColor = color;
|
1636
core/src/main/java/com/chwl/core/utils/myutil/MyTimeUtils.java
Normal file
1636
core/src/main/java/com/chwl/core/utils/myutil/MyTimeUtils.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
package com.chwl.core.utils
|
||||
package com.chwl.core.utils.myutil
|
||||
|
||||
import android.content.Context
|
||||
import android.database.Cursor
|
40
core/src/main/java/com/chwl/core/utils/myutil/MyUtil.kt
Normal file
40
core/src/main/java/com/chwl/core/utils/myutil/MyUtil.kt
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.chwl.core.utils.myutil
|
||||
|
||||
import android.view.View
|
||||
|
||||
object MyUtil {
|
||||
var mAppWidth = 0
|
||||
var CLICK_TIME = 0L
|
||||
var CLICK_DIFF_TIME = 2000L
|
||||
var upMicIng = false
|
||||
|
||||
|
||||
fun initAppWidth(view: View?) {
|
||||
view?.post {
|
||||
mAppWidth = view.width
|
||||
}
|
||||
}
|
||||
|
||||
fun getPosRowColumns(pos:Int,col:Int) : Array<Int>{
|
||||
val row = pos / col
|
||||
val column = pos % col
|
||||
return arrayOf(row+1,col+1)
|
||||
}
|
||||
|
||||
fun isDoubleClick() : Boolean {
|
||||
val time = System.currentTimeMillis()
|
||||
if (CLICK_TIME > 0) {
|
||||
val diff = (time - CLICK_TIME).coerceAtLeast(0)
|
||||
val isDouble = diff < CLICK_DIFF_TIME
|
||||
if (!isDouble) CLICK_TIME = time
|
||||
return isDouble
|
||||
} else {
|
||||
CLICK_TIME = time
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.chwl.core.utils.myutil;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* author: Blankj
|
||||
* blog : http://blankj.com
|
||||
* time : 2017/03/13
|
||||
* desc : constants of time
|
||||
* </pre>
|
||||
*/
|
||||
public final class TimeConstants {
|
||||
|
||||
public static final int MSEC = 1;
|
||||
public static final int SEC = 1000;
|
||||
public static final int MIN = 60000;
|
||||
public static final int HOUR = 3600000;
|
||||
public static final int DAY = 86400000;
|
||||
|
||||
@IntDef({MSEC, SEC, MIN, HOUR, DAY})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Unit {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user