feat : 代理相关功能 接入 接口

This commit is contained in:
eggmanQQQ
2025-02-25 15:58:50 +08:00
parent f1fdf6fb3f
commit 3cbbd6fb42
38 changed files with 2144 additions and 299 deletions

View File

@@ -929,6 +929,14 @@
android:name=".pay.activity.GiveGoldActivity" android:name=".pay.activity.GiveGoldActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" /> 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 <activity
android:name=".pay.activity.GiveGoldDetailActivity" android:name=".pay.activity.GiveGoldDetailActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"

View File

@@ -100,7 +100,7 @@ import com.chwl.core.user.event.LoadLoginUserInfoEvent;
import com.chwl.core.user.event.LoginUserInfoUpdateEvent; import com.chwl.core.user.event.LoginUserInfoUpdateEvent;
import com.chwl.core.user.event.NeedBindPhoneEvent; import com.chwl.core.user.event.NeedBindPhoneEvent;
import com.chwl.core.user.event.NeedCompleteInfoEvent; 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.SharedPreferenceUtils;
import com.chwl.core.utils.StringFormatUtils; import com.chwl.core.utils.StringFormatUtils;
import com.chwl.core.utils.WLog; import com.chwl.core.utils.WLog;

View File

@@ -55,7 +55,7 @@ import com.chwl.core.room.model.RoomSettingModel;
import com.chwl.core.room.queue.bean.MicMemberInfo; import com.chwl.core.room.queue.bean.MicMemberInfo;
import com.chwl.core.super_admin.util.SuperAdminUtil; import com.chwl.core.super_admin.util.SuperAdminUtil;
import com.chwl.core.utils.LogUtils; 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.BeanObserver;
import com.chwl.core.utils.net.DontWarnObserver; import com.chwl.core.utils.net.DontWarnObserver;
import com.chwl.core.utils.net.RxHelper; import com.chwl.core.utils.net.RxHelper;

View File

@@ -22,7 +22,7 @@ import com.chwl.core.bean.response.ServiceResult
import com.chwl.core.gift.bean.RoomBgInfo import com.chwl.core.gift.bean.RoomBgInfo
import com.chwl.core.gift.bean.RoomBgInfoItem import com.chwl.core.gift.bean.RoomBgInfoItem
import com.chwl.core.manager.AvRoomDataManager 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.core.utils.net.RxHelper
import com.chwl.library.common.util.ClickUtils.click import com.chwl.library.common.util.ClickUtils.click
import com.chwl.library.common.util.setVis import com.chwl.library.common.util.setVis

View File

@@ -7,7 +7,7 @@ import com.chwl.app.avroom.helper.AnimHelper
import com.chwl.app.databinding.RoomNotifyCpLevelUpBinding import com.chwl.app.databinding.RoomNotifyCpLevelUpBinding
import com.chwl.app.ui.utils.CpUtils import com.chwl.app.ui.utils.CpUtils
import com.chwl.core.gift.bean.CpMsgBean 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.getColor
import com.example.lib_utils.ktx.getString import com.example.lib_utils.ktx.getString
import com.opensource.svgaplayer.SVGADrawable import com.opensource.svgaplayer.SVGADrawable
@@ -26,7 +26,7 @@ class RoomNotifyLevelUpDialog (private val context: Context) : BaseRoomNotifyDia
override fun init() { override fun init() {
cpMsgBean?.let { cpMsgBean?.let {
SpanUtils.with(mBinding.text) MySpanUtils.with(mBinding.text)
.append(" ${it.senderNick} ").setForegroundColor(R.color.white.getColor()) .append(" ${it.senderNick} ").setForegroundColor(R.color.white.getColor())
.append(" ${R.string.avroom_widget_roomeffectview_02.getString()} ").setForegroundColor(R.color.color_fff664.getColor()) .append(" ${R.string.avroom_widget_roomeffectview_02.getString()} ").setForegroundColor(R.color.color_fff664.getColor())
.append(" ${it.receiverNick} ").setForegroundColor(R.color.white.getColor()) .append(" ${it.receiverNick} ").setForegroundColor(R.color.white.getColor())

View File

@@ -141,10 +141,12 @@ import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.BaseInfo import com.chwl.core.user.bean.BaseInfo
import com.chwl.core.user.bean.UserInfo import com.chwl.core.user.bean.UserInfo
import com.chwl.core.utils.LogUtils import com.chwl.core.utils.LogUtils
import com.chwl.core.utils.myutil.MyUtil
import com.chwl.core.utils.net.VipLevelNotEnoughException import com.chwl.core.utils.net.VipLevelNotEnoughException
import com.chwl.library.common.util.ClickUtils.click import com.chwl.library.common.util.ClickUtils.click
import com.chwl.library.common.util.LimitClickUtils import com.chwl.library.common.util.LimitClickUtils
import com.chwl.library.common.util.doLog 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.isVerify
import com.chwl.library.common.util.postSafe import com.chwl.library.common.util.postSafe
import com.chwl.library.common.util.setMargin 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?) { 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)) { if (AvRoomDataManager.get().isDatingVipMic(position) && !AvRoomDataManager.get().isDatingVip(AuthModel.get().currentUid)) {
DatingVipRuleDialog.newInstance(mContext).show() DatingVipRuleDialog.newInstance(mContext).show()
} else { } else {

View File

@@ -22,7 +22,7 @@ import com.chwl.app.ui.utils.ImageLoadUtilsV2
import com.chwl.app.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration import com.chwl.app.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
import com.chwl.core.Constants import com.chwl.core.Constants
import com.chwl.core.gift.bean.GiftInfo 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.compress
import com.chwl.library.common.util.PhotoCompressUtil.getCompressCachePath import com.chwl.library.common.util.PhotoCompressUtil.getCompressCachePath
import com.chwl.library.common.util.PhotosCompressCallback import com.chwl.library.common.util.PhotosCompressCallback

View File

@@ -181,7 +181,7 @@ import com.chwl.core.treasurefairy.bean.FairyMsgInfoBean;
import com.chwl.core.user.UserModel; import com.chwl.core.user.UserModel;
import com.chwl.core.user.bean.UserInfo; import com.chwl.core.user.bean.UserInfo;
import com.chwl.core.utils.ExtensionUtil; 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.LogUtils;
import com.chwl.core.utils.extension.StringExtensionKt; import com.chwl.core.utils.extension.StringExtensionKt;
import com.chwl.core.utils.net.DontWarnObserver; import com.chwl.core.utils.net.DontWarnObserver;
@@ -3202,7 +3202,7 @@ public class MessageView extends FrameLayout {
if (o != null) { if (o != null) {
String json = JSON.toJSONString(o); String json = JSON.toJSONString(o);
// OtherExtKt.doLog(json); // OtherExtKt.doLog(json);
String nick = JsonUtils.getString(json, UserInfo.NICK, ""); String nick = MyJsonUtils.getString(json, UserInfo.NICK, "");
if (OtherExtKt.isVerify(nick)) { if (OtherExtKt.isVerify(nick)) {
senderNick = nick; senderNick = nick;
} }

View File

@@ -12,7 +12,7 @@ import com.chwl.app.support.float.BaseFloatView
import com.chwl.app.ui.utils.ImageLoadUtils import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.app.ui.widget.dialog.AllServiceGiftGoRoomTipsDialog import com.chwl.app.ui.widget.dialog.AllServiceGiftGoRoomTipsDialog
import com.chwl.core.noble.bean.AllServiceGiftProtocol 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.getColorById
import com.example.lib_utils.ktx.getDimension import com.example.lib_utils.ktx.getDimension
import com.example.lib_utils.ktx.singleClick import com.example.lib_utils.ktx.singleClick
@@ -73,7 +73,7 @@ class GiftNotify(context: Context) : BaseFloatView(context) {
setupTextMarquee(binding.tvNames) setupTextMarquee(binding.tvNames)
SpanUtils.with(binding.tvGiftCount) MySpanUtils.with(binding.tvGiftCount)
.append(data.giftName).setFontSize(R.dimen.sp_11.getDimension().toInt(),false) .append(data.giftName).setFontSize(R.dimen.sp_11.getDimension().toInt(),false)
.append(" X") .append(" X")
.append(data.giftNum.toString()).setFontSize(17,true).setBold() .append(data.giftNum.toString()).setFontSize(17,true).setBold()

View File

@@ -161,21 +161,19 @@ class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
binding.starLayout.addView(star) binding.starLayout.addView(star)
} }
if (it.usCoin != -1L) { if (UserModel.get().isArUser) {
binding.arView.setVis(true) binding.arView.setVis(true)
binding.enView.setVis(false) binding.enView.setVis(false)
} else { } else {
binding.arView.setVis(false) binding.arView.setVis(false)
binding.enView.setVis(true) binding.enView.setVis(true)
} }
binding.arUs.text = it.usCoin.toString() binding.arGoldUs.text = it.totalGiveGoldUsd.toString()
binding.arCoin.text = it.enCoin.toString() binding.arGold.text = it.totalGiveGold.toString()
binding.enCoin.text = it.enCoin.toString() binding.enGold.text = it.totalGiveGold.toString()
binding.agentNum.text = it.agentNum.toString() binding.agentNum.text = it.subNum.toString()
} }
}.subscribe() }.subscribe()
@@ -199,7 +197,7 @@ class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
binding.enDetail.click { binding.enDetail.click {
GiveGoldBiliActivity.start(context) GiveGoldBiliActivity.start(context)
} }
binding.agentNum.click { binding.agent.click {
GiveGoldAgentsActivity.start(context) GiveGoldAgentsActivity.start(context)
} }

View File

@@ -2,18 +2,23 @@ package com.chwl.app.pay.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.widget.ImageView
import com.chwl.app.R import com.chwl.app.R
import com.chwl.app.base.BaseViewBindingActivity import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.bindadapter.BaseBindingAdapter import com.chwl.app.bindadapter.BaseBindingAdapter
import com.chwl.app.common.EmptyViewHelper
import com.chwl.app.databinding.ActivityGiveGoldAgentsBinding import com.chwl.app.databinding.ActivityGiveGoldAgentsBinding
import com.chwl.app.databinding.ItemGiveGoldAgentBinding import com.chwl.app.databinding.ItemGiveGoldAgentBinding
import com.chwl.app.ui.bean.GiveGoldAgentBean 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.bean.response.ServiceResult
import com.chwl.core.utils.extension.toast import com.chwl.core.utils.extension.toast
import com.chwl.core.utils.net.RxHelper 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.chwl.library.net.rxnet.RxNet
import com.example.lib_utils.ktx.getString import com.example.lib_utils.ktx.getString
import com.netease.nim.uikit.StatusBarUtil
import io.reactivex.Single import io.reactivex.Single
import retrofit2.http.GET 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 private lateinit var mAdapter : GiveGoldAgentsAdapter
override fun init() { override fun init() {
@@ -34,12 +50,14 @@ class GiveGoldAgentsActivity : BaseViewBindingActivity<ActivityGiveGoldAgentsBin
initWhiteTitleBar(R.string._ver_23_Sub_Recharge_Agent_List.getString()) initWhiteTitleBar(R.string._ver_23_Sub_Recharge_Agent_List.getString())
mAdapter = GiveGoldAgentsAdapter() mAdapter = GiveGoldAgentsAdapter()
mAdapter.emptyView = EmptyViewHelper.createEmptyTextView(context,R.string.empty_data.getString())
binding.rvList.adapter = mAdapter binding.rvList.adapter = mAdapter
getRechargeUserInfo().compose(bindToLifecycle()) getSubList().compose(bindToLifecycle())
.doOnSuccess { .doOnSuccess {
if (it.isVerify()) {
mAdapter.setNewData(it)
}
} }
.doOnError { .doOnError {
it?.message?.toast() 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) { override fun onBindView(viewBinding: ItemGiveGoldAgentBinding, data: GiveGoldAgentBean, pos: Int) {
viewBinding.avatar viewBinding.avatar.loadAvatar(data.avatar?:"")
viewBinding.nick viewBinding.nick.text = data.nick?:""
viewBinding.erBanNo viewBinding.erBanNo.text = data.erbanNo.toString()
viewBinding.starLayout
viewBinding.time viewBinding.starLayout.removeAllViews()
viewBinding.coin 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> { private fun getSubList(): Single<List<GiveGoldAgentBean>> {
return api.getRechargeUserInfo() return api.getSubList()
.compose(RxHelper.handleBeanData()) .compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers()) .compose(RxHelper.handleSchedulers())
} }
private val api: Api = RxNet.create(Api::class.java); private val api: Api = RxNet.create(Api::class.java);
interface Api { interface Api {
@GET("/recharge/user/info") @GET("/recharge/user/subList")
fun getRechargeUserInfo(): Single<ServiceResult<RechargeUserInfo>> fun getSubList(): Single<ServiceResult<List<GiveGoldAgentBean>>>
} }
} }

View File

@@ -2,28 +2,35 @@ package com.chwl.app.pay.activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView 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.base.BaseViewBindingActivity
import com.chwl.app.bindadapter.BaseBindingAdapter import com.chwl.app.bindadapter.BaseBindingAdapter
import com.chwl.app.common.EmptyViewHelper
import com.chwl.app.databinding.ActivityGiveGoldBiliBinding import com.chwl.app.databinding.ActivityGiveGoldBiliBinding
import com.chwl.app.databinding.ItemGiveGoldBiliBinding import com.chwl.app.databinding.ItemGiveGoldBiliBinding
import com.chwl.app.ui.bean.GiveGoldBiliBean 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.bean.response.ServiceResult
import com.chwl.core.user.UserModel import com.chwl.core.user.UserModel
import com.chwl.core.utils.myutil.MyTimeUtils
import com.chwl.core.utils.net.RxHelper import com.chwl.core.utils.net.RxHelper
import com.chwl.library.common.util.ClickUtils.click import com.chwl.library.common.util.ClickUtils.click
import com.chwl.library.common.util.doToast import com.chwl.library.common.util.doToast
import com.chwl.library.common.util.isVerify import com.chwl.library.common.util.isVerify
import com.chwl.library.common.util.setVis import com.chwl.library.common.util.setVis
import com.chwl.library.net.rxnet.RxNet 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.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadmoreListener import com.scwang.smartrefresh.layout.listener.OnRefreshLoadmoreListener
import io.reactivex.Single import io.reactivex.Single
import retrofit2.http.GET import retrofit2.http.GET
import retrofit2.http.Query
class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding>() { class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding>() {
@@ -37,7 +44,7 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
lateinit var mAdapter: GiveGoldBiliAdapter lateinit var mAdapter: GiveGoldBiliAdapter
private var mCycle = -1; private var mCycle = -1;
private var mTab = -1; private var mTabType = -1;
private var mDataThisCycleEn = mutableListOf<GiveGoldBiliBean>() private var mDataThisCycleEn = mutableListOf<GiveGoldBiliBean>()
private var mDataThisCycleAR = mutableListOf<GiveGoldBiliBean>() private var mDataThisCycleAR = mutableListOf<GiveGoldBiliBean>()
@@ -51,100 +58,145 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
override fun init() { override fun init() {
initWhiteTitleBar(R.string._ver_23_Transfer_History.getString())
binding.thisCycle.click { binding.thisCycle.click {
switchCycle(it) switchCycle(GiveGoldBiliEntity.Cycle.thisCycle)
} }
binding.LastCycle.click { binding.lastCycle.click {
switchCycle(it) switchCycle(GiveGoldBiliEntity.Cycle.lastCycle)
} }
binding.btnUs.click { binding.btnGoldUs.click {
switchTab(it) switchTab(GiveGoldBiliEntity.TabType.gold)
} }
binding.btnEn.click { binding.btnGold.click {
switchTab(it) switchTab(GiveGoldBiliEntity.TabType.goldUs)
} }
binding.tabLayout.setVis(UserModel.get().isArUser)
binding.time
binding.totalCoin
binding.srlLayout.setOnRefreshLoadmoreListener(object : OnRefreshLoadmoreListener { binding.srlLayout.setOnRefreshLoadmoreListener(object : OnRefreshLoadmoreListener {
override fun onRefresh(p0: RefreshLayout?) { override fun onRefresh(p0: RefreshLayout?) {
} }
override fun onLoadmore(p0: RefreshLayout?) { override fun onLoadmore(p0: RefreshLayout?) {
loadData()
} }
}) })
mAdapter = GiveGoldBiliAdapter() mAdapter = GiveGoldBiliAdapter()
binding.rvList.layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false) binding.rvList.layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
binding.rvList.adapter = mAdapter 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) { private fun switchCycle(type: Int) {
if (mCycle == view.id) return if (mCycle == type) return
mCycle = view.id 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() loadData()
} }
private fun switchTab(view: View) { private fun switchTab(type: Int) {
if (mTab == view.id) return if (mTabType == type) return
mTab = view.id 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() loadData()
} }
override fun setStatusBar() {
super.setStatusBar()
StatusBarUtil.transparencyBar(this)
StatusBarUtil.StatusBarLightMode(this)
}
override fun needSteepStateBar(): Boolean {
return true
}
private fun loadData() { private fun loadData() {
if (mCycle == -1 && mTab == -1) return if (mCycle == -1 && mTabType == -1) return
val data = getData(arrayListOf()) val data = getData(arrayListOf())
if (data.isVerify()) { if (data.isVerify()) {
mAdapter.setNewData(data) mAdapter.setNewData(data)
} else { } else {
getRechargeUserInfo(getPageNum(), mCycle, mTab) getHistory(getPageNum(),20, mTabType, mCycle)
.compose(bindToLifecycle()) .compose(bindToLifecycle())
.doOnSuccess { .doOnSuccess {
if (getPageNum() == 1) { binding.time.text = it.cycleDateStr?:""
mAdapter.setNewData(getData(arrayListOf())) binding.totalCoin.text = if (mTabType == GiveGoldBiliEntity.TabType.gold) it.totalGiveGold.toString() else it.totalGiveGoldUsd.toString()
} else {
mAdapter.addData(getData(arrayListOf()))
}
// if (it.size == 20) { if (it.diamondGiveHistoryVoList.isVerify()) {
// if (mCycle == binding.thisCycle.id) { if (getPageNum() == 1) {
// if (mTab == binding.btnEn.id) { mAdapter.setNewData(getData(it.diamondGiveHistoryVoList))
// mPageNumThisCycleEn++ } else {
// } else { val tranData = tranData(it.diamondGiveHistoryVoList)
// mPageNumThisCycleAR++ tranData.isVerify(0){ first->
// } if (mAdapter.data.isVerify()) {
// } else { val last = mAdapter.data.last()
// if (mTab == binding.btnEn.id) { if (last.timeStr == first.timeStr) {
// mPageNumLastCycleEn++ first.isHead = false
// } else { }
// mPageNumLastCycleAR++ }
// } }
// } mAdapter.addData(tranData)
// } }
// binding.srlLayout.isEnableLoadmore = it.size == 20
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() binding.srlLayout.finishLoadmore()
} }
.doOnError { .doOnError {
it?.message?.doToast() it?.message?.doToast()
binding.srlLayout.finishLoadmore() binding.srlLayout.finishLoadmore()
}.subscribe() }.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 (mCycle == binding.thisCycle.id) {
if (mTab == binding.btnEn.id) { if (mTabType == binding.btnGoldUs.id) {
if (data.isVerify()) { if (data.isVerify()) {
if (mDataThisCycleEn.isVerify()) { if (mDataThisCycleEn.isVerify()) {
@@ -169,7 +221,7 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
} }
} else { } else {
if (mTab == binding.btnEn.id) { if (mTabType == binding.btnGoldUs.id) {
if (data.isVerify()) { if (data.isVerify()) {
if (mDataLastCycleEn.isVerify()) { if (mDataLastCycleEn.isVerify()) {
mDataLastCycleEn.addAll(data) mDataLastCycleEn.addAll(data)
@@ -195,15 +247,16 @@ class GiveGoldBiliActivity : BaseViewBindingActivity<ActivityGiveGoldBiliBinding
} }
} }
private fun getPageNum(): Int { private fun getPageNum(): Int {
if (mCycle == binding.thisCycle.id) { if (mCycle == binding.thisCycle.id) {
if (mTab == binding.btnEn.id) { if (mTabType == binding.btnGoldUs.id) {
return mPageNumThisCycleEn return mPageNumThisCycleEn
} else { } else {
return mPageNumThisCycleAR return mPageNumThisCycleAR
} }
} else { } else {
if (mTab == binding.btnEn.id) { if (mTabType == binding.btnGoldUs.id) {
return mPageNumLastCycleEn return mPageNumLastCycleEn
} else { } else {
return mPageNumLastCycleAR 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( override fun onBindView(
viewBinding: ItemGiveGoldBiliBinding, viewBinding: ItemGiveGoldBiliBinding,
data: GiveGoldBiliBean, data: GiveGoldBiliBean,
pos: Int pos: Int
) { ) {
viewBinding.day.setVis(data.isHead)
viewBinding.day.text = MyTimeUtils.millis2String(data.createTime,"yyyy-MM-dd")
viewBinding.day.setVis(true) viewBinding.avatar.loadAvatar(data.targetAvatar)
viewBinding.day.text = pos.toString() viewBinding.nick.text = data.targetNick?:""
viewBinding.erBanNo.text = data.targetErbanNo.toString()
viewBinding.avatar viewBinding.coin.text = if (mTabType == GiveGoldBiliEntity.TabType.gold) data.diamondNum.toString() else data.guildUsdNum.toString()
viewBinding.nick viewBinding.time.text = MyTimeUtils.millis2String(data.createTime)
viewBinding.erBanNo
viewBinding.coin
viewBinding.time
} }
} }
private fun getRechargeUserInfo( private fun getHistory(
pageNum: Int, pageNo: Int,
mCycle: Int, pageSize: Int,
mTab: Int periodType: Int, // 1-这周期 2-上周期
): Single<RechargeUserInfo> { type: Int // 1-金币转赠历史 2-代发薪资历史
return api.getRechargeUserInfo() ): Single<GiveGoldBiliEntity> {
.compose(RxHelper.handleBeanData()) return api.getHistory(pageNo, pageSize, periodType, type)
.compose(RxHelper.handleSchedulers())
}
private fun getRechargeUserInfo2(
pageNum: Int,
mCycle: Int,
mTab: Int
): Single<RechargeUserInfo> {
return api.getRechargeUserInfo()
.compose(RxHelper.handleBeanData()) .compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers()) .compose(RxHelper.handleSchedulers())
} }
private val api: Api = RxNet.create(Api::class.java); private val api: Api = RxNet.create(Api::class.java);
interface Api { interface Api {
@GET("/recharge/user/info")
fun getRechargeUserInfo(): Single<ServiceResult<RechargeUserInfo>>
@GET("/recharge/user/info") @GET("/user/diamond/history")
fun getRechargeUserInfo2(): Single<ServiceResult<RechargeUserInfo>> fun getHistory(@Query("pageNo") pageNo: Int,
@Query("pageSize") pageSize: Int,
@Query("periodType") periodType: Int,
@Query("type") type: Int): Single<ServiceResult<GiveGoldBiliEntity>>
} }

View File

@@ -4,5 +4,17 @@ import lombok.Data;
@Data @Data
public class GiveGoldAgentBean { 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;
} }

View File

@@ -1,8 +1,25 @@
package com.chwl.app.ui.bean; package com.chwl.app.ui.bean;
import com.chwl.core.utils.myutil.MyTimeUtils;
import lombok.Data; import lombok.Data;
@Data @Data
public class GiveGoldBiliBean { 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");
}
} }

View File

@@ -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;
}
}

View File

@@ -14,8 +14,11 @@ public class RechargeUserInfo {
public String avatar; public String avatar;
public int isOnline; public int isOnline;
public int agentNum;
public long usCoin = -1L; public double totalGiveGoldUsd;
public long enCoin = -1L; public long totalGiveGold;
public int subNum;
} }

View File

@@ -15,7 +15,7 @@ import com.chwl.app.databinding.FeedbackActivityBinding
import com.chwl.app.ui.utils.load import com.chwl.app.ui.utils.load
import com.chwl.core.file.FileModel import com.chwl.core.file.FileModel
import com.chwl.core.home.bean.FeedbackTypeBean 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.PhotoCompressUtil
import com.chwl.library.common.util.PhotosCompressCallback import com.chwl.library.common.util.PhotosCompressCallback
import com.chwl.library.utils.ResUtil import com.chwl.library.utils.ResUtil

View File

@@ -33,7 +33,7 @@ import com.chwl.core.user.bean.RegionInfoBean
import com.chwl.core.user.bean.UserInfo import com.chwl.core.user.bean.UserInfo
import com.chwl.core.user.bean.UserPhoto import com.chwl.core.user.bean.UserPhoto
import com.chwl.core.utils.CoreLogger 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.file.FileHelper
import com.chwl.library.common.util.PhotoCompressCallback import com.chwl.library.common.util.PhotoCompressCallback
import com.chwl.library.common.util.PhotoCompressUtil import com.chwl.library.common.util.PhotoCompressUtil

View File

@@ -22,7 +22,7 @@ import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.UserInfo import com.chwl.core.user.bean.UserInfo
import com.chwl.core.user.bean.UserPhoto import com.chwl.core.user.bean.UserPhoto
import com.chwl.core.utils.CoreLogger 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.core.utils.net.BeanObserver
import com.chwl.library.common.file.FileHelper import com.chwl.library.common.file.FileHelper
import com.chwl.library.common.util.PhotoCompressCallback import com.chwl.library.common.util.PhotoCompressCallback

View File

@@ -5,7 +5,7 @@ import android.util.AttributeSet
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager 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.doLog
import com.chwl.library.common.util.doLogE import com.chwl.library.common.util.doLogE

View File

@@ -17,7 +17,7 @@ import com.chwl.core.im.custom.bean.RedPackageLuckyBagAttachment
import com.chwl.core.manager.AvRoomDataManager import com.chwl.core.manager.AvRoomDataManager
import com.chwl.core.manager.RoomEvent import com.chwl.core.manager.RoomEvent
import com.chwl.core.user.UserModel 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.core.utils.net.RxHelper
import com.chwl.library.common.file.FileHelper import com.chwl.library.common.file.FileHelper
import com.chwl.library.common.util.doLog import com.chwl.library.common.util.doLog

View File

@@ -154,10 +154,11 @@
android:id="@+id/enView" android:id="@+id/enView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"> android:visibility="gone"
tools:visibility="gone">
<TextView <TextView
android:id="@+id/enCoinTitle" android:id="@+id/enGoldTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
@@ -169,7 +170,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
android:id="@+id/enCoin" android:id="@+id/enGold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
@@ -181,8 +182,8 @@
app:dt_drawableRightHeight="30dp" app:dt_drawableRightHeight="30dp"
app:dt_drawableRightSrc="@drawable/ic_coin_84" app:dt_drawableRightSrc="@drawable/ic_coin_84"
app:dt_drawableRightWidth="30dp" app:dt_drawableRightWidth="30dp"
app:layout_constraintStart_toStartOf="@id/enCoinTitle" app:layout_constraintStart_toStartOf="@id/enGoldTitle"
app:layout_constraintTop_toBottomOf="@id/enCoinTitle" /> app:layout_constraintTop_toBottomOf="@id/enGoldTitle" />
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
android:id="@+id/enDetail" android:id="@+id/enDetail"
@@ -197,9 +198,9 @@
app:dt_drawableRightHeight="17dp" app:dt_drawableRightHeight="17dp"
app:dt_drawableRightSrc="@drawable/base_ic_arrow_right" app:dt_drawableRightSrc="@drawable/base_ic_arrow_right"
app:dt_drawableRightWidth="17dp" app:dt_drawableRightWidth="17dp"
app:layout_constraintBottom_toBottomOf="@+id/enCoin" app:layout_constraintBottom_toBottomOf="@+id/enGold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/enCoin" /> app:layout_constraintTop_toTopOf="@+id/enGold" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@@ -208,10 +209,11 @@
android:id="@+id/arView" android:id="@+id/arView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:visibility="visible"
android:visibility="gone"> android:visibility="gone">
<TextView <TextView
android:id="@+id/arUsTitle" android:id="@+id/arGoldUsTitle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
@@ -219,12 +221,12 @@
android:textColor="@color/color_313131" android:textColor="@color/color_313131"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/arCoinTitle" app:layout_constraintEnd_toStartOf="@id/arGoldTitle"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
android:id="@+id/arUs" android:id="@+id/arGoldUs"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
@@ -233,11 +235,11 @@
android:textColor="@color/color_ff8c03" android:textColor="@color/color_ff8c03"
android:textSize="26sp" android:textSize="26sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/arUsTitle" app:layout_constraintStart_toStartOf="@id/arGoldUsTitle"
app:layout_constraintTop_toBottomOf="@id/arUsTitle" /> app:layout_constraintTop_toBottomOf="@id/arGoldUsTitle" />
<TextView <TextView
android:id="@+id/arCoinTitle" android:id="@+id/arGoldTitle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
@@ -246,11 +248,11 @@
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/arUsTitle" app:layout_constraintStart_toEndOf="@id/arGoldUsTitle"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
android:id="@+id/arCoin" android:id="@+id/arGold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
@@ -262,8 +264,8 @@
app:dt_drawableRightHeight="30dp" app:dt_drawableRightHeight="30dp"
app:dt_drawableRightSrc="@drawable/ic_coin_84" app:dt_drawableRightSrc="@drawable/ic_coin_84"
app:dt_drawableRightWidth="30dp" app:dt_drawableRightWidth="30dp"
app:layout_constraintStart_toStartOf="@id/arCoinTitle" app:layout_constraintStart_toStartOf="@id/arGoldTitle"
app:layout_constraintTop_toBottomOf="@id/arCoinTitle" /> app:layout_constraintTop_toBottomOf="@id/arGoldTitle" />
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
@@ -280,8 +282,8 @@
app:dt_drawableRightHeight="17dp" app:dt_drawableRightHeight="17dp"
app:dt_drawableRightSrc="@drawable/base_ic_arrow_right" app:dt_drawableRightSrc="@drawable/base_ic_arrow_right"
app:dt_drawableRightWidth="17dp" app:dt_drawableRightWidth="17dp"
app:layout_constraintStart_toStartOf="@+id/arUs" app:layout_constraintStart_toStartOf="@+id/arGoldUs"
app:layout_constraintTop_toBottomOf="@id/arUs" /> app:layout_constraintTop_toBottomOf="@id/arGoldUs" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -31,7 +31,7 @@
app:layout_constraintTop_toBottomOf="@id/title_bar" /> app:layout_constraintTop_toBottomOf="@id/title_bar" />
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
android:id="@+id/LastCycle" android:id="@+id/lastCycle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="31dp" android:layout_marginStart="31dp"
@@ -58,14 +58,14 @@
<LinearLayout <LinearLayout
android:id="@+id/tabLayout" android:id="@+id/tabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="32dp" android:layout_height="35dp"
android:layout_marginHorizontal="15dp" android:layout_marginHorizontal="15dp"
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:background="@drawable/base_shape_f7f7f7_25dp" android:background="@drawable/base_shape_f7f7f7_25dp"
app:layout_constraintTop_toBottomOf="@id/time"> app:layout_constraintTop_toBottomOf="@id/time">
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
android:id="@+id/btnUs" android:id="@+id/btnGoldUs"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
@@ -77,7 +77,7 @@
app:dt_soildColor="@color/transparent" /> app:dt_soildColor="@color/transparent" />
<com.chwl.library.widget.text.DrawableTextView <com.chwl.library.widget.text.DrawableTextView
android:id="@+id/btnEn" android:id="@+id/btnGold"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
@@ -124,6 +124,7 @@
android:id="@+id/srlLayout" android:id="@+id/srlLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
app:srlEnableRefresh="false"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/totalCoin"> app:layout_constraintTop_toBottomOf="@id/totalCoin">

View File

@@ -57,7 +57,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
android:text="@string/loading" android:text="@string/_ver_23_Transfer_Past_30_days"
android:textColor="@color/color_7b7b7d" android:textColor="@color/color_7b7b7d"
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View File

@@ -624,6 +624,7 @@
<color name="color_C46C53">#C46C53</color> <color name="color_C46C53">#C46C53</color>
<color name="color_93570B">#93570B</color> <color name="color_93570B">#93570B</color>
<color name="color_AA6F29">#AA6F29</color> <color name="color_AA6F29">#AA6F29</color>
<color name="color_AFB1B3">#AFB1B3</color>
<color name="color_EEA473">#EEA473</color> <color name="color_EEA473">#EEA473</color>
<color name="color_FFC000">#FFC000</color> <color name="color_FFC000">#FFC000</color>
<color name="color_13E2F5">#13E2F5</color> <color name="color_13E2F5">#13E2F5</color>

View File

@@ -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_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_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>--> <!-- <string name="_ver_23_">xxxx</string>-->

View File

@@ -38,7 +38,7 @@ import com.chwl.core.miniworld.model.MiniWorldModel;
import com.chwl.core.user.UserModel; import com.chwl.core.user.UserModel;
import com.chwl.core.user.bean.UserInfo; import com.chwl.core.user.bean.UserInfo;
import com.chwl.core.utils.CoreTextUtils; 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.SharedPreferenceUtils;
import com.chwl.core.utils.net.DontWarnObserver; import com.chwl.core.utils.net.DontWarnObserver;
import com.chwl.library.base.factory.CreatePresenter; import com.chwl.library.base.factory.CreatePresenter;

View File

@@ -18,7 +18,7 @@ import com.chwl.app.base.BaseMvpActivity;
import com.chwl.app.music.presenter.AddLocalMusicListPresenter; import com.chwl.app.music.presenter.AddLocalMusicListPresenter;
import com.chwl.core.music.db.bean.LocalMusicBean; import com.chwl.core.music.db.bean.LocalMusicBean;
import com.chwl.core.music.view.IAddLocalMusicListView; 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.base.factory.CreatePresenter;
import com.chwl.library.utils.ResUtil; import com.chwl.library.utils.ResUtil;
import com.hjq.toast.ToastUtils; import com.hjq.toast.ToastUtils;

View File

@@ -2015,7 +2015,7 @@ public final class IMNetEaseManager {
} }
}); });
} }
//todo do 云信 监听云信上麦 //todo do 上麦,云信 监听云信上麦
private void chatRoomQueueChangeNotice(ChatRoomMessage msg) { private void chatRoomQueueChangeNotice(ChatRoomMessage msg) {
ChatRoomQueueChangeAttachment roomQueueChangeAttachment = (ChatRoomQueueChangeAttachment) msg.getAttachment(); ChatRoomQueueChangeAttachment roomQueueChangeAttachment = (ChatRoomQueueChangeAttachment) msg.getAttachment();
//麥上成員信息uid... key:坑位 content:{"nick":"行走的老者","uid":90972,"gender":1,"avatar":"https://image.zhongjialx.com/Fmtbprx5cGc3KABKjDxs_udJZb3O?imageslim"} //麥上成員信息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) { if (size > 0) {
for (int j = 0; j < size; j++) { for (int j = 0; j < size; j++) {
RoomQueueInfo temp = mMicQueueMemberMap.valueAt(j); RoomQueueInfo temp = mMicQueueMemberMap.valueAt(j);
if (temp.mChatRoomMember != null if (temp.mChatRoomMember != null && Objects.equals(temp.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
&& Objects.equals(temp.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
//處理同一個人換坑問題 //處理同一個人換坑問題
temp.mChatRoomMember = null; temp.mChatRoomMember = null;
} }
@@ -2364,8 +2363,7 @@ public final class IMNetEaseManager {
} }
} }
RoomQueueInfo tempRoomQueueInfo = mMicQueueMemberMap.get(micPosition); RoomQueueInfo tempRoomQueueInfo = mMicQueueMemberMap.get(micPosition);
if (tempRoomQueueInfo != null && tempRoomQueueInfo.mChatRoomMember != null if (tempRoomQueueInfo != null && tempRoomQueueInfo.mChatRoomMember != null && !Objects.equals(tempRoomQueueInfo.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
&& !Objects.equals(tempRoomQueueInfo.mChatRoomMember.getAccount(), chatRoomMember.getAccount())) {
//被擠下麥的情況 //被擠下麥的情況
noticeDownCrowdedMic(micPosition, tempRoomQueueInfo.mChatRoomMember.getAccount()); noticeDownCrowdedMic(micPosition, tempRoomQueueInfo.mChatRoomMember.getAccount());
} }

View File

@@ -32,7 +32,7 @@ import com.chwl.core.room.queue.bean.MicMemberInfo;
import com.chwl.core.user.UserModel; import com.chwl.core.user.UserModel;
import com.chwl.core.user.bean.UserInfo; import com.chwl.core.user.bean.UserInfo;
import com.chwl.core.utils.LogUtils; 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.core.vip.bean.UserVipInfo;
import com.chwl.library.common.glide.GlideUtils; import com.chwl.library.common.glide.GlideUtils;
import com.chwl.library.utils.ListUtils; import com.chwl.library.utils.ListUtils;

View File

@@ -41,6 +41,7 @@ import com.chwl.core.user.UserModel;
import com.chwl.core.user.bean.BaseInfo; import com.chwl.core.user.bean.BaseInfo;
import com.chwl.core.user.bean.FirstChargeInfo; import com.chwl.core.user.bean.FirstChargeInfo;
import com.chwl.core.user.bean.UserInfo; 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.utils.net.RxHelper;
import com.chwl.core.vip.bean.UserVipInfo; import com.chwl.core.vip.bean.UserVipInfo;
import com.chwl.library.common.util.OtherExtKt; 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){ 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) queryRoomMicInfo(roomId)
.map(this::dealMicMemberFromIMNet) .map(this::dealMicMemberFromIMNet)
.flatMap(this::dealMicChatRoomMemberFromIMNet) .flatMap(this::dealMicChatRoomMemberFromIMNet)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnNext(roomQueueInfoSparseArray -> { .doOnNext(roomQueueInfoSparseArray -> {
RoomQueueInfo roomQueueInfo = roomQueueInfoSparseArray.get(micPosition); RoomQueueInfo roomQueueInfo = roomQueueInfoSparseArray.get(micPosition);
if (roomQueueInfo == null) { if (roomQueueInfo == null) {
return; return;
@@ -395,11 +396,13 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
@Override @Override
public void onSuccess(String data) { public void onSuccess(String data) {
callBack.onSuccess(data); callBack.onSuccess(data);
MyUtil.INSTANCE.setUpMicIng(false);
} }
@Override @Override
public void onFail(int code, String error) { public void onFail(int code, String error) {
callBack.onFail(code, 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(); .subscribe();
} }

View File

@@ -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)
}
}

View File

@@ -1,4 +1,4 @@
package com.chwl.core.utils; package com.chwl.core.utils.myutil;
import org.json.JSONArray; import org.json.JSONArray;
@@ -13,7 +13,7 @@ import org.json.JSONObject;
* desc : utils about json * desc : utils about json
* </pre> * </pre>
*/ */
public final class JsonUtils { public final class MyJsonUtils {
private static final byte TYPE_BOOLEAN = 0x00; private static final byte TYPE_BOOLEAN = 0x00;
private static final byte TYPE_INT = 0x01; 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_OBJECT = 0x05;
private static final byte TYPE_JSON_ARRAY = 0x06; private static final byte TYPE_JSON_ARRAY = 0x06;
private JsonUtils() { private MyJsonUtils() {
throw new UnsupportedOperationException("u can't instantiate me..."); throw new UnsupportedOperationException("u can't instantiate me...");
} }

View File

@@ -1,4 +1,4 @@
package com.chwl.core.utils; package com.chwl.core.utils.myutil;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.res.Resources; import android.content.res.Resources;
@@ -64,7 +64,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
public class SpanUtils { public class MySpanUtils {
private static final int COLOR_DEFAULT = 0xFEFFFFFF; private static final int COLOR_DEFAULT = 0xFEFFFFFF;
@@ -80,8 +80,8 @@ public class SpanUtils {
private static final String LINE_SEPARATOR = System.getProperty("line.separator"); private static final String LINE_SEPARATOR = System.getProperty("line.separator");
public static SpanUtils with(final TextView textView) { public static MySpanUtils with(final TextView textView) {
return new SpanUtils(textView); return new MySpanUtils(textView);
} }
private TextView mTextView; private TextView mTextView;
@@ -141,12 +141,12 @@ public class SpanUtils {
private final int mTypeImage = 1; private final int mTypeImage = 1;
private final int mTypeSpace = 2; private final int mTypeSpace = 2;
private SpanUtils(TextView textView) { private MySpanUtils(TextView textView) {
this(); this();
mTextView = textView; mTextView = textView;
} }
public SpanUtils() { public MySpanUtils() {
mBuilder = new SerializableSpannableStringBuilder(); mBuilder = new SerializableSpannableStringBuilder();
mText = ""; mText = "";
mType = -1; mType = -1;
@@ -200,9 +200,9 @@ public class SpanUtils {
* <li>{@link Spanned#SPAN_EXCLUSIVE_EXCLUSIVE}</li> * <li>{@link Spanned#SPAN_EXCLUSIVE_EXCLUSIVE}</li>
* <li>{@link Spanned#SPAN_EXCLUSIVE_INCLUSIVE}</li> * <li>{@link Spanned#SPAN_EXCLUSIVE_INCLUSIVE}</li>
* </ul> * </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; this.flag = flag;
return this; return this;
} }
@@ -211,9 +211,9 @@ public class SpanUtils {
* Set the span of foreground's color. * Set the span of foreground's color.
* *
* @param color The color of foreground * @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; this.foregroundColor = color;
return this; return this;
} }
@@ -222,9 +222,9 @@ public class SpanUtils {
* Set the span of background's color. * Set the span of background's color.
* *
* @param color The color of background * @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; this.backgroundColor = color;
return this; return this;
} }
@@ -233,9 +233,9 @@ public class SpanUtils {
* Set the span of line height. * Set the span of line height.
* *
* @param lineHeight The line height, in pixel. * @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); return setLineHeight(lineHeight, ALIGN_CENTER);
} }
@@ -249,10 +249,10 @@ public class SpanUtils {
* <li>{@link Align#ALIGN_CENTER}</li> * <li>{@link Align#ALIGN_CENTER}</li>
* <li>{@link Align#ALIGN_BOTTOM}</li> * <li>{@link Align#ALIGN_BOTTOM}</li>
* </ul> * </ul>
* @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,
@Align final int align) { @Align final int align) {
this.lineHeight = lineHeight; this.lineHeight = lineHeight;
this.alignLine = align; this.alignLine = align;
return this; return this;
@@ -262,9 +262,9 @@ public class SpanUtils {
* Set the span of quote's color. * Set the span of quote's color.
* *
* @param color The color of quote * @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); return setQuoteColor(color, 2, 2);
} }
@@ -274,11 +274,11 @@ public class SpanUtils {
* @param color The color of quote. * @param color The color of quote.
* @param stripeWidth The width of stripe, in pixel. * @param stripeWidth The width of stripe, in pixel.
* @param gapWidth The width of gap, 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, public MySpanUtils setQuoteColor(@ColorInt final int color,
@IntRange(from = 1) final int stripeWidth, @IntRange(from = 1) final int stripeWidth,
@IntRange(from = 0) final int gapWidth) { @IntRange(from = 0) final int gapWidth) {
this.quoteColor = color; this.quoteColor = color;
this.stripeWidth = stripeWidth; this.stripeWidth = stripeWidth;
this.quoteGapWidth = gapWidth; this.quoteGapWidth = gapWidth;
@@ -290,10 +290,10 @@ public class SpanUtils {
* *
* @param first The indent for the first line of the paragraph. * @param first The indent for the first line of the paragraph.
* @param rest The indent for the remaining lines 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, public MySpanUtils setLeadingMargin(@IntRange(from = 0) final int first,
@IntRange(from = 0) final int rest) { @IntRange(from = 0) final int rest) {
this.first = first; this.first = first;
this.rest = rest; this.rest = rest;
return this; return this;
@@ -303,9 +303,9 @@ public class SpanUtils {
* Set the span of bullet. * Set the span of bullet.
* *
* @param gapWidth The width of gap, 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(@IntRange(from = 0) final int gapWidth) { public MySpanUtils setBullet(@IntRange(from = 0) final int gapWidth) {
return setBullet(0, 3, gapWidth); return setBullet(0, 3, gapWidth);
} }
@@ -315,11 +315,11 @@ public class SpanUtils {
* @param color The color of bullet. * @param color The color of bullet.
* @param radius The radius of bullet, in pixel. * @param radius The radius of bullet, in pixel.
* @param gapWidth The width of gap, 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, public MySpanUtils setBullet(@ColorInt final int color,
@IntRange(from = 0) final int radius, @IntRange(from = 0) final int radius,
@IntRange(from = 0) final int gapWidth) { @IntRange(from = 0) final int gapWidth) {
this.bulletColor = color; this.bulletColor = color;
this.bulletRadius = radius; this.bulletRadius = radius;
this.bulletGapWidth = gapWidth; this.bulletGapWidth = gapWidth;
@@ -330,9 +330,9 @@ public class SpanUtils {
* Set the span of font's size. * Set the span of font's size.
* *
* @param size The size of font. * @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); return setFontSize(size, false);
} }
@@ -341,9 +341,9 @@ public class SpanUtils {
* *
* @param size The size of font. * @param size The size of font.
* @param isSp True to use sp, false to use pixel. * @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) { if (isSp) {
final float fontScale = Resources.getSystem().getDisplayMetrics().scaledDensity; final float fontScale = Resources.getSystem().getDisplayMetrics().scaledDensity;
this.fontSize = (int) (size * fontScale + 0.5f); this.fontSize = (int) (size * fontScale + 0.5f);
@@ -357,9 +357,9 @@ public class SpanUtils {
* Set the span of proportion of font. * Set the span of proportion of font.
* *
* @param proportion The 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; this.proportion = proportion;
return this; return this;
} }
@@ -368,9 +368,9 @@ public class SpanUtils {
* Set the span of transverse proportion of font. * Set the span of transverse proportion of font.
* *
* @param proportion The 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; this.xProportion = proportion;
return this; return this;
} }
@@ -378,9 +378,9 @@ public class SpanUtils {
/** /**
* Set the span of strikethrough. * 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; this.isStrikethrough = true;
return this; return this;
} }
@@ -388,9 +388,9 @@ public class SpanUtils {
/** /**
* Set the span of underline. * 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; this.isUnderline = true;
return this; return this;
} }
@@ -398,9 +398,9 @@ public class SpanUtils {
/** /**
* Set the span of superscript. * 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; this.isSuperscript = true;
return this; return this;
} }
@@ -408,9 +408,9 @@ public class SpanUtils {
/** /**
* Set the span of subscript. * 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; this.isSubscript = true;
return this; return this;
} }
@@ -418,9 +418,9 @@ public class SpanUtils {
/** /**
* Set the span of bold. * 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; isBold = true;
return this; return this;
} }
@@ -428,9 +428,9 @@ public class SpanUtils {
/** /**
* Set the span of italic. * 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; isItalic = true;
return this; return this;
} }
@@ -438,9 +438,9 @@ public class SpanUtils {
/** /**
* Set the span of bold italic. * 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; isBoldItalic = true;
return this; return this;
} }
@@ -454,9 +454,9 @@ public class SpanUtils {
* <li>serif</li> * <li>serif</li>
* <li>sans-serif</li> * <li>sans-serif</li>
* </ul> * </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; this.fontFamily = fontFamily;
return this; return this;
} }
@@ -465,9 +465,9 @@ public class SpanUtils {
* Set the span of typeface. * Set the span of typeface.
* *
* @param typeface The 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; this.typeface = typeface;
return this; return this;
} }
@@ -481,9 +481,9 @@ public class SpanUtils {
* <li>{@link Alignment#ALIGN_OPPOSITE}</li> * <li>{@link Alignment#ALIGN_OPPOSITE}</li>
* <li>{@link Alignment#ALIGN_CENTER }</li> * <li>{@link Alignment#ALIGN_CENTER }</li>
* </ul> * </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; this.alignment = alignment;
return this; return this;
} }
@@ -498,9 +498,9 @@ public class SpanUtils {
* <li>{@link Align#ALIGN_BASELINE}</li> * <li>{@link Align#ALIGN_BASELINE}</li>
* <li>{@link Align#ALIGN_BOTTOM }</li> * <li>{@link Align#ALIGN_BOTTOM }</li>
* </ul> * </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; this.verticalAlign = align;
return this; return this;
} }
@@ -510,9 +510,9 @@ public class SpanUtils {
* <p>Must set {@code view.setMovementMethod(LinkMovementMethod.getInstance())}</p> * <p>Must set {@code view.setMovementMethod(LinkMovementMethod.getInstance())}</p>
* *
* @param clickSpan The span of click. * @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(); setMovementMethodIfNeed();
this.clickSpan = clickSpan; this.clickSpan = clickSpan;
return this; return this;
@@ -525,11 +525,11 @@ public class SpanUtils {
* @param color The color of click span. * @param color The color of click span.
* @param underlineText True to support underline, false otherwise. * @param underlineText True to support underline, false otherwise.
* @param listener The listener of click span. * @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, public MySpanUtils setClickSpan(@ColorInt final int color,
final boolean underlineText, final boolean underlineText,
final View.OnClickListener listener) { final View.OnClickListener listener) {
setMovementMethodIfNeed(); setMovementMethodIfNeed();
this.clickSpan = new ClickableSpan() { this.clickSpan = new ClickableSpan() {
@@ -554,9 +554,9 @@ public class SpanUtils {
* <p>Must set {@code view.setMovementMethod(LinkMovementMethod.getInstance())}</p> * <p>Must set {@code view.setMovementMethod(LinkMovementMethod.getInstance())}</p>
* *
* @param url The url. * @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(); setMovementMethodIfNeed();
this.url = url; this.url = url;
return this; return this;
@@ -579,10 +579,10 @@ public class SpanUtils {
* <li>{@link Blur#OUTER}</li> * <li>{@link Blur#OUTER}</li>
* <li>{@link Blur#INNER}</li> * <li>{@link Blur#INNER}</li>
* </ul> * </ul>
* @return the single {@link SpanUtils} instance * @return the single {@link MySpanUtils} instance
*/ */
public SpanUtils setBlur(@FloatRange(from = 0, fromInclusive = false) final float radius, public MySpanUtils setBlur(@FloatRange(from = 0, fromInclusive = false) final float radius,
final Blur style) { final Blur style) {
this.blurRadius = radius; this.blurRadius = radius;
this.style = style; this.style = style;
return this; return this;
@@ -592,9 +592,9 @@ public class SpanUtils {
* Set the span of shader. * Set the span of shader.
* *
* @param shader The 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; this.shader = shader;
return this; return this;
} }
@@ -606,12 +606,12 @@ public class SpanUtils {
* @param dx X-axis offset, in pixel. * @param dx X-axis offset, in pixel.
* @param dy Y-axis offset, in pixel. * @param dy Y-axis offset, in pixel.
* @param shadowColor The color of shadow. * @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, public MySpanUtils setShadow(@FloatRange(from = 0, fromInclusive = false) final float radius,
final float dx, final float dx,
final float dy, final float dy,
final int shadowColor) { final int shadowColor) {
this.shadowRadius = radius; this.shadowRadius = radius;
this.shadowDx = dx; this.shadowDx = dx;
this.shadowDy = dy; this.shadowDy = dy;
@@ -624,9 +624,9 @@ public class SpanUtils {
* Set the spans. * Set the spans.
* *
* @param spans 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) { if (spans.length > 0) {
this.spans = spans; this.spans = spans;
} }
@@ -637,9 +637,9 @@ public class SpanUtils {
* Append the text text. * Append the text text.
* *
* @param text The 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); apply(mTypeCharSequence);
mText = text; mText = text;
return this; return this;
@@ -648,9 +648,9 @@ public class SpanUtils {
/** /**
* Append one line. * Append one line.
* *
* @return the single {@link SpanUtils} instance * @return the single {@link MySpanUtils} instance
*/ */
public SpanUtils appendLine() { public MySpanUtils appendLine() {
apply(mTypeCharSequence); apply(mTypeCharSequence);
mText = LINE_SEPARATOR; mText = LINE_SEPARATOR;
return this; return this;
@@ -659,9 +659,9 @@ public class SpanUtils {
/** /**
* Append text and one line. * 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); apply(mTypeCharSequence);
mText = text + LINE_SEPARATOR; mText = text + LINE_SEPARATOR;
return this; return this;
@@ -671,9 +671,9 @@ public class SpanUtils {
* Append one image. * Append one image.
* *
* @param bitmap The bitmap of 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); return appendImage(bitmap, ALIGN_BOTTOM);
} }
@@ -688,9 +688,9 @@ public class SpanUtils {
* <li>{@link Align#ALIGN_BASELINE}</li> * <li>{@link Align#ALIGN_BASELINE}</li>
* <li>{@link Align#ALIGN_BOTTOM }</li> * <li>{@link Align#ALIGN_BOTTOM }</li>
* </ul> * </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); apply(mTypeImage);
this.imageBitmap = bitmap; this.imageBitmap = bitmap;
this.alignImage = align; this.alignImage = align;
@@ -701,9 +701,9 @@ public class SpanUtils {
* Append one image. * Append one image.
* *
* @param drawable The drawable of 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); return appendImage(drawable, ALIGN_BOTTOM);
} }
@@ -718,9 +718,9 @@ public class SpanUtils {
* <li>{@link Align#ALIGN_BASELINE}</li> * <li>{@link Align#ALIGN_BASELINE}</li>
* <li>{@link Align#ALIGN_BOTTOM }</li> * <li>{@link Align#ALIGN_BOTTOM }</li>
* </ul> * </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); apply(mTypeImage);
this.imageDrawable = drawable; this.imageDrawable = drawable;
this.alignImage = align; this.alignImage = align;
@@ -731,9 +731,9 @@ public class SpanUtils {
* Append one image. * Append one image.
* *
* @param uri The uri of 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); return appendImage(uri, ALIGN_BOTTOM);
} }
@@ -748,9 +748,9 @@ public class SpanUtils {
* <li>{@link Align#ALIGN_BASELINE}</li> * <li>{@link Align#ALIGN_BASELINE}</li>
* <li>{@link Align#ALIGN_BOTTOM }</li> * <li>{@link Align#ALIGN_BOTTOM }</li>
* </ul> * </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); apply(mTypeImage);
this.imageUri = uri; this.imageUri = uri;
this.alignImage = align; this.alignImage = align;
@@ -761,9 +761,9 @@ public class SpanUtils {
* Append one image. * Append one image.
* *
* @param resourceId The resource id of 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); return appendImage(resourceId, ALIGN_BOTTOM);
} }
@@ -778,9 +778,9 @@ public class SpanUtils {
* <li>{@link Align#ALIGN_BASELINE}</li> * <li>{@link Align#ALIGN_BASELINE}</li>
* <li>{@link Align#ALIGN_BOTTOM }</li> * <li>{@link Align#ALIGN_BOTTOM }</li>
* </ul> * </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); apply(mTypeImage);
this.imageResourceId = resourceId; this.imageResourceId = resourceId;
this.alignImage = align; this.alignImage = align;
@@ -791,9 +791,9 @@ public class SpanUtils {
* Append space. * Append space.
* *
* @param size The size of 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); return appendSpace(size, Color.TRANSPARENT);
} }
@@ -802,9 +802,9 @@ public class SpanUtils {
* *
* @param size The size of space. * @param size The size of space.
* @param color The color 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); apply(mTypeSpace);
spaceSize = size; spaceSize = size;
spaceColor = color; spaceColor = color;

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
package com.chwl.core.utils package com.chwl.core.utils.myutil
import android.content.Context import android.content.Context
import android.database.Cursor import android.database.Cursor

View 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
}
}

View File

@@ -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 {
}
}