feat : cp 功能 , 个人主页UI修改 , cp列表 , 房间cp飘屏,cp相关动画 , vip中心banner 显示剩余时间

This commit is contained in:
eggmanQQQ
2024-09-23 16:10:39 +08:00
parent f929d78540
commit 36c011d18e
135 changed files with 4272 additions and 829 deletions

View File

@@ -316,6 +316,9 @@
android:name=".ui.user.activity.UserInfoActivity"
android:label="@string/main_androidmanifest_016"
android:screenOrientation="portrait" />
<activity
android:name=".ui.user.activity.UserCpListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".audio.AudioRecordActivity"
android:label="@string/main_androidmanifest_017"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -18,7 +18,7 @@ import com.chwl.app.R
import com.chwl.app.avroom.widget.VDHLayout
import com.chwl.app.ui.widget.dialog.BaseDialog
abstract class BaseRoomNotifyeBaseDialog<VB : ViewBinding>(context: Context, theme: Int = 0) : BaseDialog(context, theme) {
abstract class BaseRoomNotifyDialog<VB : ViewBinding>(context: Context, theme: Int = 0) : BaseDialog(context, theme) {
protected val handle = Handler(Looper.getMainLooper())
protected lateinit var mBinding: VB
@@ -39,9 +39,11 @@ abstract class BaseRoomNotifyeBaseDialog<VB : ViewBinding>(context: Context, the
init()
handle.postDelayed({
dismissDialog()
}, (getStaySecond()*1000).toLong())
if (useAutoDismiss()) {
handle.postDelayed({
dismissDialog()
}, (getStaySecond()*1000).toLong())
}
}
override fun onDetachedFromWindow() {
@@ -110,17 +112,38 @@ abstract class BaseRoomNotifyeBaseDialog<VB : ViewBinding>(context: Context, the
super.setContentView(view, params)
}
open fun dismissDialog(){
try {
dismiss()
} catch (e: Exception) {
}
}
/**
* 是否启动侧滑左滑删除右滑回到原位置
*/
protected open fun useSlipSlip(): Boolean {
return true
}
protected open fun useAutoDismiss(): Boolean {
return true
}
var mCallBack : CallBack? = null
interface CallBack{
fun onHide();
}
open fun dismissDialog() {
try {
dismiss()
} catch (e: Exception) {
}
mCallBack?.onHide()
}
open fun clearDialog() {
try {
dismiss()
} catch (e: Exception) {
}
}
open fun showDialog(){
show()
}
}

View File

@@ -0,0 +1,87 @@
package com.chwl.app.avroom.dialog
import android.content.Context
import android.graphics.Bitmap
import android.view.LayoutInflater
import com.chwl.app.databinding.RoomNotifyCpBindBinding
import com.chwl.app.ui.utils.CpUtils
import com.chwl.core.gift.bean.CpMsgBean
import com.chwl.core.utils.LogUtils
import com.tencent.qgame.animplayer.inter.IFetchResource
import com.tencent.qgame.animplayer.mix.Resource
import com.tencent.qgame.animplayer.util.ScaleType
class RoomNotifyCpBindDialog (private val context: Context) : BaseRoomNotifyDialog<RoomNotifyCpBindBinding>(context) {
override fun createBinding(inflater: LayoutInflater): RoomNotifyCpBindBinding {
return RoomNotifyCpBindBinding.inflate(inflater)
}
var cpMsgBean : CpMsgBean? = null
var senderAvatar : Bitmap? = null
var receiverAvatar : Bitmap? = null
var index = 0
override fun init() {
cpMsgBean?.let { data->
mBinding.anim.setScaleType(ScaleType.CENTER_CROP)
mBinding.anim.setFetchResource(object : IFetchResource {
override fun fetchImage(resource: Resource, result: (Bitmap?) -> Unit) {
result(if (resource.tag == "avatar1") senderAvatar else receiverAvatar)
}
override fun fetchText(resource: Resource, result: (String?) -> Unit) {
var name = ""
try {
name = if (resource.tag == "name1") data.senderNick else data.receiverNick
} catch (e: Exception) {
}
result(name)
}
override fun releaseResource(resources: List<Resource>) {
resources?.forEach {
it?.bitmap?.recycle()
}
}
})
mBinding.anim.startPlay(context.assets,"mp4/cp_bind.mp4")
}
}
override fun useSlipSlip() = false
override fun useAutoDismiss() = true
override fun showDialog() {
index = 0
cpMsgBean?.let {
CpUtils.downLoadAvatar(it.senderAvatar) { resource ->
index += 1
senderAvatar = resource
checkImg()
}
CpUtils.downLoadAvatar(it.receiverAvatar) { resource ->
index += 1
receiverAvatar = resource
checkImg()
}
}
}
fun checkImg() {
if (index == 2){
show()
}
}
}

View File

@@ -0,0 +1,31 @@
package com.chwl.app.avroom.dialog
import android.content.Context
import android.view.LayoutInflater
import com.chwl.app.databinding.RoomNotifyCpGiftBinding
import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.core.gift.bean.CpMsgBean
import kotlin.math.truncate
/**
* cp 飘屏
*/
class RoomNotifyCpGiftDialog (private val context: Context) : BaseRoomNotifyDialog<RoomNotifyCpGiftBinding>(context) {
override fun createBinding(inflater: LayoutInflater): RoomNotifyCpGiftBinding {
return RoomNotifyCpGiftBinding.inflate(inflater)
}
var cpMsgBean : CpMsgBean? = null
override fun init() {
cpMsgBean?.let {
ImageLoadUtils.loadImage(mBinding.sendAvatar,it.senderAvatar)
ImageLoadUtils.loadImage(mBinding.receiverAvatar,it.receiverNick)
ImageLoadUtils.loadImage(mBinding.gift,it.giftUrl)
}
}
override fun useSlipSlip() = true
}

View File

@@ -0,0 +1,101 @@
package com.chwl.app.avroom.dialog
import android.content.Context
import android.graphics.Color
import android.text.Layout
import android.text.StaticLayout
import android.text.TextPaint
import android.view.LayoutInflater
import com.chwl.app.R
import com.chwl.app.avroom.helper.AnimHelper
import com.chwl.app.databinding.RoomNotifyCpLevelUpBinding
import com.chwl.app.ui.utils.CpUtils
import com.chwl.app.ui.utils.loadFromAssets
import com.chwl.app.utils.SpannableBuilder
import com.chwl.core.gift.bean.CpMsgBean
import com.chwl.core.utils.SpanUtils
import com.example.lib_utils.ktx.getColor
import com.example.lib_utils.ktx.getString
import com.opensource.svgaplayer.SVGADrawable
import com.opensource.svgaplayer.SVGADynamicEntity
import com.opensource.svgaplayer.SVGAParser
import com.opensource.svgaplayer.SVGAParser.Companion.shareParser
import com.opensource.svgaplayer.SVGAVideoEntity
class RoomNotifyLevelUpDialog (private val context: Context) : BaseRoomNotifyDialog<RoomNotifyCpLevelUpBinding>(context) {
override fun createBinding(inflater: LayoutInflater): RoomNotifyCpLevelUpBinding {
return RoomNotifyCpLevelUpBinding.inflate(inflater)
}
var cpMsgBean : CpMsgBean ? = null
override fun init() {
cpMsgBean?.let {
SpanUtils.with(mBinding.text)
.append(it.senderNick).setForegroundColor(R.color.white.getColor())
.append(R.string.avroom_widget_roomeffectview_02.getString()).setForegroundColor(R.color.color_fff664.getColor())
.append(it.receiverNick).setForegroundColor(R.color.white.getColor())
.append(R.string.Become.getString()).setForegroundColor(R.color.color_fff664.getColor())
.append(CpUtils.getCpLevelUpStr(it.cpLevel).toString()).setForegroundColor(R.color.white.getColor())
.create()
mBinding.text.setBackgroundResource(CpUtils.getCpLevelUpTextBg(it.cpLevel))
if (it.cpLevel < 1) return
val svga = "svga/cp_level_up_${it.cpLevel}.svga"
try {
shareParser().decodeFromAssets(svga, object : SVGAParser.ParseCompletion {
override fun onComplete(svgaVideoEntity: SVGAVideoEntity) {
val dynamicEntity = SVGADynamicEntity()
// val textPaint = TextPaint()
// textPaint.color = Color.WHITE //字体颜色
// textPaint.textSize = 24f //字体大小
// dynamicEntity.setDynamicText(
// StaticLayout(
// text.build(),
// 0,
// text.build().length,
// textPaint,
// 0,
// Layout.Alignment.ALIGN_CENTER,
// 1.0f,
// 0.0f,
// false
// ), "bg"
// )
AnimHelper.addDynamicImage(
mBinding.svga,
dynamicEntity,
it.senderAvatar,
"user_img1"
)
AnimHelper.addDynamicImage(
mBinding.svga,
dynamicEntity,
it.receiverAvatar,
"user_img2"
)
val drawable = SVGADrawable(svgaVideoEntity, dynamicEntity)
mBinding.svga.setImageDrawable(drawable)
mBinding.svga.stepToFrame(0, true)
// mBinding.svga.startAnimation()
}
override fun onError() {
}
}, null)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
override fun useSlipSlip() = false
}

View File

@@ -18,7 +18,7 @@ import com.example.lib_utils.UiUtils
* @Author Vance
* 幸运礼物的飘屏全服但是展示的时候限制只有房间才展示
*/
class BaseRoomNotifyeLuckGiftDialog(private val context: Context) : BaseRoomNotifyeBaseDialog<RoomNotifyLuckGiftDlgBinding>(context) {
class RoomNotifyLuckGiftDialog(private val context: Context) : BaseRoomNotifyDialog<RoomNotifyLuckGiftDlgBinding>(context) {
override fun createBinding(inflater: LayoutInflater): RoomNotifyLuckGiftDlgBinding {
return RoomNotifyLuckGiftDlgBinding.inflate(inflater)
@@ -61,15 +61,4 @@ class BaseRoomNotifyeLuckGiftDialog(private val context: Context) : BaseRoomNoti
}
var mCallBack : CallBack? = null
interface CallBack{
fun onHide();
}
override fun dismissDialog() {
super.dismissDialog()
mCallBack?.onHide()
}
}

View File

@@ -79,6 +79,7 @@ import com.chwl.core.auth.AuthModel
import com.chwl.core.bean.RoomMicInfo
import com.chwl.core.gift.GiftModel
import com.chwl.core.gift.bean.GiftInfo
import com.chwl.core.gift.bean.GiftType
import com.chwl.core.gift.event.GiftComboEvent
import com.chwl.core.gift.event.RoomFreeGiftEvent
import com.chwl.core.helper.AtProxy
@@ -113,6 +114,7 @@ import com.chwl.core.support.room.RoomWidget
import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.BaseInfo
import com.chwl.core.user.bean.UserInfo
import com.chwl.core.utils.LogUtils
import com.chwl.core.utils.net.VipLevelNotEnoughException
import com.chwl.library.common.util.LimitClickUtils
import com.chwl.library.net.rxnet.utils.RxNetWorkUtils
@@ -645,14 +647,14 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
@CallSuper
open fun updateMicBtn() {
//todo do 关麦开麦
val currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo
if (currentRoomInfo != null) {
if (AudioEngineManager.get().isAudienceRole) {
bottomView.setMicBtnEnable(false)
bottomView.setMicBtnOpen(false)
} else {
val roomQueueInfo = AvRoomDataManager.get()
.getRoomQueueMemberInfoByAccount(myUid.toString())
val roomQueueInfo = AvRoomDataManager.get().getRoomQueueMemberInfoByAccount(myUid.toString())
if (roomQueueInfo?.mChatRoomMember != null
&& myUid.toString() == roomQueueInfo.mChatRoomMember.account
&& roomQueueInfo.mRoomMicInfo?.isMicMute == true
@@ -896,10 +898,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
callback.onFail()
EventBus.getDefault().post(GiftComboEvent(GiftComboEvent.Action.ACT_GIFT_CANCEL))
} else {
giftDialog?.hide()
val giftComboEvent = GiftComboEvent(GiftComboEvent.Action.ACT_GIFT_END)
giftComboEvent.giftNumber = gift.data.giftNum
EventBus.getDefault().post(giftComboEvent)
if (giftInfo.giftType == GiftType.GIFT_TYPE_NORMAL || giftInfo.giftType == GiftType.GIFT_TYPE_SUPER_LUCKY|| giftInfo.giftType == GiftType.GIFT_TYPE_LUCKY_24) {
giftDialog?.hide()
val giftComboEvent = GiftComboEvent(GiftComboEvent.Action.ACT_GIFT_END)
giftComboEvent.giftNumber = gift.data.giftNum
EventBus.getDefault().post(giftComboEvent)
}
callback.onSuccess()
}
}
@@ -1333,8 +1337,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
open inner class BaseRoomBottomViewWrapper : BottomViewListenerWrapper() {
@SuppressLint("CheckResult")
override fun onOpenMicBtnClick() {
val roomQueueInfo = AvRoomDataManager.get()
.getRoomQueueMemberInfoByAccount(AuthModel.get().currentUid.toString())
//todo do 关麦开麦
val roomQueueInfo = AvRoomDataManager.get().getRoomQueueMemberInfoByAccount(AuthModel.get().currentUid.toString())
if (roomQueueInfo?.mRoomMicInfo == null) return
//先判斷麥上是否是開麥的
if (!roomQueueInfo.mRoomMicInfo.isMicMute && !AudioEngineManager.get().isAudienceRole) {

View File

@@ -22,15 +22,18 @@ import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.chwl.app.avroom.activity.RoomTitleEditActivity;
import com.chwl.app.avroom.dialog.BaseRoomNotifyeLuckGiftDialog;
import com.chwl.app.avroom.dialog.RoomNotifyLuckGiftDialog;
import com.chwl.app.databinding.LayoutRoomNotifyLuckyGiftTipBinding;
import com.chwl.app.utils.GiftAnimUtil;
import com.chwl.app.utils.NumberUtils;
import com.chwl.app.utils.RoomNotifyManager;
import com.chwl.app.utils.WeakPool;
import com.chwl.core.auth.AuthModel;
import com.chwl.core.gift.bean.CpMsgBean;
import com.chwl.core.gift.bean.LuckyGiftMsgAllBean;
import com.chwl.core.gift.bean.LuckyGiftMsgSelfBean;
import com.chwl.core.gift.bean.MsgSuperLuckyGift;
import com.chwl.core.gift.bean.RoomNotifyDialogBean;
import com.chwl.core.utils.ComboUtil;
import com.chwl.app.ui.utils.ImageLoadUtilsV2;
import com.chwl.app.ui.widget.BonsellaJoinAttackButtonView;
@@ -119,8 +122,6 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
//收藏房间
private String FOLLOW_ROOM_TYPE = "";
//幸运礼物 飘屏队列
private ArrayList<LuckyGiftMsgAllBean> mLuckyGiftList = new ArrayList<>();
public static HomePartyFragment newInstance() {
HomePartyFragment homePartyFragment = new HomePartyFragment();
@@ -291,6 +292,9 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
case RoomEvent.MSG_SUPER_LUCKY_GIFT:
onLuckyGiftMsg(roomEvent);
break;
case RoomEvent.MSG_CP_ABOUT:
onCpAboutMsg(roomEvent);
break;
default:
break;
}
@@ -520,7 +524,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
luckyGiftTipPool.clear();
handler.removeCallbacksAndMessages(null);
mLuckyGiftList.clear();
RoomNotifyManager.INSTANCE.clear();
if (giftView != null) {
giftView.release();
@@ -694,6 +698,9 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
}
/**
* 幸运礼物 飘屏 跟 圆球提示
*/
private void onLuckyGiftMsg(RoomEvent roomEvent) {
MsgSuperLuckyGift msgSuperLuckyGift = roomEvent.getMsgSuperLuckyGift();
if (msgSuperLuckyGift != null) {
@@ -708,7 +715,6 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
}
private Handler handler = new Handler(Looper.getMainLooper());
private WeakPool<View> luckyGiftTipPool = new WeakPool<>(3);
private void showLuckyGiftDlgNotify(LuckyGiftMsgSelfBean luckyGiftMsgBean) {
@@ -757,39 +763,31 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
}, 2300);
}
BaseRoomNotifyeLuckGiftDialog allServiceLuckGiftDialog;
private void showLuckyGiftDlg(LuckyGiftMsgAllBean luckyGiftMsgAllBean){
LogUtils.d(" LuckyGiftDlg -- showLuckyGiftDlg() ");
mLuckyGiftList.add(luckyGiftMsgAllBean);
if (!(allServiceLuckGiftDialog != null && allServiceLuckGiftDialog.isShowing())) {
LuckyGiftMsgAllBean data = mLuckyGiftList.remove(0);
LogUtils.d(" LuckyGiftDlg -- showLuckyGiftDlg() -> showLuckyGiftDialog"+mLuckyGiftList.size());
showLuckyGiftDialog(data);
private void showLuckyGiftDlg(LuckyGiftMsgAllBean data) {
//todo do 校验数据是否异常
RoomNotifyManager.INSTANCE.addDialog(new RoomNotifyDialogBean(
CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_TEMPLATE,
CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_ROOM,
data
));
}
/**
* cp 礼物
*/
private void onCpAboutMsg(RoomEvent roomEvent) {
//todo do 校验数据是否异常
CpMsgBean cpMsgBean = roomEvent.getCpMsgBean();
if (cpMsgBean != null) {
RoomNotifyManager.INSTANCE.addDialog(new RoomNotifyDialogBean(
CustomAttachment.CP_FIRST,
cpMsgBean.getSecond(),
cpMsgBean
));
}
}
private void showLuckyGiftDialog(LuckyGiftMsgAllBean luckyGiftMsgAllBean){
LogUtils.d(" LuckyGiftDlg -- showLuckyGiftDialog() ");
allServiceLuckGiftDialog = new BaseRoomNotifyeLuckGiftDialog(requireContext());
allServiceLuckGiftDialog.setLuckyGiftMsgBean(luckyGiftMsgAllBean);
allServiceLuckGiftDialog.setMCallBack(new BaseRoomNotifyeLuckGiftDialog.CallBack() {
@Override
public void onHide() {
LogUtils.d(" LuckyGiftDlg -- showLuckyGiftDialog() ->onHide");
gameMainBinding.getRoot().postDelayed(new Runnable() {
@Override
public void run() {
LogUtils.d(" LuckyGiftDlg -- showLuckyGiftDialog() ->onHide->postDelayed");
if (!mLuckyGiftList.isEmpty()){
LuckyGiftMsgAllBean data = mLuckyGiftList.remove(0);
LogUtils.d(" LuckyGiftDlg -- showLuckyGiftDialog() ->onHide->postDelayed-> "+mLuckyGiftList.size());
showLuckyGiftDialog(data);
}
}
},100);
}
});
allServiceLuckGiftDialog.show();
}

View File

@@ -22,6 +22,7 @@ import androidx.annotation.Nullable;
import com.chwl.app.avroom.activity.RoomTypeSwitchActivity;
import com.chwl.core.utils.extension.StringExtensionKt;
import com.chwl.library.utils.SizeUtils;
import com.netease.nim.uikit.api.NimUIKit;
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
import com.netease.nimlib.sdk.msg.model.RecentContact;
@@ -76,6 +77,7 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
@Nullable
private PopupWindow msgTipPopupWindow;
private PopupWindow micSetPopupWindow;
@NonNull
private final Runnable msgRunnable = this::dismissMsgPopupWindow;
@@ -318,6 +320,7 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
if (wrapper != null) {
wrapper.onOpenMicBtnClick();
}
// showMicSetDialog(openMic);
break;
case R.id.tv_room_send_msg_input:
@@ -457,4 +460,40 @@ public class BottomView extends LinearLayout implements View.OnClickListener {
parent.postDelayed(msgRunnable, 3000);
}
private void showMicSetDialog(View parent){
//todo do 关麦开麦
View contentView;
if (micSetPopupWindow == null) {
contentView = LayoutInflater.from(getContext()).inflate(R.layout.popup_mic_set, null);
micSetPopupWindow = new PopupWindow(contentView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
micSetPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
// micSetPopupWindow.setAnimationStyle(R.style.style_anim_mic_set);
} else {
contentView = micSetPopupWindow.getContentView();
}
ImageView micOff = contentView.findViewById(R.id.micOff);
ImageView micMusic = contentView.findViewById(R.id.micMusic);
ImageView micOn = contentView.findViewById(R.id.micOn);
micOff.setOnClickListener(v -> {
micSetPopupWindow.dismiss();
});
micMusic.setOnClickListener(v -> {
micSetPopupWindow.dismiss();
});
micOn.setOnClickListener(v -> {
micSetPopupWindow.dismiss();
});
int[] vLoc = new int[2];
parent.getLocationInWindow(vLoc);
try {
micSetPopupWindow.showAsDropDown(parent,0, -ScreenUtil.dip2px(180),Gravity.CENTER_HORIZONTAL);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -265,6 +265,18 @@ public abstract class BaseActivity extends RxAppCompatActivity
}
}
public void initBlackTitleBar(String title) {
mTitleBar = findViewById(R.id.title_bar);
if (mTitleBar != null) {
mTitleBar.setTitle(title);
mTitleBar.setImmersive(false);
mTitleBar.setTitleColor(getResources().getColor(R.color.white));
mTitleBar.setLeftImageResource(R.drawable.icon_user_back);
mTitleBar.setBackgroundResource(R.color.transparent);
mTitleBar.setLeftClickListener(v -> onLeftClickListener());
}
}
public void initTitleBar(String title, TitleBar.Action action) {
mTitleBar = findViewById(R.id.title_bar);
if (mTitleBar != null) {

View File

@@ -0,0 +1,10 @@
package com.chwl.app.constants;
public @interface UserInfoConstants {
public @interface CpSet{
//1-cp头像是否展示2-cp动画
int cpAvatar = 1;
int cpAnim = 2;
}
}

View File

@@ -16,6 +16,8 @@ import com.chwl.app.UIHelper
import com.chwl.app.application.IReportConstants
import com.chwl.app.application.ReportManager
import com.chwl.app.avroom.activity.AVRoomActivity
import com.chwl.app.avroom.dialog.RoomNotifyCpBindDialog
import com.chwl.app.avroom.dialog.RoomNotifyLevelUpDialog
import com.chwl.app.base.BaseActivity
import com.chwl.app.base.BaseFragment
import com.chwl.app.databinding.FragmentMeBinding
@@ -38,6 +40,7 @@ import com.chwl.app.view.GenderAgeTextView
import com.chwl.app.vip.VipCenterActivity
import com.chwl.app.vip.VipViewModel
import com.chwl.core.auth.AuthModel
import com.chwl.core.gift.bean.CpMsgBean
import com.chwl.core.initial.InitialModel
import com.chwl.core.level.UserLevelVo
import com.chwl.core.manager.IMNetEaseManager
@@ -318,11 +321,12 @@ class MeFragment : BaseFragment(), View.OnClickListener {
override fun onClick(v: View) {
when (v.id) {
R.id.iv_user_head, R.id.rl_user_info ->
R.id.iv_user_head, R.id.rl_user_info ->{
mUserInfo?.let { UIHelper.showUserInfoAct(mContext, it.uid) }
R.id.iv_edit ->
mUserInfo?.let { UIHelper.showUserInfoModifyAct(mContext, it.uid) }
}
//
// R.id.iv_edit ->
// mUserInfo?.let { UIHelper.showUserInfoModifyAct(mContext, it.uid) }
R.id.ll_user_attentions -> startActivity(
Intent(

View File

@@ -0,0 +1,180 @@
package com.chwl.app.ui.user.activity
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.view.View
import androidx.core.view.isVisible
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chwl.app.R
import com.chwl.app.avroom.activity.AVRoomActivity
import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.base.TitleBar
import com.chwl.app.base.TitleBar.ImageAction
import com.chwl.app.common.EmptyViewHelper
import com.chwl.app.common.widget.dialog.DialogManager
import com.chwl.app.common.widget.dialog.DialogManager.OkCancelDialogListener
import com.chwl.app.databinding.ActivityUserCpListBinding
import com.chwl.app.ui.user.adapter.UserCpListAdapter
import com.chwl.core.bean.response.ServiceResult
import com.chwl.core.manager.AvRoomDataManager
import com.chwl.core.room.bean.CpListItem
import com.chwl.core.room.bean.RoomIcon
import com.chwl.core.user.bean.UserCPListBean
import com.chwl.core.utils.LogUtils
import com.chwl.core.utils.net.RxHelper
import com.chwl.library.net.rxnet.RxNet
import com.chwl.library.utils.ResUtil
import com.example.lib_utils.ktx.getString
import com.hjq.toast.ToastUtils
import com.netease.nim.uikit.StatusBarUtil
import io.reactivex.Single
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query
class UserCpListActivity : BaseViewBindingActivity<ActivityUserCpListBinding>() {
lateinit var mAdapter : UserCpListAdapter
var mPageNum = 1;
companion object{
fun start(context: Context) {
val intent = Intent(context, UserCpListActivity::class.java)
context.startActivity(intent)
}
}
override fun init() {
StatusBarUtil.transparencyBar(this)
StatusBarUtil.StatusBarLightMode(this)
initTitle()
initRvList()
loadData()
}
private fun initTitle() {
initBlackTitleBar(ResUtil.getString(R.string.My_Cp))
val titleBar = findViewById<View>(R.id.title_bar) as TitleBar
titleBar.addAction(object : ImageAction(R.drawable.ic_cp_list_more) {
override fun performAction(view: View?) {
//todo 跳转h5
ToastUtils.show("跳转h5")
}
})
}
private fun initRvList(){
mAdapter = UserCpListAdapter(R.layout.item_user_cp_list,1)
binding.rvList.layoutManager = LinearLayoutManager(context,RecyclerView.VERTICAL,false)
binding.rvList.adapter = mAdapter
mAdapter.setOnItemChildClickListener { adapter, view, position ->
when (view.id) {
R.id.cancel -> {
cancelCp(position, mAdapter.data[position])
}
else -> {}
}
}
mAdapter.setOnLoadMoreListener {
loadData(true)
}
mAdapter.setEmptyView(EmptyViewHelper.createEmptyTextView(this@UserCpListActivity,R.string.empty_data.getString()))
}
private fun loadData(isAdd: Boolean = false) {
if (!isAdd) {
mPageNum = 1
}
getCpList()
.compose(bindToLifecycle())
.doOnSuccess {
if (mPageNum == 1) {
mAdapter.setNewData(it)
} else {
mAdapter.addData(it)
}
if (it.size == 20) {
mPageNum += 1
mAdapter.setEnableLoadMore(true)
binding.noMore.isVisible = false
} else {
mAdapter.setEnableLoadMore(false)
binding.noMore.isVisible = true
}
mAdapter.loadMoreComplete()
}
.doOnError {
LogUtils.d(" error = ${it.message}")
mAdapter.loadMoreEnd()
}
.subscribe()
}
private fun cancelCp(position: Int, data: UserCPListBean) {
val mDialogManager = DialogManager(context)
mDialogManager?.showOkCancelDialog(ResUtil.getString(R.string.CP_Cancel), true, object :
OkCancelDialogListener {
override fun onCancel() {
mDialogManager?.dismissDialog()
}
override fun onOk() {
postCpCancel(data.uid,data.cpUid,data.cancelGoldNum)
.compose(bindToLifecycle())
.doOnSuccess {
runOnUiThread {
mAdapter.remove(position)
}
}
.subscribe()
mDialogManager?.dismissDialog()
}
})
}
/**
* 获-cp列表
*/
private fun getCpList(): Single<List<UserCPListBean>> {
return api.getCpList(mPageNum)
.compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers())
}
private fun postCpCancel(uid: Long,loverUid: Long,goldNum: Long): Single<Boolean> {
return api.postCpCancel(uid,loverUid,goldNum)
.compose(RxHelper.handleBeanData())
.compose(RxHelper.handleSchedulers())
}
private val api: Api = RxNet.create(Api::class.java);
interface Api {
/**
* 获-cp列表
* page=1
* pageSize=10
*/
@GET("/user/cp/list")
fun getCpList(@Query("page") page: Int,@Query("pageSize") pageSize: Int=20): Single<ServiceResult<List<UserCPListBean>>>
/**
* 取消cp----
* Long uid
* Long loverUid
* Long goldNum //金币列表有返回该字段cancelGoldNum
*/
@POST("/user/cp/cancel")
fun postCpCancel(@Query("uid") uid: Long,@Query("loverUid") loverUid: Long,@Query("goldNum") goldNum: Long): Single<ServiceResult<Boolean>>
}
}

View File

@@ -7,6 +7,9 @@ import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
@@ -14,6 +17,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
@@ -24,8 +28,11 @@ import com.chwl.app.avroom.adapter.CommonVPAdapter;
import com.chwl.app.ui.user.adapter.UserInfoTopAlbumAdapter;
import com.chwl.app.ui.user.fragment.UserInfoDataFragment;
import com.chwl.app.ui.user.fragment.UserInfoDynamicFragment;
import com.chwl.app.ui.utils.CpUtils;
import com.chwl.app.utils.AppBarStateChangeListener;
import com.chwl.app.utils.AvatarHelper;
import com.chwl.core.utils.LogUtils;
import com.chwl.library.utils.ResUtil;
import com.chwl.library.widget.SVGAView;
import com.chwl.core.decoration.headwear.bean.HeadWearInfo;
import com.example.lib_utils.UiUtils;
@@ -74,6 +81,9 @@ import com.chwl.core.user.bean.UserPhoto;
import com.chwl.core.user.event.LoginUserInfoUpdateEvent;
import com.chwl.core.utils.CoreLogger;
import com.chwl.library.annatation.ActLayoutRes;
import com.tencent.qgame.animplayer.inter.IFetchResource;
import com.tencent.qgame.animplayer.mix.Resource;
import com.tencent.qgame.animplayer.util.ScaleType;
import com.zhpan.bannerview.constants.IndicatorGravity;
import org.greenrobot.eventbus.EventBus;
@@ -81,8 +91,12 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/**
* create by lvzebiao on 2018/8/31
*/
@@ -98,6 +112,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
private UserInfo userInfo;
private boolean mIslike = false;
private int flag = 0;
private LinearLayout bottomViewLayout = null;
private TextView sendMsgLayout;
private TextView attentionLayout;
@@ -105,6 +120,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
private TextView tvOfficialMask;
private UserInfoViewModel viewModel;
private boolean isFirst = true;
@SuppressLint("CheckResult")
@Override
@@ -131,6 +147,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
viewModel.getUserInfoData().observe(this, infoBean -> {
userInfo = infoBean;
initData(userInfo);
viewModel.getUserInfoDetail();
});
}
@@ -138,7 +155,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
protected void onResume() {
super.onResume();
viewModel.getUserInfo();
viewModel.getUserInfoDetail();
}
private void initAttentionView() {
@@ -157,11 +174,12 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
if (bottomViewLayout == null) {
View view = mBinding.vsBottomLayout.getViewStub().inflate();
bottomViewLayout = view.findViewById(R.id.bottom_view_layout);
sendMsgLayout = view.findViewById(R.id.send_msg_layout);
attentionLayout = view.findViewById(R.id.attention_layout);
sendMsgLayout = view.findViewById(R.id.sendMsgLayout);
attentionLayout = view.findViewById(R.id.attentionLayout);
sendMsgLayout.setOnClickListener(this);
attentionLayout.setOnClickListener(this);
}
bottomViewLayout.setVisibility(View.VISIBLE);
}
}
@@ -171,6 +189,8 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
mBinding.ivEdit.setOnClickListener(this);
mBinding.tvEdit.setOnClickListener(this);
mBinding.layoutLive.setOnClickListener(this);
mBinding.cpCardMore.setOnClickListener(this);
mBinding.userInfoAnim.setOnClickListener(this);
// mBinding.ivTagArrow.setOnClickListener(this);
}
@@ -244,6 +264,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
viewModel.getUserInfoDetailData().observe(this, dataBean -> {
initPhoto(dataBean.getPrivatePhoto());
setWhereVisible();
setCpInfo(dataBean);
});
viewModel.getUserInfoDetailError().observe(this, String -> {
finish();
@@ -270,19 +291,10 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
}
private void initData(UserInfo userInfo) {
LogUtils.d(" userinfo initData ");
if (null != userInfo) {
ImageLoadUtilsV2.loadImage(mBinding.ivUserHead, userInfo.getAvatar());
HeadWearInfo headWearInfo = userInfo.getUserHeadwear();
if (headWearInfo != null && headWearInfo.getFirstUrl() != null) {
AvatarHelper.loadAvatarFrame(mBinding.ivHeadWear, headWearInfo.getFirstUrl(), headWearInfo.getType());
mBinding.ivUserHead.setPadding(0, 0, 0, 0);
mBinding.ivUserHead.setStrokeWidth(0);
} else {
int padding = getResources().getDimensionPixelOffset(R.dimen.dp_0_5);
mBinding.ivUserHead.setPadding(padding, padding, padding, padding);
mBinding.ivUserHead.setStrokeWidth(getResources().getDimensionPixelOffset(R.dimen.dp_1));
mBinding.ivHeadWear.setVisibility(View.GONE);
}
//设置昵称
String nick = RegexUtil.getPrintableString(userInfo.getNick());
mBinding.tvNick.setText(nick);
@@ -302,7 +314,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
mBinding.tvErbanId.setBackgroundResource(R.drawable.user_info_bg_good_id);
setMarginTop(mBinding.layoutRegion, getResources().getDimensionPixelOffset(R.dimen.dp_5));
} else {
mBinding.tvErbanId.setTextColor(ContextCompat.getColor(context, R.color.color_CC191919));
mBinding.tvErbanId.setTextColor(ContextCompat.getColor(context, R.color.white));
mBinding.tvErbanId.setBackgroundDrawable(null);
mBinding.ivId.setVisibility(View.VISIBLE);
setMarginTop(mBinding.layoutRegion, getResources().getDimensionPixelOffset(R.dimen.dp_8));
@@ -332,12 +344,76 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
mBinding.ivChargeAgent.setVisibility(userInfo.isRechargeUser() ? View.VISIBLE : View.GONE);
mBinding.llId.setOnClickListener(view -> {
mBinding.idLayout.setOnClickListener(view -> {
copyName();
});
}
}
//cp
private void setCpInfo(UserDetailInfo.DataBean dataBean) {
mBinding.ivHeadWear.setVisibility(View.VISIBLE);
UserDetailInfo.DataBean.RelationUserVO cpInfo = dataBean.getRelationUserVO();
boolean showCpAvatar = false;
if (cpInfo != null) {
if (cpInfo.showCpAvatar) {
showCpAvatar = cpInfo.showCpAvatar;
// 头像处cp
mBinding.ivHeadWear.loadFile(CpUtils.INSTANCE.getHeadSvga(cpInfo.cpLevel));
mBinding.ivHeadWearCp.loadFile(CpUtils.INSTANCE.getHeadSvga(cpInfo.cpLevel));
mBinding.ivHeadWearCpFlag.setImageResource(CpUtils.INSTANCE.getFlag(cpInfo.cpLevel));
ImageLoadUtils.loadImage(mBinding.ivUserHeadCp, cpInfo.cpAvatar);
if (cpInfo.cpAvatar == null || cpInfo.cpAvatar.isEmpty()) {
mBinding.cpViews.setVisibility(View.INVISIBLE);
return;
} else {
mBinding.cpViews.setVisibility(View.VISIBLE);
}
}
//cp 卡片
mBinding.cpCardDay.setText(cpInfo.cpDay + ""+ ResUtil.getString(R.string.days));
ImageLoadUtilsV2.loadImage(mBinding.cpCardUserAvatar, userInfo.getAvatar());
ImageLoadUtilsV2.loadImage(mBinding.cpCardUserAvatarCp, cpInfo.cpAvatar);
mBinding.cpCardUserHead.loadFile(CpUtils.INSTANCE.getHeadSvga(cpInfo.cpLevel));
mBinding.cpCardUserHeadCp.loadFile(CpUtils.INSTANCE.getHeadSvga(cpInfo.cpLevel));
mBinding.cpCardLevel.setImageResource(CpUtils.INSTANCE.getLevelImg(cpInfo.cpLevel));
mBinding.cpCardLevelEmpty.setVisibility(cpInfo.cpLevel > 0? View.INVISIBLE : View.VISIBLE);
mBinding.cpCardDay.setVisibility(cpInfo.cpLevel > 0? View.VISIBLE : View.INVISIBLE);
if (cpInfo.showCpAnim && isFirst) {
String animUrl = CpUtils.INSTANCE.getUserInfoAnim(cpInfo.cpLevel);
HashMap<String, String> imgMap = new HashMap<>();
imgMap.put("avatar1", cpInfo.avatar);
imgMap.put("avatar2", cpInfo.cpAvatar);
if (animUrl != null) {
CpUtils.INSTANCE.loadVap(
mBinding.userInfoAnim,
animUrl,
imgMap,null
);
}
}
} else {
mBinding.cpCardLevelEmpty.setVisibility(View.VISIBLE);
mBinding.cpViews.setVisibility(View.INVISIBLE);
}
HeadWearInfo headWearInfo = userInfo.getUserHeadwear();
if (headWearInfo != null && headWearInfo.getFirstUrl() != null) {
if (!showCpAvatar) AvatarHelper.loadAvatarFrame(mBinding.ivHeadWear, headWearInfo.getFirstUrl(), headWearInfo.getType());
mBinding.ivUserHead.setPadding(0, 0, 0, 0);
mBinding.ivUserHead.setStrokeWidth(0);
} else {
int padding = getResources().getDimensionPixelOffset(R.dimen.dp_0_5);
mBinding.ivUserHead.setPadding(padding, padding, padding, padding);
mBinding.ivUserHead.setStrokeWidth(getResources().getDimensionPixelOffset(R.dimen.dp_1));
if (!showCpAvatar) mBinding.cpViews.setVisibility(View.INVISIBLE);
}
isFirst = false;
}
private void setMarginTop(View view, int top) {
if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
@@ -453,10 +529,11 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
@Override
public void onStateChanged(AppBarLayout appBarLayout, State state) {
if (state == State.COLLAPSED) {
mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back_black);
mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.white));
// mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back_black);
mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back);
mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.color_08151a));
setTitleVisible(true);
setEditButton(identityState, true);
setEditButton(identityState, false);
}else{
mBinding.ivUserBack.setImageResource(R.drawable.icon_user_back);
mBinding.tbUserInfo.setBackgroundColor(getResources().getColor(R.color.transparent));
@@ -497,11 +574,15 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
mBinding.tvEdit.setVisibility(View.GONE);
}
if (isExpanded) {
mBinding.ivEdit.setImageResource(R.drawable.user_info_ic_more_black);
mBinding.tvEdit.setImageResource(R.drawable.user_info_ic_edit_black);
mBinding.ivEdit.setImageTintList(ColorStateList.valueOf(Color.BLACK));
mBinding.tvEdit.setImageTintList(ColorStateList.valueOf(Color.BLACK));
// mBinding.ivEdit.setImageResource(R.drawable.user_info_ic_more_black);
// mBinding.tvEdit.setImageResource(R.drawable.user_info_ic_edit_black);
} else {
mBinding.ivEdit.setImageResource(R.drawable.user_info_ic_more);
mBinding.tvEdit.setImageResource(R.drawable.user_info_ic_edit);
// mBinding.ivEdit.setImageResource(R.drawable.user_info_ic_more);
// mBinding.tvEdit.setImageResource(R.drawable.user_info_ic_edit);
mBinding.ivEdit.setImageTintList(ColorStateList.valueOf(Color.WHITE));
mBinding.tvEdit.setImageTintList(ColorStateList.valueOf(Color.WHITE));
}
}
@@ -570,16 +651,18 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
// UserLabelDialog.newInstance(userInfo.getLabels(), userId).show(this);
// break;
case R.id.iv_user_back:
case R.id.ivUserBack:
finish();
break;
case R.id.tv_edit:
case R.id.iv_edit:
case R.id.tvEdit:
case R.id.ivEdit:
editClick(identityState);
break;
case R.id.send_msg_layout:
case R.id.sendMsgLayout:
NimUserInfo nimUserInfo = NimUserInfoCache.getInstance().getUserInfo(String.valueOf(userId));
if (nimUserInfo != null) {
NimP2PMessageActivity.start(this, String.valueOf(userId));
@@ -597,7 +680,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
}
break;
case R.id.attention_layout:
case R.id.attentionLayout:
if (userInfo == null) {
toast(getString(R.string.me_user_information_is_empty));
return;
@@ -625,7 +708,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
PraiseModel.get().praise(userInfo.getUid(), true).subscribe();
}
break;
case R.id.layout_live:
case R.id.layoutLive:
if (userInfo == null) {
toast(getString(R.string.me_user_information_is_empty));
return;
@@ -635,6 +718,15 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
AVRoomActivity.FROM_TYPE_USER, userInfo.getNick(), String.valueOf(userInfo.getUid()));
}
break;
case R.id.cpCardMore:
UserCpListActivity.Companion.start(this);
break;
case R.id.userInfoAnim:
mBinding.userInfoAnim.stopPlay();
mBinding.userInfoAnim.clearAnimation();
mBinding.userInfoAnim.setVisibility(View.GONE);
break;
}
}
@@ -645,6 +737,7 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
private void setLikedText(boolean isliked) {
mIslike = isliked;
attentionLayout.setBackgroundResource((isliked) ? R.drawable.user_info_follow_ed : R.drawable.user_info_follow_n);
attentionLayout.setText(getString((isliked) ? R.string.already_attention : R.string.follow));
}

View File

@@ -10,6 +10,7 @@ import android.os.Bundle
import android.provider.Settings
import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.fourmob.datetimepicker.date.DatePickerDialog
@@ -25,6 +26,7 @@ import com.chwl.app.UIHelper
import com.chwl.app.application.App
import com.chwl.app.base.BaseViewBindingActivity
import com.chwl.app.common.util.BitmapUtil
import com.chwl.app.constants.UserInfoConstants
import com.chwl.app.databinding.ActivityUserInfoModifyBinding
import com.chwl.app.ui.login.ModifyInfoActivity
import com.chwl.app.ui.user.adapter.UserPhotoAdapter
@@ -36,6 +38,7 @@ import com.chwl.app.utils.RegexUtil
import com.chwl.core.auth.AuthModel
import com.chwl.core.file.FileModel
import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.UserDetailInfo
import com.chwl.core.user.bean.UserInfo
import com.chwl.core.user.bean.UserPhoto
import com.chwl.core.utils.CoreLogger
@@ -133,6 +136,12 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
binding.rvPhotos.visibility = View.GONE
}
binding.tvArea.text = userInfo.region
//cp 设置获取
UserModel.get().getUserInfoDetail(userId).compose(bindToLifecycle()).doOnSuccess {
setSwitchView(binding.swCpShow,it?.data?.relationUserVO?.showCpAvatar?:false)
setSwitchView(binding.swCpAnim,it?.data?.relationUserVO?.showCpAnim?:false)
}.subscribe()
}
}
@@ -143,6 +152,8 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
binding.layoutPhotos.setOnClickListener(this)
binding.llDesc.setOnClickListener(this)
binding.layoutArea.setOnClickListener(this)
binding.swCpAnim.setOnClickListener(this)
binding.swCpShow.setOnClickListener(this)
val mLayoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true)
binding.rvPhotos.layoutManager = mLayoutManager
}
@@ -284,11 +295,68 @@ class UserInfoModifyActivity : BaseViewBindingActivity<ActivityUserInfoModifyBin
toast(e.message)
}
})
} R.id.layout_area -> {
dialogManager.showProgressDialog(
this@UserInfoModifyActivity,
ResUtil.getString(R.string.ui_user_userinfomodifyactivity_02)
)
UserModel.get().areaInfo.subscribe(object : SingleObserver<List<String>> {
override fun onSubscribe(d: Disposable) {
mCompositeDisposable.add(d)
}
override fun onSuccess(areaList: List<String>) {
dialogManager.dismissDialog()
if (areaList.isNotEmpty()) {
UserAreaDialog.newInstance(areaList)
.apply {
setAction {
reportArea(it)
}
}.show(this@UserInfoModifyActivity)
}
}
override fun onError(e: Throwable) {
dialogManager.dismissDialog()
toast(e.message)
}
})
}
R.id.swCpAnim -> {
postUpDateCpSwitch(binding.swCpAnim,UserInfoConstants.CpSet.cpAnim)
}
R.id.swCpShow -> {
postUpDateCpSwitch(binding.swCpShow,UserInfoConstants.CpSet.cpAvatar)
}
else -> {}
}
}
//post update set
private fun postUpDateCpSwitch(view: ImageView,type:Int){
val tag = view.tag
if (tag != null && tag is Boolean){
val tagVal = !tag
UserModel.get().userCpSettingUpdate(type,tagVal)
.compose(bindToLifecycle())
.doOnSuccess {
setSwitchView(view,tagVal,true)
}.subscribe()
}
}
// set view
private fun setSwitchView(view: ImageView, on:Boolean,notify:Boolean=false){
view.setImageResource(if (on) R.drawable.ic_user_edit_sw_on else R.drawable.ic_user_edit_sw_off)
view.tag = on
if (notify) {
//通知 cp设置改变 todo do
}
}
private fun reportArea(area: String) {
binding.tvArea.text = area
dialogManager.showProgressDialog(

View File

@@ -0,0 +1,50 @@
package com.chwl.app.ui.user.adapter
import android.view.View
import android.view.ViewGroup
import com.chwl.app.R
import com.chwl.app.bindadapter.BaseAdapter
import com.chwl.app.bindadapter.BindingViewHolder
import com.chwl.app.databinding.ItemUserCpListBinding
import com.chwl.app.ui.utils.CpUtils.getHeadSvga
import com.chwl.app.ui.utils.CpUtils.getLevelImg
import com.chwl.app.ui.utils.ImageLoadUtils
import com.chwl.app.utils.NumberUtils
import com.chwl.core.user.bean.UserCPListBean
import com.chwl.library.utils.ResUtil
import com.example.lib_utils.ktx.getString
class UserCpListAdapter : BaseAdapter<UserCPListBean> {
constructor(layoutResId: Int, brid: Int) : super(layoutResId, brid)
override fun convert(helper: BindingViewHolder, data: UserCPListBean?) {
super.convert(helper, data)
if (data == null ) return
val mViewBinding = helper.binding as ItemUserCpListBinding
mViewBinding.cpLevel.setImageResource(getLevelImg(data.cpLevel))
ImageLoadUtils.loadImage(mViewBinding.userAvatar,data.avatar)
ImageLoadUtils.loadImage(mViewBinding.userAvatarCp,data.cpAvatar)
mViewBinding.userHead.loadFile(getHeadSvga(data.cpLevel))
mViewBinding.userHeadCp.loadFile(getHeadSvga(data.cpLevel))
mViewBinding.cpPro.max = data.endExp.toInt() - data.startExp.toInt()
mViewBinding.cpPro.progress = data.currentExp.toInt()
mViewBinding.cpProVal.text = "${NumberUtils.format(data.currentExp)} / ${NumberUtils.format(data.endExp)}"
mViewBinding.cpNeedVal.text = ResUtil.getString(R.string.CP_Need_tips,NumberUtils.format((data.endExp - data.currentExp)))
mViewBinding.cpDay.text = "${data.cpDay}${R.string.days.getString()}"
helper.addOnClickListener(mViewBinding.cancel.id)
}
}

View File

@@ -12,6 +12,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@@ -65,6 +66,8 @@ public class UserInfoDynamicAdapter extends BaseQuickAdapter<WorldDynamicBean, B
*/
private int divider;
public boolean isUserInfo = false;
public UserInfoDynamicAdapter(Context context) {
super(R.layout.item_userinfo_dynamic);
this.context = context;
@@ -174,6 +177,15 @@ public class UserInfoDynamicAdapter extends BaseQuickAdapter<WorldDynamicBean, B
//跳转去详情
helper.itemView.setOnClickListener(toDetailListener);
helper.setGone(R.id.line_bottom, getItemCount() - 1 != helper.getLayoutPosition());
if (isUserInfo) {
helper.setTextColor(R.id.tv_time, ContextCompat.getColor(context,R.color.white));
helper.setTextColor(R.id.expandable_text, ContextCompat.getColor(context,R.color.white));
helper.setTextColor(R.id.tv_mini_world_name, ContextCompat.getColor(context,R.color.white));
helper.setTextColor(R.id.tv_like, ContextCompat.getColor(context,R.color.white_tran_60));
helper.setTextColor(R.id.tv_comment, ContextCompat.getColor(context,R.color.white_tran_60));
}
}
private void setLikeCount(BaseViewHolder helper, int likeCount, boolean isLike, boolean isAnim) {

View File

@@ -12,16 +12,14 @@ import com.chwl.core.user.bean.GiftWallInfo
class UserInfoGiftAdapter(private val itemBgRes: Int = R.drawable.user_info_bg_gift) :
BaseQuickAdapter<GiftWallInfo, BaseViewHolder>(R.layout.user_info_item_gift) {
override fun onCreateDefViewHolder(parent: ViewGroup?, viewType: Int): BaseViewHolder {
return super.onCreateDefViewHolder(parent, viewType).apply {
getView<ImageView>(R.id.iv_bg).setImageResource(itemBgRes)
}
return super.onCreateDefViewHolder(parent, viewType)
}
override fun convert(helper: BaseViewHolder, item: GiftWallInfo) {
helper.setText(R.id.tv_name, item.giftName)
helper.setText(R.id.tv_count, "x${item.reciveCount}")
val iconView = helper.getView<ImageView>(R.id.iv_icon)
iconView.load(item.picUrl)
iconView.load(item.picUrl,0f,R.drawable.transparent_draw)
val rankView = helper.itemView.findViewById<ImageView>(R.id.iv_rank)
if (helper.bindingAdapterPosition == 0) {
rankView.setImageResource(R.drawable.ic_gift_one)

View File

@@ -1,6 +1,7 @@
package com.chwl.app.ui.user.adapter;
import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -38,8 +39,8 @@ public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
@Override
public IPagerTitleView getTitleView(Context context, final int i) {
ScaleTransitionPagerTitleView scaleTransitionPagerTitleView = new ScaleTransitionPagerTitleView(context, true);
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.color_7F191919));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.color_191919));
scaleTransitionPagerTitleView.setNormalColor(ContextCompat.getColor(context, R.color.white_tran_60));
scaleTransitionPagerTitleView.setSelectedColor(ContextCompat.getColor(context, R.color.white));
scaleTransitionPagerTitleView.setMinScale(minScale);
scaleTransitionPagerTitleView.setTextSize(textSize);
int padding = context.getResources().getDimensionPixelOffset(R.dimen.dp_12);
@@ -60,7 +61,7 @@ public class UserInfoIndicatorAdapter extends CommonNavigatorAdapter {
indicator.setLineHeight(UIUtil.dip2px(context, 3));
indicator.setRoundRadius(UIUtil.dip2px(context, 1.5));
indicator.setLineWidth(UIUtil.dip2px(context, 17));
indicator.setColors(context.getResources().getColor(R.color.color_26CC9C));
indicator.setColors(Color.parseColor("#04d5c6"));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// lp.bottomMargin = mBottomMargin;
indicator.setLayoutParams(lp);

View File

@@ -56,8 +56,9 @@ class UserInfoMedalAdapter :
})
} else {
val imageView = helper.getView<ImageView>(R.id.iv_image)
imageView.load(item.picUrl)
imageView.load(item.picUrl,0f,R.drawable.transparent_draw)
}
}
helper.setText(R.id.medalName,item.medalName)
}
}

View File

@@ -2,9 +2,9 @@ package com.chwl.app.ui.user.fragment
import android.content.Intent
import android.view.View
import android.widget.TextView
import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chwl.app.R
import com.chwl.app.base.BaseViewBindingFragment
import com.chwl.app.databinding.UserInfoDataFragmentBinding
@@ -16,12 +16,17 @@ import com.chwl.app.ui.user.activity.UserModifyPhotosActivity
import com.chwl.app.ui.user.adapter.UserInfoAlbumAdapter
import com.chwl.app.ui.user.adapter.UserInfoGameTeamAdapter
import com.chwl.app.ui.user.adapter.UserInfoGiftAdapter
import com.chwl.app.ui.user.adapter.UserInfoIndicatorAdapter
import com.chwl.app.ui.user.adapter.UserInfoMedalAdapter
import com.chwl.app.ui.user.viewmodel.UserInfoViewModel
import com.chwl.app.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
import com.chwl.app.ui.utils.load
import com.chwl.app.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator
import com.chwl.app.ui.widget.recyclerview.decoration.SpacingDecoration
import com.chwl.core.game_team.UserGameTeamInfo
import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.UserPhoto
import com.chwl.library.utils.ResUtil
import com.example.lib_utils.ktx.getString
class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding>() {
@@ -30,9 +35,10 @@ class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding
override fun init() {
initGameTeam()
initAlbum()
initOther()
initMedal()
initGift()
initLuckyGift()
setGuild()
FragmentVisibleStateHelper(this).apply {
this.start {
onVisibleChanged(it, isFirstVisible)
@@ -40,6 +46,37 @@ class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding
}
}
private fun initOther() {
val tagList =
arrayListOf(ResUtil.getString(R.string.medal), ResUtil.getString(R.string.gift_action))
val commonNavigator = CommonNavigator(context)
commonNavigator.setTitleWrapContent(false)
val magicIndicatorAdapter = UserInfoIndicatorAdapter(context, tagList)
magicIndicatorAdapter.setOnItemSelectListener { position: Int, view: TextView? ->
binding.magicIndicator.onPageSelected(position)
onOtherTabChange(view?.text?.toString() ?: "")
}
commonNavigator.adapter = magicIndicatorAdapter
binding.magicIndicator.setNavigator(commonNavigator)
}
private fun onOtherTabChange(str: String) {
when (str) {
ResUtil.getString(R.string.medal) -> {
binding.layoutGift.isVisible = false
binding.layoutMedal.isVisible = true
}
ResUtil.getString(R.string.gift_action) -> {
binding.layoutGift.isVisible = true
binding.layoutMedal.isVisible = false
}
else -> {}
}
}
private fun initGameTeam() {
val adapter = UserInfoGameTeamAdapter(viewModel.isMe)
binding.recyclerViewGameTeam.addItemDecoration(
@@ -96,74 +133,80 @@ class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding
binding.recyclerViewMedal.adapter = medalAdapter
viewModel.userInfoDetailData.observe(this) {
val list = it.medals?.userMedals
binding.tvMedalCount.text = "(${list?.size ?: 0})"
if (medalAdapter.itemCount > 0) return@observe
medalAdapter.setNewData(list)
binding.layoutMedal.isVisible = !list.isNullOrEmpty()
}
}
var isMiniMode = true
private fun initGift() {
val giftAdapter = UserInfoGiftAdapter()
var isMiniMode = true
binding.ivGiftMore.setOnClickListener {
isMiniMode = !isMiniMode
val list = viewModel.giftListLiveData.value ?: emptyList()
loadListData(giftAdapter, 4, isMiniMode, list, binding.ivGiftMore)
loadListData(giftAdapter, 4, isMiniMode, binding.ivGiftMore)
binding.ivGiftMore.animate().rotationBy(180f).start()
}
binding.recyclerViewGift.addItemDecoration(
GridSpacingItemNewDecoration(
resources.getDimensionPixelOffset(R.dimen.dp_12),
resources.getDimensionPixelOffset(R.dimen.dp_2),
false
)
)
binding.recyclerViewGift.adapter = giftAdapter
viewModel.giftListLiveData.observe(this) {
loadListData(giftAdapter, 4, isMiniMode, it, binding.ivGiftMore)
binding.tvGiftStatus.isVisible = it.isNullOrEmpty()
loadListData(giftAdapter, 4, isMiniMode, binding.ivGiftMore)
}
viewModel.requestGiftList()
}
private fun initLuckyGift() {
val luckyGiftAdapter = UserInfoGiftAdapter(R.drawable.user_info_bg_lucku_gift)
var isMiniMode = true
binding.ivLuckyGiftMore.setOnClickListener {
isMiniMode = !isMiniMode
val list = viewModel.luckyGiftListLiveData.value ?: emptyList()
loadListData(luckyGiftAdapter, 4, isMiniMode, list, binding.ivLuckyGiftMore)
binding.ivLuckyGiftMore.animate().rotationBy(180f).start()
}
binding.recyclerViewLuckyGift.addItemDecoration(
GridSpacingItemNewDecoration(
resources.getDimensionPixelOffset(R.dimen.dp_12),
resources.getDimensionPixelOffset(R.dimen.dp_2),
false
)
)
binding.recyclerViewLuckyGift.adapter = luckyGiftAdapter
viewModel.luckyGiftListLiveData.observe(this) {
loadListData(luckyGiftAdapter, 4, isMiniMode, it, binding.ivLuckyGiftMore)
binding.tvLuckyGiftStatus.isVisible = it.isNullOrEmpty()
loadListData(giftAdapter, 4, isMiniMode, binding.ivGiftMore)
}
viewModel.requestLuckyGiftList()
viewModel.loadUserInfoGiftWallData()
}
private fun <T> loadListData(
adapter: BaseQuickAdapter<T, *>,
private fun setGuild() {
UserModel.get().getUserInfoDetailCache(viewModel.userId).compose(bindToLifecycle())
.doOnSuccess {
it?.data?.guildInfo?.let {
//guildName
binding.guildName.text = "${R.string.Guild_Nick.getString()}:${it.guildName}"
//guildId
binding.guildId.text = "${R.string.Guild_ID.getString()}:${it.guildId}"
//guildAgentId
binding.guildAgentId.text = "${R.string.Agent_ID.getString()}:${it.erbanNo}"
//guildImg
binding.guildImg.load(it.avatar)
binding.guildLayout.isVisible = true
}
}.subscribe()
}
private fun loadListData(
adapter: UserInfoGiftAdapter,
miniCount: Int,
miniOrFull: Boolean,
list: List<T>,
moreView: View
) {
val finalList = if (miniOrFull) {
list.take(miniCount)
if (viewModel.luckyGiftIsRead && viewModel.giftIsRead) {
if (!viewModel.giftWallIsRead) {
val gift = viewModel.giftListLiveData.value ?: emptyList()
val luckyGift = viewModel.luckyGiftListLiveData.value ?: emptyList()
viewModel.userInfoGiftWallData.addAll(gift)
viewModel.userInfoGiftWallData.addAll(luckyGift)
viewModel.userInfoGiftWallData.sortBy { it.reciveCount }
viewModel.giftWallIsRead = true
}
} else {
list
return
}
val finalList = if (miniOrFull) {
viewModel.userInfoGiftWallData.take(miniCount)
} else {
viewModel.userInfoGiftWallData
}
adapter.setNewData(finalList)
moreView.isVisible = list.size > miniCount
moreView.isVisible = viewModel.userInfoGiftWallData.size > miniCount
binding.tvGiftStatus.isVisible = finalList.isEmpty()
}
private fun showPhotoPreview(list: ArrayList<UserPhoto>, position: Int) {
@@ -175,10 +218,8 @@ class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding
private fun onVisibleChanged(isVisible: Boolean, isFirstVisible: Boolean) {
if (isVisible && !isFirstVisible) {
if (viewModel.giftListLiveData.value.isNullOrEmpty()) {
if (viewModel.userInfoGiftWallData.isEmpty()) {
viewModel.requestGiftList()
}
if (viewModel.luckyGiftListLiveData.value.isNullOrEmpty()) {
viewModel.requestLuckyGiftList()
}
}

View File

@@ -36,6 +36,7 @@ class UserInfoDynamicFragment : BaseViewBindingFragment<UserInfoDynamicFragmentB
private fun initView() {
adapter = UserInfoDynamicAdapter(requireContext())
adapter?.isUserInfo = true
adapter?.setEnableLoadMore(false)
adapter?.emptyView = layoutInflater.inflate(R.layout.user_info_tab_empty, null)
binding.recyclerView.adapter = adapter

View File

@@ -34,6 +34,11 @@ class UserInfoViewModel : BaseViewModel() {
val giftListLiveData = MutableLiveData<List<GiftWallInfo>>()
val luckyGiftListLiveData = MutableLiveData<List<GiftWallInfo>>()
val userInfoGiftWallData = mutableListOf<GiftWallInfo>()
var luckyGiftIsRead = false
var giftIsRead = false
var giftWallIsRead = false
fun getUserInfo() {
UserModel.get().getUserInfoFromServer(userId)
@@ -88,14 +93,32 @@ class UserInfoViewModel : BaseViewModel() {
}
fun requestGiftList() {
addDisposable(UserModel.get().requestUserGiftWall(userId, 1, 2).subscribe { it ->
giftListLiveData.postValue(it)
})
addDisposable(UserModel.get().requestUserGiftWall(userId, 1, 2)
.doOnError {
giftIsRead=true
}
.subscribe { it ->
giftIsRead=true
giftListLiveData.postValue(it)
})
}
fun requestLuckyGiftList() {
addDisposable(UserModel.get().requestUserGiftWall(userId, 2, 2).subscribe { it ->
luckyGiftListLiveData.postValue(it)
})
addDisposable(UserModel.get().requestUserGiftWall(userId, 2, 2)
.doOnError {
luckyGiftIsRead=true
}
.subscribe { it ->
luckyGiftListLiveData.postValue(it)
luckyGiftIsRead=true
})
}
fun loadUserInfoGiftWallData(){
giftIsRead = false
luckyGiftIsRead = false
userInfoGiftWallData.clear()
requestGiftList()
requestLuckyGiftList()
}
}

View File

@@ -0,0 +1,161 @@
package com.chwl.app.ui.utils
import android.graphics.Bitmap
import android.view.View
import androidx.core.view.isVisible
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestFutureTarget
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.chwl.app.R
import com.chwl.app.application.App
import com.chwl.app.application.GlobalHandleManager
import com.chwl.core.utils.LogUtils
import com.netease.nim.uikit.support.glide.GlideApp
import com.tencent.qgame.animplayer.AnimConfig
import com.tencent.qgame.animplayer.AnimView
import com.tencent.qgame.animplayer.inter.IAnimListener
import com.tencent.qgame.animplayer.inter.IFetchResource
import com.tencent.qgame.animplayer.mix.Resource
import com.tencent.qgame.animplayer.util.ScaleType
object CpUtils {
fun getHeadSvga(level: Int) : String {
return "svga/cp_list_head_$level.svga"
}
fun getUserInfoAnim(level: Int) : String? {
if (level < 3) return null
return "mp4/cp_userinfo_anim_$level.mp4"
}
var flags = arrayListOf(
R.drawable.ic_user_info_cp_avatar_flag_0,
R.drawable.ic_user_info_cp_avatar_flag_1,
R.drawable.ic_user_info_cp_avatar_flag_2,
R.drawable.ic_user_info_cp_avatar_flag_3,
R.drawable.ic_user_info_cp_avatar_flag_4,
R.drawable.ic_user_info_cp_avatar_flag_5,
)
var levels = arrayListOf(
R.drawable.ic_cp_list_level_0,
R.drawable.ic_cp_list_level_1,
R.drawable.ic_cp_list_level_2,
R.drawable.ic_cp_list_level_3,
R.drawable.ic_cp_list_level_4,
R.drawable.ic_cp_list_level_5,
)
var levelBgs = arrayListOf(
R.drawable.transparent_draw,
R.drawable.ic_cp_level_up_bg_1,
R.drawable.ic_cp_level_up_bg_2,
R.drawable.ic_cp_level_up_bg_3,
R.drawable.ic_cp_level_up_bg_4,
R.drawable.ic_cp_level_up_bg_5
)
var cpLevelUpStr = arrayListOf(
R.string.Sweet_Duo_CP
)
fun getCpLevelUpStr(level: Int) : Int{
return cpLevelUpStr.getOrNull(level)?:-1
}
fun getFlag(level: Int) : Int{
return flags.getOrNull(level)?:-1
}
fun getLevelImg(level: Int) : Int{
return levels.getOrNull(level)?:-1
}
fun getCpLevelUpTextBg(level: Int) : Int{
return levelBgs.getOrNull(level)?:-1
}
fun downLoadAvatar(url:String?, onResourceReady:(resource: Bitmap?)->Unit) {
if (url.isNullOrEmpty()) return
try {
val futureTarget = RequestFutureTarget<Bitmap>(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
GlideApp.with(App.instance())
.asBitmap()
.circleCrop()
.load(url)
.addListener(object : RequestListener<Bitmap?> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap?>?, isFirstResource: Boolean): Boolean {
onResourceReady(null)
return true
}
override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target<Bitmap?>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
onResourceReady(resource)
return true
}
})
.into(futureTarget)
.get()
} catch (e: Exception) {
}
}
fun loadVap(animView: AnimView, url :String?, imgUrlMap: HashMap<String,String>?=null , textMap: HashMap<String,String>?=null) {
if (url == null) return
animView.visibility = View.VISIBLE
var index = 0
val bitmapMap = hashMapOf<String,Bitmap?>()
if (!imgUrlMap.isNullOrEmpty()){
imgUrlMap.keys.forEach { key ->
downLoadAvatar(imgUrlMap[key]) { resource ->
index++
bitmapMap[key] = resource
if (index == imgUrlMap.keys.size){
animView.setFetchResource(object : IFetchResource {
override fun fetchImage(resource: Resource, result: (Bitmap?) -> Unit) {
if (bitmapMap.isEmpty()) {
result(null)
} else {
var bitmap : Bitmap?=null
bitmapMap.keys.forEach {
if (resource.tag == it){
bitmap = bitmapMap[it]
}
}
result(bitmap)
}
}
override fun fetchText(resource: Resource, result: (String?) -> Unit) {
if (textMap.isNullOrEmpty()) {
result(null)
} else {
var text = ""
textMap.keys.forEach {
if (resource.tag == it){
text = textMap[it].toString()
}
}
result(text)
}
}
override fun releaseResource(resources: List<Resource>) {
resources?.forEach {
it?.bitmap?.recycle()
}
}
})
LogUtils.d(" animViewSetAnimListener startPlay url = $url")
animView.startPlay(animView.context.assets, url)
}
}
}
}
}
}

View File

@@ -1,11 +1,13 @@
package com.chwl.app.ui.widget;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_COUNTRY;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_CP;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_LUCKY;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_NOBLE;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_NORMAL;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_SING_ROOM;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_SUPER_LUCKY;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_SUPER_LUCKY_24;
import static com.chwl.app.ui.widget.magicindicator.GiftIndicator.TYPE_WEEK;
import android.annotation.SuppressLint;
@@ -626,6 +628,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
return TYPE_COUNTRY;
case GiftType.GIFT_TYPE_SINGLE_ROOM:
return TYPE_SING_ROOM;
case GiftType.GIFT_TYPE_LUCKY_24:
return TYPE_SUPER_LUCKY_24;
case GiftType.GIFT_TYPE_CP:
return TYPE_CP;
}
return TYPE_NORMAL;
}
@@ -721,6 +727,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
currentGiftInfoList = getSuperLuckyGiftInfos();
} else if (position == TYPE_COUNTRY) {
currentGiftInfoList = getCountryGiftInfos();
}else if (position == TYPE_CP) {
currentGiftInfoList = getCpGiftInfos();
}
// 有贵族礼物才显示贵族礼物的tab
if (ListUtils.isListEmpty(nobleGiftInfos)) {
@@ -1226,6 +1234,11 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
String.valueOf(AvRoomDataManager.get().getRoomUid()),
GiftType.GIFT_TYPE_COUNTRY);
}
private List<GiftInfo> getCpGiftInfos() {
return GiftModel.get().getGiftInfosByType(
String.valueOf(AvRoomDataManager.get().getRoomUid()),
GiftType.GIFT_TYPE_CP);
}
private List<GiftInfo> getNobleGiftInfos() {
return GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_VIP);

View File

@@ -14,7 +14,6 @@ import androidx.core.view.isVisible
import androidx.databinding.DataBindingUtil
import com.example.lib_utils.ktx.getColorById
import com.example.lib_utils.ktx.singleClick
import com.example.lib_utils.ktx.toStringRes
import com.example.lib_utils.spannable.SpannableTextBuilder
import com.chwl.app.R
import com.chwl.app.avroom.activity.AVRoomActivity

View File

@@ -76,6 +76,14 @@ public class GiftIndicator extends LinearLayout {
* 超级幸运礼物
*/
public static final int TYPE_SUPER_LUCKY = 8;
/**
* 超级幸运24礼物
*/
public static final int TYPE_SUPER_LUCKY_24 = 9;
/**
* cp礼物
*/
public static final int TYPE_CP = 10;
private List<GiftTab> tabList = new ArrayList<>();

View File

@@ -0,0 +1,81 @@
package com.chwl.app.utils
import com.chwl.app.application.GlobalHandleManager
import com.chwl.app.avroom.dialog.BaseRoomNotifyDialog
import com.chwl.app.avroom.dialog.RoomNotifyCpBindDialog
import com.chwl.app.avroom.dialog.RoomNotifyCpGiftDialog
import com.chwl.app.avroom.dialog.RoomNotifyLevelUpDialog
import com.chwl.app.avroom.dialog.RoomNotifyLuckGiftDialog
import com.chwl.core.gift.bean.CpMsgBean
import com.chwl.core.gift.bean.LuckyGiftMsgAllBean
import com.chwl.core.gift.bean.RoomNotifyDialogBean
import com.chwl.core.im.custom.bean.CustomAttachment
import java.util.LinkedList
object RoomNotifyManager {
private val queue = LinkedList<RoomNotifyDialogBean>()
private var dialog : BaseRoomNotifyDialog<*>?=null
fun addDialog(data : RoomNotifyDialogBean) {
queue.add(data)
showNextDialog()
}
private fun showNextDialog() {
if (dialog?.isShowing == true){
return
}
if (queue.isNotEmpty()) {
val data = queue.removeAt(0)
dialog = createDialog(data)
dialog?.mCallBack = object : BaseRoomNotifyDialog.CallBack {
override fun onHide() {
showNextDialog()
}
}
dialog?.showDialog()
}
}
private fun createDialog(bean: RoomNotifyDialogBean): BaseRoomNotifyDialog<*>?{
var dialog : BaseRoomNotifyDialog<*>? = null
val activity = GlobalHandleManager.get().activity ?: return null
if (bean.first == CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_TEMPLATE) {
if (bean.second == CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_ROOM || bean.second == CustomAttachment.CUSTOM_MSG_SUPER_LUCKY_GIFT_ALL){
if (bean.data is LuckyGiftMsgAllBean){
dialog = RoomNotifyLuckGiftDialog(activity)
dialog.luckyGiftMsgBean = bean.data as LuckyGiftMsgAllBean
return dialog
}
}
} else if(bean.first == CustomAttachment.CP_FIRST){
if (bean.data is CpMsgBean){
if (bean.second == CustomAttachment.CP_SECOND_GIFT){
dialog = RoomNotifyCpGiftDialog(activity).apply {
cpMsgBean = bean.data as CpMsgBean
}
}else if (bean.second == CustomAttachment.CP_SECOND_UPGRADE){
dialog = RoomNotifyLevelUpDialog(activity).apply {
cpMsgBean = bean.data as CpMsgBean
}
}else if (bean.second == CustomAttachment.CP_SECOND_BIND){
dialog = RoomNotifyCpBindDialog(activity).apply {
cpMsgBean = bean.data as CpMsgBean
}
}
}
}
return dialog
}
fun clear() {
dialog?.clearDialog()
dialog = null
queue.clear()
}
}

View File

@@ -61,28 +61,20 @@ class VipViewModel : BaseViewModel() {
vipPageInfo?.let {
_authInfosLiveData.value = it.vipAuthInfos
_vipInfosLiveData.value = it.vipInfos
if (it.currLevel == 0) {
_myVipInfoLiveData.value = null
onItemSelect(0)
} else {
var position = 0
_myVipInfoLiveData.value =
it.vipInfos?.find { vipInfo -> it.currLevel == vipInfo.vipLevel }
?.copy()
?.apply {
position = it.vipInfos?.indexOf(this) ?: -1
val nextVipInfo =
it.vipInfos?.getOrNull(position + 1)
nextVipName =
if (nextVipInfo?.vipName == vipName) null else nextVipInfo?.vipName
remainSeconds = it.remainSeconds
currLevel = it.currLevel
currScore = it.currScore
isMaxLevel = it.isMaxLevel
}
onItemSelect(if (position < 0) 0 else position)
}
var position = 0
_myVipInfoLiveData.value = it.vipInfos?.findLast { vipInfo ->
vipInfo.remainSeconds > 0
}?.copy()
?.apply {
position = it.vipInfos?.indexOf(this) ?: -1
val nextVipInfo = it.vipInfos?.getOrNull(position + 1)
nextVipName = if (nextVipInfo?.vipName == vipName) null else nextVipInfo?.vipName
// remainSeconds = it.remainSeconds
currLevel = it.currLevel
currScore = it.currScore
isMaxLevel = it.isMaxLevel
}
onItemSelect(if (position < 0) 0 else position)
}
}

View File

@@ -7,7 +7,6 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.chwl.app.R
import com.chwl.app.ui.utils.loadAnim
import com.chwl.core.vip.bean.VipInfo
import com.chwl.library.download.DownloadException
import com.chwl.library.download.DownloadManager.download
@@ -22,8 +21,10 @@ import com.tencent.qgame.animplayer.inter.IAnimListener
import com.tencent.qgame.animplayer.util.ScaleType
import com.youth.banner.adapter.BannerAdapter
import java.io.File
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
class VipCenterBannerAdapter(
@@ -43,10 +44,10 @@ class VipCenterBannerAdapter(
}
override fun onBindView(holder: BannerViewHolder, data: VipInfo, position: Int, size: Int) {
//todo do 旧bug 买完VIP不刷新item
holder.dueText.visibility = View.GONE
myVipInfo?.let {
if (it.vipLevel == data.vipLevel) {
if (it.vipLevel >= data.vipLevel) {
val calendar = Calendar.getInstance()
calendar.add(Calendar.SECOND, it.remainSeconds)
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
@@ -147,5 +148,8 @@ class VipCenterBannerAdapter(
val dueText: TextView = view.findViewById(R.id.due_date_textview)
}
fun millis2String(millis: Long, format: DateFormat): String {
return format.format(Date(millis))
}
}

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:bottomLeftRadius="0px"
android:bottomRightRadius="@dimen/dp_11"
android:topLeftRadius="0px"
android:topRightRadius="@dimen/dp_11" />
<gradient
android:endColor="#FFD936"
android:startColor="#F2A20F" />
</shape>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<solid android:color="#7e1e00"/>
<corners android:radius="25dp"/>
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="#f77300"/>
<corners android:radius="25dp"/>
</shape>
</clip>
</item>
</layer-list>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <item>-->
<!-- <shape>-->
<!-- <padding android:top="2dp" android:right="2dp" android:left="2dp" android:bottom="2dp"/>-->
<!--&lt;!&ndash; <solid android:color="@color/color_08151a"/>&ndash;&gt;-->
<!-- <gradient android:startColor="#071A21" android:endColor="#0b222b" />-->
<!-- <corners android:radius="@dimen/dp_8" />-->
<!-- </shape>-->
<!-- </item>-->
<!-- <item>-->
<!-- <shape>-->
<!-- <solid android:color="@color/color_08151a"/>-->
<!-- <corners android:radius="@dimen/dp_8" />-->
<!-- </shape>-->
<!-- </item>-->
<item>
<shape>
<stroke
android:width="2dp"
android:color="#1A4655" />
<corners android:radius="@dimen/dp_8" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/transparent"/>
</shape>

View File

@@ -1,13 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:bottomLeftRadius="@dimen/dp_11"
android:bottomRightRadius="0px"
android:topLeftRadius="@dimen/dp_11"
android:topRightRadius="0px" />
<corners android:radius="35dp" />
<gradient
android:endColor="#FFD936"
android:startColor="#F2A20F" />
<solid android:color="#04d5c6"/>
</shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#04d5c6"/>
<corners android:radius="62dp"/>
<size android:height="15dp" android:width="3dp"/>
</shape>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_08151a"
android:orientation="vertical">
<com.chwl.app.base.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvList"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp" />
<TextView
android:id="@+id/noMore"
android:layout_width="match_parent"
android:gravity="center"
android:textSize="14sp"
android:visibility="gone"
android:paddingVertical="10dp"
android:textColor="@color/white_tran_40"
android:text="@string/text_more_load_end"
android:layout_height="wrap_content"/>
</LinearLayout>

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/color_white"
android:orientation="vertical">
@@ -232,7 +232,7 @@
android:gravity="center_vertical|end"
android:textColor="@color/color_6D6B89"
android:textSize="@dimen/font_normal"
tools:text="馬來西亞"/>
tools:text="馬來西亞" />
<ImageView
android:layout_width="wrap_content"
@@ -311,6 +311,90 @@
android:layout_marginEnd="15dp"
android:background="@color/line_353548" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cpEditLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp">
<TextView
android:id="@+id/cpTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:paddingBottom="8dp"
android:text="@string/CP"
android:textColor="@color/color_313131"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/titleCpAnim"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/transparent"
android:gravity="center_vertical"
android:text="titleCpAnim"
android:textColor="@color/color_313131"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/cpTitle" />
<ImageView
android:id="@+id/swCpAnim"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_user_edit_sw_on"
app:layout_constraintBottom_toBottomOf="@+id/titleCpAnim"
app:layout_constraintEnd_toEndOf="@+id/titleCpAnim"
app:layout_constraintTop_toTopOf="@+id/titleCpAnim" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:background="@color/line_353548"
app:layout_constraintBottom_toBottomOf="@+id/titleCpAnim" />
<TextView
android:id="@+id/titleCpShow"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/transparent"
android:gravity="center_vertical"
android:text="titleCpShow"
android:textColor="@color/color_313131"
android:textSize="14sp"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/titleCpAnim" />
<ImageView
android:id="@+id/swCpShow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_user_edit_sw_on"
app:layout_constraintBottom_toBottomOf="@+id/titleCpShow"
app:layout_constraintEnd_toEndOf="@+id/titleCpShow"
app:layout_constraintTop_toTopOf="@+id/titleCpShow" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:background="@color/line_353548"
app:layout_constraintBottom_toBottomOf="@+id/titleCpShow" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,135 @@
<?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>
<variable
name="cpListInfo"
type="com.chwl.core.user.bean.UserCPListBean" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_marginBottom="12dp"
android:layout_marginHorizontal="15dp"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/bg"
android:background="@drawable/ic_cp_list_item_bg"
android:layout_width="match_parent"
android:layout_height="163dp" />
<TextView
android:id="@+id/cpDay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-5dp"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="@+id/cp_heart"
app:layout_constraintStart_toStartOf="@+id/cp_heart"
app:layout_constraintTop_toTopOf="@+id/cp_heart" />
<ImageView
android:id="@+id/cp_heart"
android:layout_width="125dp"
android:layout_height="60dp"
android:src="@drawable/ic_user_info_cp_heart"
android:layout_marginTop="34dp"
app:layout_constraintEnd_toEndOf="@+id/bg"
app:layout_constraintStart_toStartOf="@+id/bg"
app:layout_constraintTop_toTopOf="@+id/bg" />
<ImageView
android:id="@+id/cpLevel"
android:layout_width="100dp"
android:layout_height="20dp"
android:layout_marginBottom="-14dp"
app:layout_constraintBottom_toBottomOf="@+id/cp_heart"
app:layout_constraintEnd_toEndOf="@+id/cp_heart"
app:layout_constraintStart_toStartOf="@+id/cp_heart" />
<com.chwl.app.common.widget.CircleImageView
android:id="@+id/userAvatar"
android:layout_width="56dp"
android:layout_height="56dp"
android:src="@drawable/ic_user_info_cp_def_avatar"
app:layout_constraintBottom_toBottomOf="@+id/userHead"
app:layout_constraintEnd_toEndOf="@+id/userHead"
app:layout_constraintStart_toStartOf="@+id/userHead"
app:layout_constraintTop_toTopOf="@+id/userHead" />
<com.chwl.library.widget.SVGAView
android:id="@+id/userHead"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_marginTop="-6dp"
app:layout_constraintEnd_toStartOf="@id/cp_heart"
app:layout_constraintTop_toTopOf="@id/cp_heart" />
<com.chwl.app.common.widget.CircleImageView
android:id="@+id/userAvatarCp"
android:layout_width="56dp"
android:layout_height="56dp"
android:src="@drawable/ic_user_info_cp_def_avatar"
app:layout_constraintBottom_toBottomOf="@+id/userHeadCp"
app:layout_constraintEnd_toEndOf="@+id/userHeadCp"
app:layout_constraintStart_toStartOf="@+id/userHeadCp"
app:layout_constraintTop_toTopOf="@+id/userHeadCp" />
<com.chwl.library.widget.SVGAView
android:id="@+id/userHeadCp"
android:layout_width="85dp"
android:layout_height="85dp"
android:layout_marginTop="-6dp"
app:layout_constraintStart_toEndOf="@id/cp_heart"
app:layout_constraintTop_toTopOf="@id/cp_heart" />
<ImageView
android:id="@+id/cancel"
android:layout_width="26dp"
android:layout_height="23dp"
android:src="@drawable/ic_user_info_cp_cancel"
android:layout_marginTop="22dp"
android:layout_marginEnd="6dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
android:id="@+id/cpPro"
android:layout_width="0dp"
android:layout_height="4dp"
android:layout_marginHorizontal="22dp"
android:layout_marginTop="9dp"
android:max="100"
style="?android:attr/progressBarStyleHorizontal"
android:progressDrawable="@drawable/bar_cp_progress"
app:layout_constraintEnd_toEndOf="@id/bg"
app:layout_constraintStart_toStartOf="@id/bg"
app:layout_constraintTop_toBottomOf="@id/cpLevel" />
<TextView
android:id="@+id/cpProVal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textSize="12sp"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="@id/cpPro"
app:layout_constraintTop_toBottomOf="@id/cpPro" />
<TextView
android:id="@+id/cpNeedVal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/white"
android:layout_marginTop="4dp"
app:layout_constraintStart_toStartOf="@id/cpPro"
app:layout_constraintTop_toBottomOf="@id/cpPro" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -10,7 +10,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="130dp"
android:src="@drawable/icon_common_failure" />
android:src="@drawable/base_status_empty" />
<TextView
android:id="@+id/tv_hint"

View File

@@ -11,7 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:src="@drawable/icon_common_failure" />
android:src="@drawable/base_status_empty" />
<TextView
android:id="@+id/tv_hint"

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_container"
android:layout_width="@dimen/dp_36"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/micOn"
android:layout_width="@dimen/dp_36"
android:layout_marginVertical="5dp"
android:src="@drawable/room_menu_ic_mic_open"
android:layout_height="@dimen/dp_36"/>
<ImageView
android:id="@+id/micMusic"
android:layout_width="@dimen/dp_36"
android:layout_marginVertical="5dp"
android:src="@drawable/room_menu_ic_mic_open"
android:layout_height="@dimen/dp_36"/>
<ImageView
android:id="@+id/micOff"
android:layout_width="@dimen/dp_36"
android:layout_marginVertical="5dp"
android:src="@drawable/room_menu_ic_mic_close"
android:layout_height="@dimen/dp_36"/>
</LinearLayout>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.tencent.qgame.animplayer.AnimView
android:id="@+id/anim"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/dp_146"
android:layout_height="@dimen/dp_230"/>
</FrameLayout>

View 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"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_145"
android:background="@drawable/ic_cp_gift_bg"
android:layout_marginTop="@dimen/dp_46"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="@dimen/dp_20"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="@+id/bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/bg">
<ImageView
android:id="@+id/sendAvatar"
android:layout_width="@dimen/dp_38"
android:layout_height="@dimen/dp_38" />
<TextView
android:id="@+id/sendText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_8"
android:text="@string/send"
android:textColor="#ffe6a0"
android:textSize="@dimen/sp_13"
android:textStyle="bold" />
<ImageView
android:id="@+id/receiverAvatar"
android:layout_width="@dimen/dp_38"
android:layout_height="@dimen/dp_38" />
<TextView
android:id="@+id/cpGiftText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dp_8"
android:text="@string/CP_Gift"
android:textColor="#ffe6a0"
android:textSize="@dimen/sp_13"
android:textStyle="bold" />
<ImageView
android:id="@+id/gift"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga"
android:layout_marginTop="@dimen/dp_191"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_145"/>
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_gravity="bottom"
android:gravity="center"
android:layout_marginBottom="@dimen/dp_20"
android:layout_height="wrap_content"/>
</FrameLayout>

View File

@@ -7,8 +7,9 @@
android:gravity="center"
android:orientation="horizontal">
<com.chwl.library.widget.DrawableCenterTextView
android:id="@+id/attention_layout"
android:id="@+id/attentionLayout"
android:layout_width="0dp"
android:layout_height="@dimen/dp_46"
android:layout_marginStart="@dimen/dp_15"
@@ -18,10 +19,11 @@
android:gravity="center"
android:text="@string/follow"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/sp_16" />
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
<com.chwl.library.widget.DrawableCenterTextView
android:id="@+id/send_msg_layout"
android:id="@+id/sendMsgLayout"
android:layout_width="0dp"
android:layout_height="@dimen/dp_46"
android:layout_marginStart="@dimen/dp_8"
@@ -30,7 +32,8 @@
android:background="@drawable/base_shape_border_theme_23dp"
android:gravity="center"
android:text="@string/send_msg"
android:textColor="@color/color_1E1E1F"
android:textSize="@dimen/sp_16" />
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
</LinearLayout>

Some files were not shown because too many files have changed in this diff Show More