1.邀请好友 2.发起组Cp弹窗 3.扩展CommonTipDialog支持子标题
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package com.yizhuan.erban.relation.cp
|
||||
|
||||
object CpViewHelper{
|
||||
|
||||
}
|
@@ -1,24 +1,58 @@
|
||||
package com.yizhuan.erban.relation.cp.activity
|
||||
|
||||
import android.view.View
|
||||
import androidx.activity.viewModels
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseBindingActivity
|
||||
import com.yizhuan.erban.databinding.ActivityCpHomeBinding
|
||||
import com.yizhuan.erban.relation.cp.viewmodel.CpViewModel
|
||||
import com.yizhuan.erban.relation.cp.widget.RelationCpCardView.Companion.PAGE_TYPE_SELF_CP
|
||||
import com.yizhuan.erban.ui.relation.FansListActivity
|
||||
import com.yizhuan.erban.ui.user.UserInfoActivity
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.activity_cp_home)
|
||||
class CpHomeActivity : BaseBindingActivity<ActivityCpHomeBinding>() {
|
||||
private val mUserId = AuthModel.get().currentUid
|
||||
private val vm: CpViewModel by viewModels()
|
||||
override fun init() {
|
||||
initTitleBar("亲密关系")
|
||||
mBinding.click = this
|
||||
initObserver()
|
||||
vm.getCpRelation(mUserId)
|
||||
}
|
||||
|
||||
//获取用户信息CP信息
|
||||
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
|
||||
R.id.mine_avatar -> {
|
||||
toUserInfoActivity(vm.cpRelation.value?.uid)
|
||||
}
|
||||
R.id.other_avatar -> {
|
||||
if (vm.cpRelation.value?.cpUid ?: 0L == 0L) {
|
||||
FansListActivity.start(this, FansListActivity.TYPE_CP)
|
||||
} else {
|
||||
toUserInfoActivity(vm.cpRelation.value?.cpUid)
|
||||
}
|
||||
}
|
||||
R.id.tv_recovery_unbind -> vm.revertUnbindCp()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initObserver() {
|
||||
vm.loadingLiveData.observe(this) {
|
||||
if (it) dialogManager.showProgressDialog(this)
|
||||
else dialogManager.dismissDialog()
|
||||
}
|
||||
|
||||
vm.cpRelation.observe(this) {
|
||||
mBinding.cpEntity = it
|
||||
mBinding.cpCardView.setPageData(mUserId, PAGE_TYPE_SELF_CP, it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun toUserInfoActivity(uid: Long?) {
|
||||
uid?.let { UserInfoActivity.Companion.start(this, it) }
|
||||
}
|
||||
}
|
@@ -0,0 +1,88 @@
|
||||
package com.yizhuan.erban.relation.cp.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.style.AbsoluteSizeSpan
|
||||
import android.view.View
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogCpInviteBinding
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpInvitePageEntity
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_cp_invite)
|
||||
class CpInvitePageDialog(context: Context) :
|
||||
View.OnClickListener,
|
||||
BaseBindingDialog<DialogCpInviteBinding>(context) {
|
||||
var listener: DialogClickListener? = null
|
||||
var entity: CpInvitePageEntity? = null
|
||||
override fun init() {
|
||||
binding.setClick { this }
|
||||
binding.cpCard.setDialogPageData()
|
||||
initSpannable()
|
||||
}
|
||||
|
||||
private fun initSpannable() {
|
||||
val absoluteSizeSpan10 = AbsoluteSizeSpan(ScreenUtil.dip2px(10f))
|
||||
val absoluteSizeSpan8 = AbsoluteSizeSpan(ScreenUtil.dip2px(8f))
|
||||
val absoluteSizeSpan13 = AbsoluteSizeSpan(ScreenUtil.dip2px(13f))
|
||||
binding.editDeclaration.apply {
|
||||
val builder =
|
||||
SpannableStringBuilder(context.resources.getString(R.string.invite_declaration_hint))
|
||||
builder.setSpan(
|
||||
absoluteSizeSpan10,
|
||||
0,
|
||||
14,
|
||||
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
|
||||
)
|
||||
builder.setSpan(
|
||||
absoluteSizeSpan8,
|
||||
15,
|
||||
builder.length,
|
||||
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
|
||||
)
|
||||
hint = builder
|
||||
}
|
||||
|
||||
binding.tvPrice.apply {
|
||||
val builder =
|
||||
SpannableStringBuilder(
|
||||
String.format(
|
||||
context.resources.getString(R.string.invite_gift_price_text),
|
||||
entity?.propsPrice ?: ""
|
||||
)
|
||||
)
|
||||
builder.setSpan(
|
||||
absoluteSizeSpan13,
|
||||
0,
|
||||
3,
|
||||
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
|
||||
)
|
||||
|
||||
builder.setSpan(
|
||||
absoluteSizeSpan10,
|
||||
4,
|
||||
builder.length,
|
||||
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.tv_sent -> {
|
||||
if (entity == null) return
|
||||
listener?.onSentClick(entity!!, binding.editDeclaration.text.toString())
|
||||
closeDialog()
|
||||
}
|
||||
R.id.iv_close -> closeDialog()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface DialogClickListener {
|
||||
fun onSentClick(cpInvitePageEntity: CpInvitePageEntity, declaration: String)
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.yizhuan.erban.relation.cp.dialog
|
||||
|
||||
import android.content.Context
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogCpInviteReplyBinding
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_cp_invite_reply)
|
||||
class CpInviteReplyDialog(context:Context):BaseBindingDialog<DialogCpInviteReplyBinding>(context) {
|
||||
override fun init() {
|
||||
|
||||
}
|
||||
}
|
@@ -17,7 +17,7 @@ interface Api {
|
||||
*/
|
||||
@GET("/user/couple/cpInvitePage")
|
||||
fun getCpInvitePageData(
|
||||
@Query("acceptUid") acceptUid: Int
|
||||
@Query("acceptUid") acceptUid: Long
|
||||
): ServiceResult<CpInvitePageEntity>
|
||||
|
||||
/**
|
||||
@@ -49,7 +49,7 @@ interface Api {
|
||||
@FormUrlEncoded
|
||||
@POST("/user/couple/makeCpInvite")
|
||||
fun makeCpInvite(
|
||||
@Field("acceptUid") acceptUid: Int,
|
||||
@Field("acceptUid") acceptUid: Long,
|
||||
@Field("declaration") declaration: String,
|
||||
@Field("propsId") propsId: Int
|
||||
): ServiceResult<Any>
|
||||
@@ -96,5 +96,5 @@ interface Api {
|
||||
*亲密(CP)关系
|
||||
*/
|
||||
@GET("/user/couple/cpRelation")
|
||||
fun cpRelation(@Query("uid") uid: Int): ServiceResult<CpRelation>
|
||||
fun cpRelation(@Query("uid") uid: Long): ServiceResult<CpRelation>
|
||||
}
|
@@ -12,7 +12,7 @@ import com.yizhuan.xchat_android_library.net.rxnet.RxNet
|
||||
object CpModel : BaseModel() {
|
||||
private val api = RxNet.create(Api::class.java)
|
||||
|
||||
suspend fun getCpInvitePageData(acceptUid: Int): CpInvitePageEntity? =
|
||||
suspend fun getCpInvitePageData(acceptUid: Long): CpInvitePageEntity? =
|
||||
launchRequest {
|
||||
api.getCpInvitePageData(acceptUid)
|
||||
}
|
||||
@@ -27,7 +27,7 @@ object CpModel : BaseModel() {
|
||||
api.getCpMpApplyList(pageNumber, pageSize)
|
||||
}
|
||||
|
||||
suspend fun makeCpInvite(acceptUid: Int, declaration: String, propsId: Int): Any? =
|
||||
suspend fun makeCpInvite(acceptUid: Long, declaration: String, propsId: Int): Any? =
|
||||
launchRequest {
|
||||
api.makeCpInvite(acceptUid, declaration, propsId)
|
||||
}
|
||||
@@ -57,7 +57,7 @@ object CpModel : BaseModel() {
|
||||
api.userCpList(type)
|
||||
}
|
||||
|
||||
suspend fun userCpRelation(uid: Int): CpRelation? =
|
||||
suspend fun userCpRelation(uid: Long): CpRelation? =
|
||||
launchRequest {
|
||||
api.cpRelation(uid)
|
||||
}
|
||||
|
@@ -4,10 +4,7 @@ import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
import com.yizhuan.erban.relation.cp.model.CpModel
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpInvitePageEntity
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpMpApplyListEntity
|
||||
import com.yizhuan.xchat_android_core.relation.cp.UserCpLevelMpRootEntity
|
||||
import com.yizhuan.xchat_android_core.relation.cp.UserCpListEntity
|
||||
import com.yizhuan.xchat_android_core.relation.cp.*
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
|
||||
class CpViewModel : BaseViewModel() {
|
||||
@@ -16,28 +13,32 @@ class CpViewModel : BaseViewModel() {
|
||||
val loadingLiveData: LiveData<Boolean> = _loadingLiveData
|
||||
|
||||
//发起邀请组队CP弹窗数据
|
||||
private val _cpInvitePageData = MutableLiveData<CpInvitePageEntity>()
|
||||
val cpInvitePageData = _cpInvitePageData
|
||||
private val _cpInvitePageData: MutableLiveData<CpInvitePageEntity> = MutableLiveData()
|
||||
val cpInvitePageData: LiveData<CpInvitePageEntity> = _cpInvitePageData
|
||||
|
||||
//cp铭牌申请记录
|
||||
private val _cpMpApplyListData = MutableLiveData<List<CpMpApplyListEntity>>()
|
||||
val cpMpApplyListData = _cpMpApplyListData
|
||||
private val _cpMpApplyListData: MutableLiveData<List<CpMpApplyListEntity>> = MutableLiveData()
|
||||
val cpMpApplyListData: LiveData<List<CpMpApplyListEntity>> = _cpMpApplyListData
|
||||
|
||||
//用户CP等级可申请铭牌
|
||||
private val _userCpLevelMpData = MutableLiveData<UserCpLevelMpRootEntity>()
|
||||
val userCpLevelMpData = _userCpLevelMpData
|
||||
private val _userCpLevelMpData: MutableLiveData<UserCpLevelMpRootEntity> = MutableLiveData()
|
||||
val userCpLevelMpData: LiveData<UserCpLevelMpRootEntity> = _userCpLevelMpData
|
||||
|
||||
//个人CP邀请列表
|
||||
private val _userCpListData = MutableLiveData<List<UserCpListEntity>>()
|
||||
val userCpListData = _userCpListData
|
||||
private val _userCpListData: MutableLiveData<List<UserCpListEntity>> = MutableLiveData()
|
||||
val userCpListData: LiveData<List<UserCpListEntity>> = _userCpListData
|
||||
|
||||
fun getCpInvitePageData(userCpList: Int) {
|
||||
//个人Cp信息
|
||||
private val _cpRelation: MutableLiveData<CpRelation> = MutableLiveData()
|
||||
val cpRelation: LiveData<CpRelation> = _cpRelation
|
||||
|
||||
fun getCpInvitePageData(acceptUid: Long) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.getCpInvitePageData(userCpList)?.let {
|
||||
cpInvitePageData.value = it
|
||||
CpModel.getCpInvitePageData(acceptUid)?.let {
|
||||
_cpInvitePageData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
@@ -63,7 +64,7 @@ class CpViewModel : BaseViewModel() {
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.userCpList(type)?.let {
|
||||
userCpListData.value = it
|
||||
_userCpListData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
@@ -83,6 +84,42 @@ class CpViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun getCpRelation(uid: Long) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.userCpRelation(uid)?.let {
|
||||
_cpRelation.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun makeCpInvite(acceptUid: Long, declaration: String, propsId: Int) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.makeCpInvite(acceptUid, declaration, propsId)
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun revertUnbindCp() {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.revertUnboundCp()
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun dealCpDataError():
|
||||
(e: Throwable) -> Unit = {
|
||||
it.message.toast()
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.yizhuan.erban.relation.cp.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.FrameLayout
|
||||
@@ -17,29 +18,77 @@ class RelationCpCardView(context: Context, attr: AttributeSet?, def: Int) :
|
||||
|
||||
private val binding: LayoutCpCardBinding
|
||||
|
||||
|
||||
init {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
binding = DataBindingUtil.inflate(inflater, R.layout.layout_cp_card, this, true)
|
||||
}
|
||||
|
||||
fun setPageType(type: Int, cpRelation: CpRelation) {
|
||||
val mineUserInfoVisibility = when (type) {
|
||||
PAGE_TYPE_SELF_CP -> true
|
||||
else -> cpRelation?.cpUid != 0
|
||||
fun setPageData(selfUId: Long, type: Int, cpRelation: CpRelation?) {
|
||||
var userInfoVisibility = false
|
||||
var cpLevelVisibility = false
|
||||
var unbindVisibility = false
|
||||
var unbindRecoverVisibility = false
|
||||
var groupEmptyVisibility = false
|
||||
var declarationVisibility = false
|
||||
when (type) {
|
||||
PAGE_TYPE_SELF_CP -> {
|
||||
if (cpRelation == null) throw Exception("type:PAGE_TYPE_SELF_CP,cpRelation: CpRelation cant be null!!!")
|
||||
userInfoVisibility = true
|
||||
cpLevelVisibility = cpRelation.waitUnbound
|
||||
binding.tvCpTime.setTextColor(context.resources.getColor(R.color.white))
|
||||
unbindRecoverVisibility = cpRelation.waitUnbound
|
||||
unbindVisibility = (cpRelation.uid == selfUId) && !cpRelation.waitUnbound
|
||||
if (unbindRecoverVisibility && cpRelation.uid != selfUId) {
|
||||
binding.tvRecoveryUnbind.text = "关系解绑中"
|
||||
binding.tvRecoveryUnbind.isEnabled = false
|
||||
}
|
||||
}
|
||||
PAGE_TYPE_SELF_INFO -> {
|
||||
if (cpRelation == null) throw Exception("type:PAGE_TYPE_SELF_INFO,cpRelation: CpRelation cant be null!!!")
|
||||
userInfoVisibility = true
|
||||
cpLevelVisibility = cpRelation.cpUid != 0.toLong()
|
||||
binding.tvCpTime.setTextColor(Color.parseColor("#917FFF"))
|
||||
}
|
||||
PAGE_TYPE_CUS_INFO -> {
|
||||
if (cpRelation == null) throw Exception("type:PAGE_TYPE_CUS_INFO,cpRelation: CpRelation cant be null!!!")
|
||||
userInfoVisibility = cpRelation.cpUid != 0.toLong()
|
||||
cpLevelVisibility = cpRelation.cpUid != 0.toLong()
|
||||
binding.tvCpTime.setTextColor(Color.parseColor("#917FFF"))
|
||||
groupEmptyVisibility = cpRelation.cpUid == 0.toLong()
|
||||
declarationVisibility = cpRelation.cpUid != 0.toLong()
|
||||
}
|
||||
PAGE_TYPE_INVITE_DIALOG -> {
|
||||
userInfoVisibility = true
|
||||
}
|
||||
}
|
||||
binding.mineAvatar.visibility = mineUserInfoVisibility.visibility()
|
||||
binding.tvMineName.visibility = mineUserInfoVisibility.visibility()
|
||||
binding.ivCpHeart.visibility = mineUserInfoVisibility.visibility()
|
||||
val centerHeartVisibility = userInfoVisibility
|
||||
val keepTimeVisibility = cpLevelVisibility
|
||||
|
||||
//要么是主态解绑状态 要么是客态有CP
|
||||
binding.mineAvatar.visibility = userInfoVisibility.visibility()
|
||||
binding.tvMineName.visibility = userInfoVisibility.visibility()
|
||||
binding.ivCpHeart.visibility = centerHeartVisibility.visibility()
|
||||
binding.tvLevel.visibility = cpLevelVisibility.visibility()
|
||||
binding.tvCpTime.visibility = keepTimeVisibility.visibility()
|
||||
binding.tvRecoveryUnbind.visibility = unbindRecoverVisibility.visibility()
|
||||
binding.otherAvatar.visibility = userInfoVisibility.visibility()
|
||||
binding.tvOtherName.visibility = userInfoVisibility.visibility()
|
||||
binding.tvCpEmptyTip.visibility = groupEmptyVisibility.visibility()
|
||||
binding.btnBind.visibility = groupEmptyVisibility.visibility()
|
||||
binding.ivInvite.visibility = groupEmptyVisibility.visibility()
|
||||
binding.tvDeclaration.visibility = declarationVisibility.visibility()
|
||||
|
||||
binding.cpEntity = cpRelation
|
||||
|
||||
}
|
||||
|
||||
fun setDialogPageData() {
|
||||
setPageData(0, PAGE_TYPE_INVITE_DIALOG, null)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val PAGE_TYPE_SELF_CP = 1//亲密关系页面 主态
|
||||
const val PAGE_TYPE_SELF_INFO = 2//个人中心主态
|
||||
const val PAGE_TYPE_CUS_INFO = 3//个人中心客态
|
||||
const val PAGE_TYPE_INVITE_DIALOG = 5//邀请弹窗
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,97 @@
|
||||
package com.yizhuan.erban.ui.im.friend
|
||||
|
||||
import android.text.TextUtils
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseFragment
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager
|
||||
import com.yizhuan.erban.relation.cp.dialog.CpInvitePageDialog
|
||||
import com.yizhuan.erban.relation.cp.viewmodel.CpViewModel
|
||||
import com.yizhuan.erban.ui.widget.dialog.CommonTipDialog
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpInvitePageEntity
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
|
||||
class FriendFragmentCpDelegate(private val fragment: BaseFragment) {
|
||||
private val cpViewModel: CpViewModel by fragment.viewModels()
|
||||
private val cpInviteDialog by lazy {
|
||||
CpInvitePageDialog(fragment.requireContext())
|
||||
.apply { listener = inviteDialogListener }
|
||||
}
|
||||
|
||||
private val sentTipDialog by lazy {
|
||||
CommonTipDialog(fragment.requireContext()).apply {
|
||||
setMessageBold(true)
|
||||
setMessageSize(ScreenUtil.dip2px(16f))
|
||||
setSubMessage("(若对方拒接或24小时未同意,钻石将会返还)")
|
||||
setSubMessageColor(fragment.requireContext().resources.getColor(R.color.color_999999))
|
||||
setSubMessageSize(ScreenUtil.dip2px(13f))
|
||||
}
|
||||
}
|
||||
|
||||
fun init(manager: DialogManager) {
|
||||
cpViewModel.loadingLiveData.observe(fragment) { aBoolean: Boolean ->
|
||||
if (aBoolean) {
|
||||
manager.showProgressDialog(fragment.context)
|
||||
} else manager.dismissDialog()
|
||||
}
|
||||
cpViewModel.cpInvitePageData.observe(fragment) {
|
||||
showInvitePageDialog(it)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请好友组队
|
||||
*/
|
||||
fun inviteCp(userInfo: UserInfo) {
|
||||
cpViewModel.getCpInvitePageData(userInfo.uid)
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示邀请弹窗 ,填写邀请CP所需的信息
|
||||
*/
|
||||
|
||||
private fun showInvitePageDialog(info: CpInvitePageEntity) {
|
||||
with(cpInviteDialog) {
|
||||
entity = info
|
||||
if (isShowing) closeDialog()
|
||||
openDialog()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示发送邀请确认弹窗
|
||||
*/
|
||||
private fun showSentTipDialog(
|
||||
cpInvitePageEntity: CpInvitePageEntity,
|
||||
declaration: String,
|
||||
) {
|
||||
sentTipDialog.setTipMsg("确定送出${cpInvitePageEntity.propsName}}礼物与Ta结成CP关系吗?")
|
||||
sentTipDialog.setOnActionListener(object : CommonTipDialog.OnActionListener {
|
||||
override fun onOk() {
|
||||
cpViewModel.makeCpInvite(
|
||||
cpInvitePageEntity.acceptUid,
|
||||
declaration,
|
||||
cpInvitePageEntity.propsId
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private val inviteDialogListener =
|
||||
object : CpInvitePageDialog.DialogClickListener {
|
||||
override fun onSentClick(
|
||||
cpInvitePageEntity: CpInvitePageEntity,
|
||||
declaration: String
|
||||
) {
|
||||
if (TextUtils.isEmpty(declaration)) {
|
||||
fragment.context?.resources?.getString(
|
||||
R.string.invite_cp_empty_declaration_tip
|
||||
).toast()
|
||||
return
|
||||
}
|
||||
showSentTipDialog(cpInvitePageEntity, declaration)
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,6 +6,7 @@ import androidx.appcompat.widget.AppCompatImageView;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
@@ -140,8 +141,13 @@ public class FriendListAdapter extends BaseQuickAdapter<UserInfo, BaseViewHolder
|
||||
});
|
||||
break;
|
||||
case AbstractSelectFriendAction.TYPE_CP:
|
||||
helper.getView(R.id.tv_invite_cp).setVisibility(View.VISIBLE);
|
||||
helper.getView(R.id.tv_invite_cp).setOnClickListener(v -> {
|
||||
TextView tvInvite = helper.getView(R.id.tv_invite_cp);
|
||||
tvInvite.setVisibility(View.VISIBLE);
|
||||
/* if (item.hasCP()) {
|
||||
tvInvite.setEnabled(false);
|
||||
tvInvite.setText(context.getResources().getString(R.string.has_cp));
|
||||
}*/
|
||||
tvInvite.setOnClickListener(v -> {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.sendListener(item);
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ public class FriendListFragment extends BaseFragment {
|
||||
private RecyclerView mRecyclerView;
|
||||
private List<UserInfo> infoList;
|
||||
private boolean send;
|
||||
private FriendFragmentCpDelegate cpDelegate;
|
||||
|
||||
public static FriendListFragment newInstance(boolean b, int type) {
|
||||
FriendListFragment friendListFragment = new FriendListFragment();
|
||||
@@ -249,15 +250,6 @@ public class FriendListFragment extends BaseFragment {
|
||||
setData(userInfos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请组成Cp
|
||||
*
|
||||
* @param attentionInfo
|
||||
*/
|
||||
private void inviteCp(UserInfo attentionInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReloadData() {
|
||||
super.onReloadData();
|
||||
@@ -266,4 +258,11 @@ public class FriendListFragment extends BaseFragment {
|
||||
loadFriends();
|
||||
}
|
||||
|
||||
|
||||
private void inviteCp(UserInfo cpInfo) {
|
||||
if (cpDelegate == null) {
|
||||
cpDelegate = new FriendFragmentCpDelegate(this);
|
||||
}
|
||||
cpDelegate.inviteCp(cpInfo);
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,17 @@
|
||||
package com.yizhuan.erban.ui.widget.dialog;
|
||||
|
||||
import static android.graphics.Typeface.BOLD;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.Window;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils;
|
||||
|
||||
@@ -15,9 +22,18 @@ import com.yizhuan.xchat_android_core.utils.TextUtils;
|
||||
*/
|
||||
public class CommonTipDialog extends BaseDialog {
|
||||
private String tipMsg = "";
|
||||
private String subMessage = "";
|
||||
|
||||
private String okText = "确定";
|
||||
private String cancelText = "取消";
|
||||
private boolean messageBold;
|
||||
private boolean subMessageBold;
|
||||
private @ColorRes
|
||||
int messageColor = -1;
|
||||
private @ColorRes
|
||||
int subMessageColor = -1;
|
||||
private int messageSize = -1;
|
||||
private int subMessageSize = -1;
|
||||
|
||||
public CommonTipDialog(Context context) {
|
||||
super(context, R.style.dialog);
|
||||
@@ -35,7 +51,10 @@ public class CommonTipDialog extends BaseDialog {
|
||||
setContentView(R.layout.layout_ok_cancel_dialog);
|
||||
|
||||
TextView tip = findViewById(R.id.message);
|
||||
tip.setText(tipMsg);
|
||||
TextView sub = findViewById(R.id.sub_message);
|
||||
|
||||
setMessageAndStyle(tip, tipMsg);
|
||||
setSubMessageAndStyle(sub, subMessage);
|
||||
|
||||
TextView ok = findViewById(R.id.btn_ok);
|
||||
ok.setText(okText);
|
||||
@@ -55,10 +74,82 @@ public class CommonTipDialog extends BaseDialog {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void setMessageAndStyle(TextView tip, String message) {
|
||||
SpannableStringBuilder messageBuilder = null;
|
||||
if (messageBold || messageColor != -1 || messageSize != -1) {
|
||||
messageBuilder = new SpannableStringBuilder(message);
|
||||
if (messageBold) {
|
||||
StyleSpan boldSpan = new StyleSpan(BOLD);
|
||||
messageBuilder.setSpan(boldSpan, 0, messageBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
}
|
||||
|
||||
if (messageSize != -1) {
|
||||
AbsoluteSizeSpan sizeSpan = new AbsoluteSizeSpan(messageSize);
|
||||
messageBuilder.setSpan(sizeSpan, 0, messageBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
}
|
||||
|
||||
if (messageColor != -1) {
|
||||
tip.setTextColor(getContext().getResources().getColor(messageColor));
|
||||
}
|
||||
}
|
||||
tip.setText(messageBuilder == null ? message : messageBuilder);
|
||||
}
|
||||
|
||||
private void setSubMessageAndStyle(TextView sub, String message) {
|
||||
SpannableStringBuilder subMessageBuilder = null;
|
||||
if (subMessageBold || subMessageColor != -1 || subMessageSize != -1) {
|
||||
subMessageBuilder = new SpannableStringBuilder(message);
|
||||
if (subMessageBold) {
|
||||
StyleSpan boldSpan = new StyleSpan(BOLD);
|
||||
subMessageBuilder.setSpan(boldSpan, 0, subMessageBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
}
|
||||
|
||||
if (subMessageSize != -1) {
|
||||
AbsoluteSizeSpan sizeSpan = new AbsoluteSizeSpan(subMessageSize);
|
||||
subMessageBuilder.setSpan(sizeSpan, 0, subMessageBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
}
|
||||
|
||||
if (subMessageColor != -1) {
|
||||
sub.setTextColor(getContext().getResources().getColor(subMessageColor));
|
||||
}
|
||||
}
|
||||
sub.setText(subMessageBuilder == null ? message : subMessageBuilder);
|
||||
}
|
||||
|
||||
|
||||
public void setTipMsg(String tipMsg) {
|
||||
this.tipMsg = tipMsg;
|
||||
}
|
||||
|
||||
public void setSubMessage(String subMessage) {
|
||||
this.subMessage = subMessage;
|
||||
}
|
||||
|
||||
public void setMessageBold(boolean isBold) {
|
||||
this.messageBold = isBold;
|
||||
}
|
||||
|
||||
public void setMessageColor(@ColorRes int color) {
|
||||
this.messageColor = color;
|
||||
}
|
||||
|
||||
public void setMessageSize(int textSize) {
|
||||
this.messageSize = textSize;
|
||||
}
|
||||
|
||||
public void setSubMessageBold(boolean subMessageBold) {
|
||||
this.subMessageBold = subMessageBold;
|
||||
}
|
||||
|
||||
public void setSubMessageColor(int subMessageColor) {
|
||||
this.subMessageColor = subMessageColor;
|
||||
}
|
||||
|
||||
public void setSubMessageSize(int subMessageSize) {
|
||||
this.subMessageSize = subMessageSize;
|
||||
}
|
||||
|
||||
private OnActionListener l;
|
||||
|
||||
public void setOkText(String okText) {
|
||||
@@ -82,6 +173,4 @@ public class CommonTipDialog extends BaseDialog {
|
||||
default void onCancel() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_cp_invite_dialog.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_cp_invite_dialog.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 360 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_cp_invite_dilog_edit.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_cp_invite_dilog_edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_dialog_cp_invite_replay.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_dialog_cp_invite_replay.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 281 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_invite_dialog_price.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_invite_dialog_price.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
128
app/src/main/res/layout/dialog_cp_invite.xml
Normal file
128
app/src/main/res/layout/dialog_cp_invite.xml
Normal file
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout>
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="entity"
|
||||
type="com.yizhuan.xchat_android_core.relation.cp.CpInvitePageEntity" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:bind="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="655dp"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginRight="@dimen/dp_8">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginEnd="@dimen/dp_35"
|
||||
android:onClick="@{click}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_6"
|
||||
android:background="@drawable/bg_cp_invite_dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_close">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tip"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="70dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginRight="55dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:text="送出一个邀请函并填写你们的关系誓言,\n即可邀请对方绑定CP~"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.yizhuan.erban.relation.cp.widget.RelationCpCardView
|
||||
android:id="@+id/cp_card"
|
||||
bind:click="@{click}"
|
||||
bind:inviteData="@{entity}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tv_tip"
|
||||
app:layout_constraintRight_toRightOf="@id/tv_tip"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_tip"
|
||||
tools:layout_height="68dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_price"
|
||||
android:layout_width="146dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="124dp"
|
||||
android:background="@drawable/bg_invite_dialog_price"
|
||||
android:gravity="center"
|
||||
android:text="邀请函\n52000钻石"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cp_card" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_declaration"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
android:layout_marginRight="@dimen/dp_8"
|
||||
android:background="@drawable/bg_cp_invite_dilog_edit"
|
||||
tools:hint="@string/invite_declaration_hint"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:padding="@dimen/dp_9"
|
||||
android:textColor="#E0D5FF"
|
||||
android:textColorHint="#E0D5FF"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cp_card"
|
||||
app:layout_constraintRight_toRightOf="@id/cp_card"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_price" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_recommend"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
app:layout_constraintLeft_toLeftOf="@id/edit_declaration"
|
||||
app:layout_constraintRight_toRightOf="@id/edit_declaration"
|
||||
app:layout_constraintTop_toBottomOf="@id/edit_declaration" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sent"
|
||||
android:layout_width="144dp"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:background="#f0f"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:text="发送邀请"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/rv_recommend" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
81
app/src/main/res/layout/dialog_cp_invite_reply.xml
Normal file
81
app/src/main/res/layout/dialog_cp_invite_reply.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="291dp"
|
||||
android:layout_height="450dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_marginEnd="@dimen/dp_35"
|
||||
android:onClick="@{click}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@drawable/bg_dialog_cp_invite_replay"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_close">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_marginLeft="@dimen/dp_45"
|
||||
android:layout_marginRight="@dimen/dp_45"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
tools:text="一二三四五一二三四五一二三四五 邀请你达"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="@color/color_333333"
|
||||
android:id="@+id/tv_dialog_title"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
android:layout_marginRight="@dimen/dp_7"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tv_dialog_title"
|
||||
app:layout_constraintRight_toRightOf="@id/tv_dialog_title"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
tools:text="一二三四五一二三四五一二三四五 邀请你达"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#4C5AF1"
|
||||
android:id="@+id/tv_declaration"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_dialog_title" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_price"
|
||||
android:layout_width="146dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="102dp"
|
||||
android:background="@drawable/bg_invite_dialog_price"
|
||||
android:gravity="center"
|
||||
android:text="邀请函\n52000钻石"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_declaration" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -7,16 +7,21 @@
|
||||
name="cpEntity"
|
||||
type="com.yizhuan.xchat_android_core.relation.cp.CpRelation" />
|
||||
|
||||
<variable
|
||||
name="inviteData"
|
||||
type="com.yizhuan.xchat_android_core.relation.cp.CpInvitePageEntity" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
|
||||
<import type="android.text.TextUtils" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
</data>
|
||||
|
||||
<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"
|
||||
@@ -29,9 +34,9 @@
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/mine_avatar"
|
||||
avatarUrl="@{cpEntity.avatar}"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
avatarUrl="@{inviteData==null?cpEntity.avatar:inviteData.inviteAvatar}"
|
||||
android:layout_width="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog}"
|
||||
android:layout_height="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog}"
|
||||
android:layout_marginLeft="@dimen/dp_32"
|
||||
app:civ_border_color="@color/white"
|
||||
app:civ_border_width="1dp"
|
||||
@@ -51,7 +56,7 @@
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:paddingRight="@dimen/dp_16"
|
||||
android:singleLine="true"
|
||||
android:text="@{cpEntity.nick}"
|
||||
android:text="@{inviteData==null?cpEntity.nick:inviteData.inviteNick}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constrainedWidth="true"
|
||||
@@ -105,10 +110,11 @@
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/other_avatar"
|
||||
avatarUrl="@{cpEntity.cpAvatar}"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
avatarUrl="@{inviteData==null?cpEntity.cpAvatar:inviteData.acceptAvatar}"
|
||||
android:layout_width="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog}"
|
||||
android:layout_height="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog}"
|
||||
android:layout_marginRight="@dimen/dp_32"
|
||||
android:src="@drawable/ic_cp_invite"
|
||||
app:civ_border_color="@color/white"
|
||||
app:civ_border_width="1dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_other_name"
|
||||
@@ -127,7 +133,7 @@
|
||||
android:paddingLeft="@dimen/dp_16"
|
||||
android:paddingRight="@dimen/dp_16"
|
||||
android:singleLine="true"
|
||||
android:text="@{cpEntity.cpNick}"
|
||||
android:text="@{inviteData==null?(cpEntity.cpUid==0?@string/invite_cp:cpEntity.cpNick):inviteData.acceptNick}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constrainedWidth="true"
|
||||
@@ -137,16 +143,18 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/other_avatar"
|
||||
tools:text="我的cp战友名" />
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:id="@+id/tv_recovery_unbind"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:background="@drawable/bg_cp_pink_selector"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click}"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:text="撤销解除关系"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_cp_heart"
|
||||
@@ -193,14 +201,16 @@
|
||||
android:id="@+id/tv_declaration"
|
||||
android:layout_width="296dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginLeft="@dimen/dp_5"
|
||||
android:layout_marginTop="@dimen/dp_27"
|
||||
android:ellipsize="end"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:singleLine="true"
|
||||
android:text="@{cpEntity.declaration}"
|
||||
android:textColor="#9B8AFF"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tv_declaration"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_mine_name" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@@ -1,56 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<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="295dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/shape_white_20dp_round"
|
||||
tools:background="@color/black_transparent_10"
|
||||
android:orientation="vertical">
|
||||
android:paddingBottom="@dimen/dp_24"
|
||||
tools:background="@color/white_tran_10">
|
||||
|
||||
<View
|
||||
android:id="@+id/space_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_26" />
|
||||
android:layout_height="@dimen/dp_26"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginBottom="@dimen/dp_32"
|
||||
app:layout_constraintTop_toBottomOf="@id/space_view"
|
||||
tools:text="购买成功,是否立即驾驶sd水电费水电费?sfasdfasdfasdfasdfasdf" />
|
||||
|
||||
<LinearLayout
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sub_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:paddingStart="31dp"
|
||||
android:paddingEnd="31dp"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="13sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/message"
|
||||
tools:text="购买成功,是否立即驾驶sd水电费水电费?sfasdfasdfasdfasdfasdf" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="38dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="@color/color_7154EE"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/bg_common_cancel"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_ok"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="38dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_ok"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/content_barrier"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="message,sub_message" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:background="@drawable/bg_common_cancel"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="@color/color_7154EE"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/btn_ok"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_barrier" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_ok"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:gravity="center"
|
||||
android:text="@string/text_ok"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintLeft_toRightOf="@id/btn_cancel"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/content_barrier" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -358,10 +358,10 @@
|
||||
<enum name="center" value="1" />
|
||||
<enum name="right" value="2" />
|
||||
</attr>
|
||||
<attr name="rollviewpager_hint_paddingRight" format="dimension"/>
|
||||
<attr name="rollviewpager_hint_paddingLeft" format="dimension"/>
|
||||
<attr name="rollviewpager_hint_paddingTop" format="dimension"/>
|
||||
<attr name="rollviewpager_hint_paddingBottom" format="dimension"/>
|
||||
<attr name="rollviewpager_hint_paddingRight" format="dimension" />
|
||||
<attr name="rollviewpager_hint_paddingLeft" format="dimension" />
|
||||
<attr name="rollviewpager_hint_paddingTop" format="dimension" />
|
||||
<attr name="rollviewpager_hint_paddingBottom" format="dimension" />
|
||||
|
||||
<attr name="rollviewpager_play_delay" format="integer" />
|
||||
<attr name="rollviewpager_hint_color" format="color" />
|
||||
|
@@ -216,4 +216,8 @@
|
||||
<dimen name="dp_100">100dp</dimen>
|
||||
|
||||
<dimen name="margin_home_tab_gride">1.5dp</dimen>
|
||||
|
||||
<!--RelationCpCardView-->
|
||||
<dimen name="cp_avatar_normal">56dp</dimen>
|
||||
<dimen name="cp_avatar_dialog">44dp</dimen>
|
||||
</resources>
|
||||
|
@@ -917,6 +917,12 @@
|
||||
<string name="tip_delete_skill">确定要删除该技能卡?</string>
|
||||
|
||||
<!--CP-->
|
||||
<string name="cp_level">CP Lv.%s</string>>
|
||||
<string name="cp_duration">已陪伴%s小时</string>>
|
||||
<string name="cp_empty_text"> </string>
|
||||
<string name="cp_level">CP Lv.s%</string>>
|
||||
<string name="cp_duration">已陪伴s%小时</string>>
|
||||
<string name="invite_cp">邀请CP</string>
|
||||
<string name="has_cp">已有CP</string>
|
||||
<string name="invite_declaration_hint">在这里写上你们的关系誓言吧!\n(关系誓言会在展示个人资料页,请认真填写哦~</string>
|
||||
<string name="invite_gift_price_text">邀请函\ns%钻石</string>
|
||||
<string name="invite_cp_empty_declaration_tip">请输入关系誓言!</string>
|
||||
</resources>
|
||||
|
@@ -9,11 +9,11 @@ data class CpInvitePageEntity(
|
||||
val acceptAvatar: String?,
|
||||
val acceptGender: Int,//1-男2-女
|
||||
val acceptNick: String,
|
||||
val acceptUid: Int,
|
||||
val acceptUid: Long,
|
||||
val inviteAvatar: String?,
|
||||
val inviteGender: Int,
|
||||
val inviteNick: String,
|
||||
val inviteUid: Int,
|
||||
val inviteUid: Long,
|
||||
val propsId: Int,
|
||||
val propsImg: String,
|
||||
val propsName: String,
|
||||
|
@@ -10,7 +10,7 @@ data class CpRelation(
|
||||
val cpNextLevelSecretVal: Int,//cp下一等级所需亲密值
|
||||
val cpNick: String,
|
||||
val cpSecretVal: Int,//cp亲密值
|
||||
val cpUid: Int,
|
||||
val cpUid: Long,
|
||||
val dailyTask: List<DailyTask>,//日任务列表
|
||||
val declaration: String,//cp关系誓言
|
||||
val gender: Int,//1-男2-女
|
||||
@@ -18,7 +18,7 @@ data class CpRelation(
|
||||
val levelPercent: String,//cp当前等级到下一等级亲密值百分比(0~1间的小数)
|
||||
val nick: String,
|
||||
val totalTask: List<TotalTask>,// 累计任务列表
|
||||
val uid: Int,
|
||||
val uid: Long,
|
||||
val waitUnbound:Boolean,//CP状态 true 解绑中
|
||||
val unBoundUid:Long//解绑发起人UID
|
||||
)
|
||||
|
Reference in New Issue
Block a user