新增新用户充值礼物弹窗
@@ -1316,6 +1316,10 @@
|
|||||||
android:name=".fansteam.FansTeamListActivity"
|
android:name=".fansteam.FansTeamListActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".avroom.newuserchargegift.NewUserChargeGiftDialog"
|
||||||
|
android:theme="@style/dialogactivity" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@@ -50,7 +50,10 @@ import com.tencent.bugly.crashreport.CrashReport;
|
|||||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||||
import com.yizhuan.erban.application.ActivityStackManager;
|
import com.yizhuan.erban.application.ActivityStackManager;
|
||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||||
|
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||||
import com.yizhuan.erban.avroom.ktv.KtvMusicManager;
|
import com.yizhuan.erban.avroom.ktv.KtvMusicManager;
|
||||||
|
import com.yizhuan.erban.avroom.newuserchargegift.NewUserChargeGiftDialog;
|
||||||
|
import com.yizhuan.erban.avroom.newuserchargegift.NewUserChargePrizeDialog;
|
||||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||||
import com.yizhuan.erban.common.widget.DragLayout;
|
import com.yizhuan.erban.common.widget.DragLayout;
|
||||||
@@ -113,6 +116,7 @@ import com.yizhuan.erban.ui.widget.RecallDialog;
|
|||||||
import com.yizhuan.erban.utils.CleanLeakUtils;
|
import com.yizhuan.erban.utils.CleanLeakUtils;
|
||||||
import com.yizhuan.erban.utils.PushMessageHandler;
|
import com.yizhuan.erban.utils.PushMessageHandler;
|
||||||
import com.yizhuan.xchat_android_core.Constants;
|
import com.yizhuan.xchat_android_core.Constants;
|
||||||
|
import com.yizhuan.xchat_android_core.DemoCache;
|
||||||
import com.yizhuan.xchat_android_core.UriProvider;
|
import com.yizhuan.xchat_android_core.UriProvider;
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||||
import com.yizhuan.xchat_android_core.auth.event.KickOutEvent;
|
import com.yizhuan.xchat_android_core.auth.event.KickOutEvent;
|
||||||
@@ -168,6 +172,8 @@ import com.yizhuan.xchat_android_core.patriarch.event.CloseMinRoomEvent;
|
|||||||
import com.yizhuan.xchat_android_core.patriarch.event.ImPushMsgPmLimitTimeEvent;
|
import com.yizhuan.xchat_android_core.patriarch.event.ImPushMsgPmLimitTimeEvent;
|
||||||
import com.yizhuan.xchat_android_core.patriarch.event.PmDismissAllLimitDialogEvent;
|
import com.yizhuan.xchat_android_core.patriarch.event.PmDismissAllLimitDialogEvent;
|
||||||
import com.yizhuan.xchat_android_core.pay.bean.ShowCommonWebEvent;
|
import com.yizhuan.xchat_android_core.pay.bean.ShowCommonWebEvent;
|
||||||
|
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||||
|
import com.yizhuan.xchat_android_core.pay.event.NewUserChargeEvent;
|
||||||
import com.yizhuan.xchat_android_core.public_chat_hall.attachment.AitMeAttachment;
|
import com.yizhuan.xchat_android_core.public_chat_hall.attachment.AitMeAttachment;
|
||||||
import com.yizhuan.xchat_android_core.recall.bean.CheckLostUserInfo;
|
import com.yizhuan.xchat_android_core.recall.bean.CheckLostUserInfo;
|
||||||
import com.yizhuan.xchat_android_core.recall.event.CheckLostUserEvent;
|
import com.yizhuan.xchat_android_core.recall.event.CheckLostUserEvent;
|
||||||
@@ -459,6 +465,12 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
|||||||
//这里是为了处理APP后台运行的情况下点击分享房间等LinkedMe链接的情况
|
//这里是为了处理APP后台运行的情况下点击分享房间等LinkedMe链接的情况
|
||||||
if (UserModel.get().getCacheLoginUserInfo() != null) {
|
if (UserModel.get().getCacheLoginUserInfo() != null) {
|
||||||
handleLinkedJump();
|
handleLinkedJump();
|
||||||
|
if (PmDialogShowMrg.get().isHasShow()) {
|
||||||
|
if (DemoCache.readNewUserChargeGift() == 1) {
|
||||||
|
NewUserChargeGiftDialog.start(context);
|
||||||
|
DemoCache.saveNewUserChargeGift(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1035,6 +1047,11 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onNewUserChargeEvent(NewUserChargeEvent event) {
|
||||||
|
new NewUserChargePrizeDialog(this, event.getChargeProdTitle(), event.getFirstChargeRewardList()).openDialog();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理开房限制时长
|
* 处理开房限制时长
|
||||||
*/
|
*/
|
||||||
|
@@ -1026,6 +1026,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
if (fromType == FROM_TYPE_HELLO) {
|
if (fromType == FROM_TYPE_HELLO) {
|
||||||
getMvpPresenter().checkHelloMessage();
|
getMvpPresenter().checkHelloMessage();
|
||||||
}
|
}
|
||||||
|
if (!AvRoomDataManager.get().isRoomOwner() &&
|
||||||
|
DemoCache.readNewUserChargeGift() == 0) {
|
||||||
|
DemoCache.saveNewUserChargeGift(1);
|
||||||
|
}
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,245 @@
|
|||||||
|
package com.yizhuan.erban.avroom.newuserchargegift
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.text.Spannable
|
||||||
|
import android.text.SpannableStringBuilder
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.WindowManager
|
||||||
|
import androidx.core.view.isInvisible
|
||||||
|
import androidx.core.view.isVisible
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||||
|
import com.netease.nim.uikit.common.util.sys.TimeUtil
|
||||||
|
import com.trello.rxlifecycle3.android.ActivityEvent
|
||||||
|
import com.trello.rxlifecycle3.android.FragmentEvent
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.avroom.firstcharge.SelectPayTypeDialog
|
||||||
|
import com.yizhuan.erban.bank_card.activity.AddBankCardAgreementActivity
|
||||||
|
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||||
|
import com.yizhuan.erban.common.widget.dialog.DialogManager.AbsOkDialogListener
|
||||||
|
import com.yizhuan.erban.databinding.DialogNewUserChargeGiftBinding
|
||||||
|
import com.yizhuan.erban.ui.setting.ModifyPwdActivity
|
||||||
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
|
import com.yizhuan.erban.ui.webview.CommonWebViewActivity
|
||||||
|
import com.yizhuan.xchat_android_core.UriProvider
|
||||||
|
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||||
|
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||||
|
import com.yizhuan.xchat_android_core.pay.PaymentActivity
|
||||||
|
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeGoods
|
||||||
|
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||||
|
import com.yizhuan.xchat_android_core.pay.bean.PaymentResult
|
||||||
|
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
||||||
|
import com.yizhuan.xchat_android_core.pay.event.NewUserChargeEvent
|
||||||
|
import com.yizhuan.xchat_android_core.pay.model.unionpay.UnionPayModel
|
||||||
|
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||||
|
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||||
|
import com.yizhuan.xchat_android_core.utils.toast
|
||||||
|
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||||
|
import com.yizhuan.xchat_android_library.utils.JavaUtil
|
||||||
|
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||||
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
import org.greenrobot.eventbus.Subscribe
|
||||||
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
@ActLayoutRes(R.layout.dialog_new_user_charge_gift)
|
||||||
|
class NewUserChargeGiftDialog : BaseViewBindingActivity<DialogNewUserChargeGiftBinding>() {
|
||||||
|
|
||||||
|
private var goodsList: List<FirstChargeGoods>? = null
|
||||||
|
private var currGoods: FirstChargeGoods? = null
|
||||||
|
private lateinit var rewardAdapter: RewardAdapter
|
||||||
|
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context) {
|
||||||
|
val starter = Intent(context, NewUserChargeGiftDialog::class.java)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
|
||||||
|
private const val BIND_CODE_GOLD = 200
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
|
override fun init() {
|
||||||
|
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什么鬼
|
||||||
|
val height = ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context)
|
||||||
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, height)
|
||||||
|
window.setGravity(Gravity.CENTER)
|
||||||
|
EventBus.getDefault().register(this)
|
||||||
|
binding.rgPlan.setOnCheckedChangeListener { group, checkedId ->
|
||||||
|
updateCurrGoods(goodsList?.getOrNull(group.indexOfChild(group.findViewById(checkedId))))
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.tvCharge.setOnClickListener {
|
||||||
|
currGoods?.let {
|
||||||
|
SelectPayTypeDialog.newInstance(it.chargeProdId, "¥${it.chargeMoney}")
|
||||||
|
.show(this)
|
||||||
|
} ?: run {
|
||||||
|
"请选择充值产品!".toast()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||||
|
.setAdapter(RewardAdapter().also { rewardAdapter = it })
|
||||||
|
.setLayoutManager(LinearLayoutManager(this, RecyclerView.HORIZONTAL, false))
|
||||||
|
.setRecyclerView(binding.recyclerView)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
dialogManager.showProgressDialog(this)
|
||||||
|
PayModel.get().firstChargeList
|
||||||
|
.compose(bindToLifecycle())
|
||||||
|
.subscribe({
|
||||||
|
initData(it)
|
||||||
|
dialogManager.dismissDialog()
|
||||||
|
}, {
|
||||||
|
it.printStackTrace()
|
||||||
|
dialogManager.dismissDialog()
|
||||||
|
SingleToastUtil.showToast(it.message)
|
||||||
|
finish()
|
||||||
|
})
|
||||||
|
|
||||||
|
binding.viewBg.setOnClickListener {
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
binding.root.setOnClickListener {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
private fun initData(goodsList: List<FirstChargeGoods>) {
|
||||||
|
this.goodsList = goodsList
|
||||||
|
updateCurrGoods(goodsList.getOrNull(0))
|
||||||
|
initNewUserCharge(CurrentTimeUtils.getCurrentTime() + 3 * 60 * 1000)
|
||||||
|
val planViews = arrayListOf(
|
||||||
|
binding.rbPlanA,
|
||||||
|
binding.rbPlanB,
|
||||||
|
binding.rbPlanC,
|
||||||
|
binding.rbPlanD,
|
||||||
|
binding.rbPlanE
|
||||||
|
)
|
||||||
|
var initChecked = false
|
||||||
|
planViews.forEachIndexed { index, button ->
|
||||||
|
goodsList.getOrNull(index)?.let {
|
||||||
|
if (!it.isFinish && !initChecked) {
|
||||||
|
initChecked = true
|
||||||
|
button.isChecked = true
|
||||||
|
}
|
||||||
|
button.isVisible = true
|
||||||
|
button.text = "${it.chargeMoney}元"
|
||||||
|
} ?: run {
|
||||||
|
button.isVisible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
|
private fun initNewUserCharge(limitChargeEndTime: Long) {
|
||||||
|
val count = (limitChargeEndTime - CurrentTimeUtils.getCurrentTime()) / 1000 / 60 + 1
|
||||||
|
Observable.intervalRange(0, count, 0, 1, TimeUnit.MINUTES)
|
||||||
|
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.doOnComplete {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
.subscribe({
|
||||||
|
val residueTime =
|
||||||
|
limitChargeEndTime - CurrentTimeUtils.getCurrentTime()
|
||||||
|
if (residueTime <= 0) {
|
||||||
|
finish()
|
||||||
|
} else {
|
||||||
|
binding.tvTime.text =
|
||||||
|
TimeUtil.getElapseTimeForNewUserCharge(residueTime)
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
it.printStackTrace()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateCurrGoods(firstChargeGoods: FirstChargeGoods?) {
|
||||||
|
firstChargeGoods?.let {
|
||||||
|
currGoods = it
|
||||||
|
val giveMoneyIndex = it.chargeProdTitle.lastIndexOf(it.giveMoney)
|
||||||
|
if (giveMoneyIndex == -1) {
|
||||||
|
binding.tvTitle.text = it.chargeProdTitle
|
||||||
|
} else {
|
||||||
|
val builder = SpannableStringBuilder(it.chargeProdTitle)
|
||||||
|
builder.setSpan(
|
||||||
|
ForegroundColorSpan(Color.parseColor("#FFA027")), giveMoneyIndex,
|
||||||
|
giveMoneyIndex + (it.giveMoney?.length ?: 0),
|
||||||
|
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||||
|
)
|
||||||
|
binding.tvTitle.text = builder
|
||||||
|
}
|
||||||
|
binding.tvCharge.isInvisible = it.isFinish
|
||||||
|
rewardAdapter.setNewData(it.firstChargeRewardList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
dialogManager.dismissDialog()
|
||||||
|
if (resultCode != RESULT_OK) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//支付页面返回处理
|
||||||
|
if (requestCode == PaymentActivity.REQUEST_CODE_PAY) {
|
||||||
|
if (data != null && data.extras != null) {
|
||||||
|
val paymentResult: PaymentResult? =
|
||||||
|
data.getParcelableExtra(PaymentActivity.KEY_PAY_RESULT)
|
||||||
|
if (paymentResult != null) {
|
||||||
|
// 充值金额超过限定时,就必须先实名认证
|
||||||
|
when (JavaUtil.str2int(paymentResult.code)) {
|
||||||
|
PayModel.NOT_REAL_NAME_BEFORE_CHARGING -> dialogManager.showTipsDialog(
|
||||||
|
getString(R.string.tips_need_to_certification),
|
||||||
|
getString(R.string.go_to_certification),
|
||||||
|
object : AbsOkDialogListener() {
|
||||||
|
override fun onOk() {
|
||||||
|
// 跳去实名认证页面
|
||||||
|
CommonWebViewActivity.start(
|
||||||
|
this@NewUserChargeGiftDialog,
|
||||||
|
UriProvider.getTutuRealNamePage()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
UnionPayModel.CODE_NEED_BIND_BANK_CARD_FIRST -> dialogManager.showTipsDialog(
|
||||||
|
getString(R.string.tips_need_bind_bank_card_first),
|
||||||
|
object : AbsOkDialogListener() {
|
||||||
|
override fun onOk() {
|
||||||
|
// 跳去添加银行卡页面
|
||||||
|
AddBankCardAgreementActivity.start(this@NewUserChargeGiftDialog)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
else -> {
|
||||||
|
toast(paymentResult.msg)
|
||||||
|
//重新获取钱包信息
|
||||||
|
PayModel.get().getWalletInfo(AuthModel.get().currentUid).subscribe()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (requestCode == BIND_CODE_GOLD) {
|
||||||
|
ModifyPwdActivity.start(this, ModifyPwdActivity.FOGERT_PAY_PWD)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
fun onNewUserChargeEvent(event: NewUserChargeEvent?) {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
EventBus.getDefault().unregister(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,38 @@
|
|||||||
|
package com.yizhuan.erban.avroom.newuserchargegift
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.google.android.flexbox.AlignItems
|
||||||
|
import com.google.android.flexbox.FlexboxLayoutManager
|
||||||
|
import com.google.android.flexbox.JustifyContent
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.databinding.DialogFirstChargePrizeBinding
|
||||||
|
import com.yizhuan.erban.databinding.DialogNewUserChargePrizeBinding
|
||||||
|
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||||
|
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||||
|
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||||
|
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||||
|
|
||||||
|
@ActLayoutRes(R.layout.dialog_new_user_charge_prize)
|
||||||
|
class NewUserChargePrizeDialog(
|
||||||
|
context: Context,
|
||||||
|
val title: String?,
|
||||||
|
private val firstChargeRewardList: List<FirstChargeReward>?
|
||||||
|
) : BaseBindingDialog<DialogNewUserChargePrizeBinding>(context) {
|
||||||
|
|
||||||
|
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||||
|
.setAdapter(RewardAdapter())
|
||||||
|
.setLayoutManager(LinearLayoutManager(context, RecyclerView.HORIZONTAL, false))
|
||||||
|
.setRecyclerView(binding.recyclerView)
|
||||||
|
.build()
|
||||||
|
binding.ivKnow.setOnClickListener {
|
||||||
|
closeDialog()
|
||||||
|
}
|
||||||
|
rvDelegate.setNewData(firstChargeRewardList)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,21 @@
|
|||||||
|
package com.yizhuan.erban.avroom.newuserchargegift
|
||||||
|
|
||||||
|
import android.widget.ImageView
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
|
import com.yizhuan.erban.R
|
||||||
|
import com.yizhuan.erban.ui.utils.load
|
||||||
|
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||||
|
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||||
|
|
||||||
|
class RewardAdapter :
|
||||||
|
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_new_user_charge_reward) {
|
||||||
|
override fun convert(helper: BaseViewHolder, item: FirstChargeReward) {
|
||||||
|
|
||||||
|
helper.getView<ImageView>(R.id.iv_pic).load(item.showPir)
|
||||||
|
|
||||||
|
helper.setText(R.id.tv_name, item.showText)
|
||||||
|
.setText(R.id.tv_time, "(${item.showTime})")
|
||||||
|
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.showTime))
|
||||||
|
}
|
||||||
|
}
|
@@ -443,7 +443,9 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
|||||||
*/
|
*/
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
public void checkNewUserGift() {
|
public void checkNewUserGift() {
|
||||||
if (AvRoomDataManager.get().mCurrentRoomInfo == null || !DemoCache.readNewUserGift())
|
|
||||||
|
if (AvRoomDataManager.get().isRoomOwner() ||
|
||||||
|
!DemoCache.readNewUserGift())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Single.timer(3, TimeUnit.SECONDS)
|
Single.timer(3, TimeUnit.SECONDS)
|
||||||
|
@@ -14,9 +14,13 @@ import androidx.recyclerview.widget.GridLayoutManager
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.viewpager.widget.PagerAdapter
|
import androidx.viewpager.widget.PagerAdapter
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.netease.nim.uikit.common.util.sys.TimeUtil
|
||||||
|
import com.trello.rxlifecycle3.android.FragmentEvent
|
||||||
|
import com.yizhuan.erban.BuildConfig
|
||||||
import com.yizhuan.erban.R
|
import com.yizhuan.erban.R
|
||||||
import com.yizhuan.erban.UIHelper
|
import com.yizhuan.erban.UIHelper
|
||||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||||
|
import com.yizhuan.erban.avroom.newuserchargegift.NewUserChargeGiftDialog
|
||||||
import com.yizhuan.erban.base.BaseActivity
|
import com.yizhuan.erban.base.BaseActivity
|
||||||
import com.yizhuan.erban.base.BaseFragment
|
import com.yizhuan.erban.base.BaseFragment
|
||||||
import com.yizhuan.erban.databinding.FragmentMeBinding
|
import com.yizhuan.erban.databinding.FragmentMeBinding
|
||||||
@@ -56,14 +60,21 @@ import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
|
|||||||
import com.yizhuan.xchat_android_core.user.UserModel
|
import com.yizhuan.xchat_android_core.user.UserModel
|
||||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent
|
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent
|
||||||
|
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||||
import com.yizhuan.xchat_android_core.utils.StarUtils
|
import com.yizhuan.xchat_android_core.utils.StarUtils
|
||||||
import com.yizhuan.xchat_android_library.rxbus.RxBusHelper
|
import com.yizhuan.xchat_android_library.rxbus.RxBusHelper
|
||||||
import com.yizhuan.xchat_android_library.utils.FormatUtils
|
import com.yizhuan.xchat_android_library.utils.FormatUtils
|
||||||
import com.yizhuan.xchat_android_library.utils.ListUtils
|
import com.yizhuan.xchat_android_library.utils.ListUtils
|
||||||
|
import com.yizhuan.xchat_android_library.utils.TimeUtils
|
||||||
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.disposables.Disposable
|
||||||
|
import io.reactivex.internal.operators.observable.ObservableRangeLong
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.greenrobot.eventbus.Subscribe
|
import org.greenrobot.eventbus.Subscribe
|
||||||
import org.greenrobot.eventbus.ThreadMode
|
import org.greenrobot.eventbus.ThreadMode
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 我的 界面
|
* @description: 我的 界面
|
||||||
@@ -81,6 +92,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
|||||||
private val meViewModel: MeViewModel by viewModels()
|
private val meViewModel: MeViewModel by viewModels()
|
||||||
private val homeViewModel: HomeViewModel by activityViewModels()
|
private val homeViewModel: HomeViewModel by activityViewModels()
|
||||||
private val vipViewModel: VipViewModel by viewModels()
|
private val vipViewModel: VipViewModel by viewModels()
|
||||||
|
private var newUserDisposable: Disposable? = null
|
||||||
override fun getRootLayoutId(): Int {
|
override fun getRootLayoutId(): Int {
|
||||||
return R.layout.fragment_me
|
return R.layout.fragment_me
|
||||||
}
|
}
|
||||||
@@ -341,10 +353,51 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
|||||||
val star = StarUtils.getConstellation(Date(it.birth))
|
val star = StarUtils.getConstellation(Date(it.birth))
|
||||||
mBinding.tvConstellation.text = star
|
mBinding.tvConstellation.text = star
|
||||||
setUserLevel(it.userLevelVo)
|
setUserLevel(it.userLevelVo)
|
||||||
|
initNewUserCharge(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun initNewUserCharge(userinfo: UserInfo) {
|
||||||
|
//test
|
||||||
|
if (BuildConfig.DEBUG && !userinfo.isShowLimitCharge) {
|
||||||
|
userinfo.isShowLimitCharge = true
|
||||||
|
userinfo.limitChargeEndTime =
|
||||||
|
CurrentTimeUtils.getCurrentTime() + 2 * 60 * 1000 + 30 * 1000
|
||||||
|
}
|
||||||
|
if (userinfo.isShowLimitCharge) {
|
||||||
|
mBinding.flNewUserCharge.isVisible = true
|
||||||
|
val count =
|
||||||
|
(userinfo.limitChargeEndTime - CurrentTimeUtils.getCurrentTime()) / 1000 / 60 + 1
|
||||||
|
newUserDisposable?.dispose()
|
||||||
|
newUserDisposable =
|
||||||
|
Observable.intervalRange(0, count, 0, 1, TimeUnit.MINUTES)
|
||||||
|
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.doOnComplete {
|
||||||
|
userinfo.isShowLimitCharge = false
|
||||||
|
mBinding.flNewUserCharge.isVisible = false
|
||||||
|
}
|
||||||
|
.subscribe({
|
||||||
|
val residueTime =
|
||||||
|
userinfo.limitChargeEndTime - CurrentTimeUtils.getCurrentTime()
|
||||||
|
if (residueTime <= 0) {
|
||||||
|
userinfo.isShowLimitCharge = false
|
||||||
|
mBinding.flNewUserCharge.isVisible = false
|
||||||
|
} else {
|
||||||
|
mBinding.tvNewUserChargeEndTime.text =
|
||||||
|
TimeUtil.getElapseTimeForNewUserCharge(residueTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
mBinding.flNewUserCharge.isVisible = false
|
||||||
|
it.printStackTrace()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
mBinding.flNewUserCharge.isVisible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setUserLevel(userLevelVo: UserLevelVo?) {
|
private fun setUserLevel(userLevelVo: UserLevelVo?) {
|
||||||
mBinding.ivUserCharm.visibility = View.GONE
|
mBinding.ivUserCharm.visibility = View.GONE
|
||||||
mBinding.ivUserLevel.visibility = View.GONE
|
mBinding.ivUserLevel.visibility = View.GONE
|
||||||
@@ -425,6 +478,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
|||||||
R.id.tv_user_visitor -> VisitorListActivity.start(mContext)
|
R.id.tv_user_visitor -> VisitorListActivity.start(mContext)
|
||||||
R.id.me_item_wallet -> ChargeActivity.start(mContext)
|
R.id.me_item_wallet -> ChargeActivity.start(mContext)
|
||||||
R.id.tv_user_history -> RoomHistoryListActivity.start(mContext)
|
R.id.tv_user_history -> RoomHistoryListActivity.start(mContext)
|
||||||
|
R.id.fl_new_user_charge -> NewUserChargeGiftDialog.start(mContext)
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.yizhuan.erban.ui.patriarch;
|
package com.yizhuan.erban.ui.patriarch;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
@@ -13,8 +14,10 @@ import android.widget.ImageView;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
|
import com.yizhuan.erban.avroom.newuserchargegift.NewUserChargeGiftDialog;
|
||||||
import com.yizhuan.erban.base.BaseSdDialog;
|
import com.yizhuan.erban.base.BaseSdDialog;
|
||||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||||
|
import com.yizhuan.xchat_android_core.DemoCache;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@@ -52,6 +55,12 @@ public class PatriarchModeDialog extends BaseSdDialog {
|
|||||||
windowParams.gravity = Gravity.CENTER;
|
windowParams.gravity = Gravity.CENTER;
|
||||||
window.setAttributes(windowParams);
|
window.setAttributes(windowParams);
|
||||||
}
|
}
|
||||||
|
setOnDismissListener(dialog -> {
|
||||||
|
if (DemoCache.readNewUserChargeGift() == 1) {
|
||||||
|
NewUserChargeGiftDialog.start(context);
|
||||||
|
DemoCache.saveNewUserChargeGift(2);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick({R.id.tv_set_pm, R.id.iv_close})
|
@OnClick({R.id.tv_set_pm, R.id.iv_close})
|
||||||
|
@@ -31,6 +31,7 @@ import lombok.Setter;
|
|||||||
*/
|
*/
|
||||||
public class PmDialogShowMrg {
|
public class PmDialogShowMrg {
|
||||||
|
|
||||||
|
@Getter
|
||||||
private boolean hasShow;
|
private boolean hasShow;
|
||||||
|
|
||||||
private final static String KEY_SAVE_PATRIARCH_MODE_STATUS = "key_save_patriarch_mode_status";
|
private final static String KEY_SAVE_PATRIARCH_MODE_STATUS = "key_save_patriarch_mode_status";
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:color="@color/white" android:state_checked="true" />
|
||||||
|
<item android:color="@color/white" android:state_selected="true" />
|
||||||
|
<item android:color="@color/color_999999" />
|
||||||
|
|
||||||
|
</selector>
|
After Width: | Height: | Size: 8.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_new_user_charge_gift.png
Normal file
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_new_user_charge_prize.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_new_user_charge_prize_ok.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 1015 B |
BIN
app/src/main/res/drawable-xhdpi/ic_new_user_charge_close.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
7
app/src/main/res/drawable/bg_new_user_charge_rb_plan.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/bg_new_user_charge_rb_checked" android:state_checked="true" />
|
||||||
|
|
||||||
|
<item android:drawable="@drawable/bg_new_user_charge_rb_unchecked"/>
|
||||||
|
|
||||||
|
</selector>
|
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="#1a000000" />
|
||||||
|
<corners
|
||||||
|
android:radius="8dp" />
|
||||||
|
</shape>
|
164
app/src/main/res/layout/dialog_new_user_charge_gift.xml
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
tools:background="@color/black_transparent_50">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_close"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:src="@drawable/ic_new_user_charge_close"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/view_bg"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_bg" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg"
|
||||||
|
android:layout_width="315dp"
|
||||||
|
android:layout_height="405dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_gift"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_time"
|
||||||
|
android:layout_width="136dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="21dp"
|
||||||
|
android:layout_marginTop="87dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="限时6天23小时9分"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/rg_plan"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:layout_marginTop="128dp"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_plan_a"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_rb_plan"
|
||||||
|
android:button="@null"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/color_selector_white_false_999"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="1元" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_plan_b"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_rb_plan"
|
||||||
|
android:button="@null"
|
||||||
|
android:checked="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/color_selector_white_false_999"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="1元" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_plan_c"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_rb_plan"
|
||||||
|
android:button="@null"
|
||||||
|
android:checked="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/color_selector_white_false_999"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="1元" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_plan_d"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_rb_plan"
|
||||||
|
android:button="@null"
|
||||||
|
android:checked="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/color_selector_white_false_999"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="1元" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_plan_e"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_rb_plan"
|
||||||
|
android:button="@null"
|
||||||
|
android:checked="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/color_selector_white_false_999"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="1元" />
|
||||||
|
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:textColor="#FF3987"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rg_plan"
|
||||||
|
tools:text="充A元额外送abC元礼包" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
app:layout_constrainedWidth="true"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tv_charge"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_charge"
|
||||||
|
android:layout_width="244dp"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_marginBottom="28dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_charge_btn"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_bg"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
49
app/src/main/res/layout/dialog_new_user_charge_prize.xml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="279dp"
|
||||||
|
android:layout_height="268dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_prize"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="94dp"
|
||||||
|
android:layout_marginTop="73dp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_know"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="44dp"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@drawable/bg_new_user_charge_prize_ok" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:text="装扮已放至【我的装扮】"
|
||||||
|
android:textColor="#E64A94"
|
||||||
|
android:textSize="10sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
</layout>
|
||||||
|
|
@@ -86,7 +86,7 @@
|
|||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_avatar_auditing"
|
android:src="@drawable/ic_avatar_auditing"
|
||||||
android:visibility="@{userInfo.isReview() ?View.VISIBLE:View.GONE}"
|
android:visibility="@{userInfo.isReview()?View.VISIBLE:View.GONE}"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_head"
|
app:layout_constraintBottom_toBottomOf="@id/iv_user_head"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/iv_user_head"
|
app:layout_constraintLeft_toLeftOf="@id/iv_user_head"
|
||||||
app:layout_constraintRight_toRightOf="@id/iv_user_head" />
|
app:layout_constraintRight_toRightOf="@id/iv_user_head" />
|
||||||
@@ -635,6 +635,35 @@
|
|||||||
app:rollviewpager_hint_gravity="left"
|
app:rollviewpager_hint_gravity="left"
|
||||||
app:rollviewpager_hint_paddingBottom="8dp" />
|
app:rollviewpager_hint_paddingBottom="8dp" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fl_new_user_charge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="170dp"
|
||||||
|
android:onClick="@{click}"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="74dp"
|
||||||
|
android:layout_height="88dp"
|
||||||
|
android:src="@drawable/bg_new_user_charge_me_entrance" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_new_user_charge_end_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal|bottom"
|
||||||
|
android:layout_marginEnd="2dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10dp"
|
||||||
|
tools:text="6天23小时59分" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
65
app/src/main/res/layout/item_new_user_charge_reward.xml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg"
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:background="@drawable/bg_new_user_charge_reward_item"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:src="@drawable/default_cover" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_pic"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_bg"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg"
|
||||||
|
tools:src="@drawable/default_cover" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:lines="1"
|
||||||
|
android:maxWidth="70dp"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/view_bg"
|
||||||
|
tools:text="玫瑰玫瑰玫瑰玫瑰" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="1dp"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text="(14天)"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_name" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -64,6 +64,7 @@ public class DemoCache {
|
|||||||
private static final String KEY_BGM_SINGLE_CYCLE = "key_bgm_single_cycle";
|
private static final String KEY_BGM_SINGLE_CYCLE = "key_bgm_single_cycle";
|
||||||
private static final String KEY_SINGLE_ROOM_TIP = "key_single_room_tip";
|
private static final String KEY_SINGLE_ROOM_TIP = "key_single_room_tip";
|
||||||
private static final String KEY_NEW_USER_GIFT = "key_new_user_gift";
|
private static final String KEY_NEW_USER_GIFT = "key_new_user_gift";
|
||||||
|
private static final String KEY_NEW_USER_CHARGE_GIFT = "key_new_user_charge_gift";
|
||||||
/**
|
/**
|
||||||
* 保存网页域名
|
* 保存网页域名
|
||||||
*/
|
*/
|
||||||
@@ -358,11 +359,23 @@ public class DemoCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void saveNewUserGift(boolean value) {
|
public static void saveNewUserGift(boolean value) {
|
||||||
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putBoolean(KEY_SINGLE_ROOM_TIP , value);
|
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putBoolean(KEY_NEW_USER_GIFT , value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean readNewUserGift() {
|
public static Boolean readNewUserGift() {
|
||||||
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_SINGLE_ROOM_TIP, true);
|
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getBoolean(KEY_NEW_USER_GIFT, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param value 0初始值 1 需要弹窗 2 不需要弹窗
|
||||||
|
*/
|
||||||
|
public static void saveNewUserChargeGift(int value) {
|
||||||
|
SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).putInt(KEY_NEW_USER_CHARGE_GIFT , value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int readNewUserChargeGift() {
|
||||||
|
return SettingsPref.instance(BasicConfig.INSTANCE.getAppContext()).getInt(KEY_NEW_USER_CHARGE_GIFT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -335,6 +335,7 @@ public class CustomAttachment implements MsgAttachment {
|
|||||||
//首充礼包
|
//首充礼包
|
||||||
public static final int CUSTOM_MSG_FIRST_CHARGE = 76;
|
public static final int CUSTOM_MSG_FIRST_CHARGE = 76;
|
||||||
public static final int CUSTOM_MSG_SUB_FIRST_CHARGE_PRIZE = 761;
|
public static final int CUSTOM_MSG_SUB_FIRST_CHARGE_PRIZE = 761;
|
||||||
|
public static final int CUSTOM_MSG_SUB_NEW_USER_CHARGE_PRIZE = 762;
|
||||||
//访客未读
|
//访客未读
|
||||||
public static final int CUSTOM_MSG_HEADER_TYPE_VISITOR = 78;
|
public static final int CUSTOM_MSG_HEADER_TYPE_VISITOR = 78;
|
||||||
public static final int CUSTOM_MSG_SUB_TYPE_VISITOR_UNREAD = 781;
|
public static final int CUSTOM_MSG_SUB_TYPE_VISITOR_UNREAD = 781;
|
||||||
|
@@ -38,6 +38,7 @@ import com.yizhuan.xchat_android_core.pay.bean.FirstChargeGoods;
|
|||||||
import com.yizhuan.xchat_android_core.pay.event.ChargeCustomNotificationEvent;
|
import com.yizhuan.xchat_android_core.pay.event.ChargeCustomNotificationEvent;
|
||||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||||
import com.yizhuan.xchat_android_core.pay.event.FirstRechargeEvent;
|
import com.yizhuan.xchat_android_core.pay.event.FirstRechargeEvent;
|
||||||
|
import com.yizhuan.xchat_android_core.pay.event.NewUserChargeEvent;
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||||
@@ -302,6 +303,12 @@ public class IMSystemMsgManager {
|
|||||||
event.setChargeProdTitle(firstChargeGoods.getChargeProdTitle());
|
event.setChargeProdTitle(firstChargeGoods.getChargeProdTitle());
|
||||||
event.setFirstChargeRewardList(firstChargeGoods.getFirstChargeRewardList());
|
event.setFirstChargeRewardList(firstChargeGoods.getFirstChargeRewardList());
|
||||||
EventBus.getDefault().post(event);
|
EventBus.getDefault().post(event);
|
||||||
|
}else if (subType == CustomAttachment.CUSTOM_MSG_SUB_NEW_USER_CHARGE_PRIZE){
|
||||||
|
FirstChargeGoods firstChargeGoods = data.toJavaObject(FirstChargeGoods.class);
|
||||||
|
NewUserChargeEvent event = new NewUserChargeEvent();
|
||||||
|
event.setChargeProdTitle(firstChargeGoods.getChargeProdTitle());
|
||||||
|
event.setFirstChargeRewardList(firstChargeGoods.getFirstChargeRewardList());
|
||||||
|
EventBus.getDefault().post(event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CUSTOM_MSG_VIP:
|
case CUSTOM_MSG_VIP:
|
||||||
|
@@ -14,4 +14,5 @@ public class FirstChargeGoods {
|
|||||||
private String chargeProdTitle;
|
private String chargeProdTitle;
|
||||||
private ArrayList<FirstChargeReward> firstChargeRewardList;
|
private ArrayList<FirstChargeReward> firstChargeRewardList;
|
||||||
private String giveMoney;
|
private String giveMoney;
|
||||||
|
private boolean finish;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,14 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.pay.event;
|
||||||
|
|
||||||
|
|
||||||
|
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class NewUserChargeEvent {
|
||||||
|
private String chargeProdTitle;
|
||||||
|
private ArrayList<FirstChargeReward> firstChargeRewardList;
|
||||||
|
}
|
@@ -273,6 +273,13 @@ public class UserInfo implements Serializable {
|
|||||||
@Setter
|
@Setter
|
||||||
private String iosBubbleUrl;
|
private String iosBubbleUrl;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private boolean showLimitCharge;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private long limitChargeEndTime;
|
||||||
|
|
||||||
public UserInfo() {
|
public UserInfo() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -302,6 +302,23 @@ public class TimeUtil {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getElapseTimeForNewUserCharge(long milliseconds) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
long seconds = milliseconds / 1000;
|
||||||
|
if (seconds < 1) seconds = 1;
|
||||||
|
|
||||||
|
long day = seconds / (60 * 60 * 24);
|
||||||
|
sb.append(day).append("天");
|
||||||
|
|
||||||
|
long hour = seconds / (60 * 60) % 24;
|
||||||
|
sb.append(hour).append("时");
|
||||||
|
|
||||||
|
long minute = (seconds - 60 * 60 * hour) / 60;
|
||||||
|
sb.append(minute).append("分");
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public static String getElapseTimeForShow(int milliseconds) {
|
public static String getElapseTimeForShow(int milliseconds) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
int seconds = milliseconds / 1000;
|
int seconds = milliseconds / 1000;
|
||||||
|