1.修改SearchActivity邀请好友Cp 2.处理发起Cp邀请购买道具余额不足的情况 3.个人中心增加亲密关系入口
@@ -1275,6 +1275,9 @@
|
||||
<activity
|
||||
android:name=".relation.cp.activity.CpHomeActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".relation.cp.activity.CpInviteRecordActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -1,11 +1,15 @@
|
||||
package com.yizhuan.erban.bindadapter;
|
||||
|
||||
import androidx.databinding.BindingAdapter;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -31,11 +35,11 @@ import java.util.Date;
|
||||
|
||||
public class ViewAdapter {
|
||||
|
||||
@BindingAdapter(value = {"imgUrl","defaultImage","isRound"},requireAll = false)
|
||||
public static void setImgUrl(ImageView imageView, String url, Drawable drawable,boolean isRound){
|
||||
if (isRound){
|
||||
@BindingAdapter(value = {"imgUrl", "defaultImage", "isRound"}, requireAll = false)
|
||||
public static void setImgUrl(ImageView imageView, String url, Drawable drawable, boolean isRound) {
|
||||
if (isRound) {
|
||||
ImageLoadUtils.loadBannerRoundBackground(imageView.getContext(), url, imageView);
|
||||
}else {
|
||||
} else {
|
||||
GlideApp.with(imageView.getContext())
|
||||
.load(TextUtils.isEmpty(url) ? R.mipmap.ic_tag_default : url)
|
||||
.placeholder(drawable)
|
||||
@@ -62,26 +66,27 @@ public class ViewAdapter {
|
||||
.into(imageView);
|
||||
}
|
||||
}
|
||||
@BindingAdapter(value = {"avatarUrl"},requireAll = false)
|
||||
public static void setAvatarUrl(ImageView imageView, String url){
|
||||
|
||||
@BindingAdapter(value = {"avatarUrl"}, requireAll = false)
|
||||
public static void setAvatarUrl(ImageView imageView, String url) {
|
||||
if (TextUtils.isEmpty(url) || url.equals("null")) return;
|
||||
ImageLoadUtils.loadAvatar(imageView.getContext(), url, imageView);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"roundUrl"},requireAll = false)
|
||||
public static void setRoundUrl(ImageView imageView, String url){
|
||||
@BindingAdapter(value = {"roundUrl"}, requireAll = false)
|
||||
public static void setRoundUrl(ImageView imageView, String url) {
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
ImageLoadUtils.loadSmallRoundBackground(imageView.getContext(), url, imageView);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"nomalUrl"},requireAll = false)
|
||||
public static void setNomalUrl(ImageView imageView, String url){
|
||||
@BindingAdapter(value = {"nomalUrl"}, requireAll = false)
|
||||
public static void setNomalUrl(ImageView imageView, String url) {
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
ImageLoadUtils.loadImage(imageView.getContext(), url, imageView);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"date"},requireAll = false)
|
||||
public static void setConstellation(TextView textView,long date){
|
||||
@BindingAdapter(value = {"date"}, requireAll = false)
|
||||
public static void setConstellation(TextView textView, long date) {
|
||||
String star = StarUtils.getConstellation(new Date(date));
|
||||
if (null == star) {
|
||||
textView.setVisibility(View.GONE);
|
||||
@@ -96,28 +101,28 @@ public class ViewAdapter {
|
||||
iosSwitchView.setOn(isOn);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"drawTime"},requireAll = false)
|
||||
public static void setTime(TextView tvContent,String time) {
|
||||
@BindingAdapter(value = {"drawTime"}, requireAll = false)
|
||||
public static void setTime(TextView tvContent, String time) {
|
||||
long longTime = 0;
|
||||
try {
|
||||
longTime = Long.parseLong(time);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (longTime == 0) {
|
||||
tvContent.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
tvContent.setText(TimeUtils.getPostTimeString(BasicConfig.INSTANCE.getAppContext(),longTime,true,false));
|
||||
tvContent.setText(TimeUtils.getPostTimeString(BasicConfig.INSTANCE.getAppContext(), longTime, true, false));
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"circleUrl"},requireAll = false)
|
||||
public static void setCircleUrl(ImageView imageView, String url){
|
||||
@BindingAdapter(value = {"circleUrl"}, requireAll = false)
|
||||
public static void setCircleUrl(ImageView imageView, String url) {
|
||||
// if (TextUtils.isEmpty(url)) return;
|
||||
ImageLoadUtils.loadCircleImage(imageView.getContext(), url, imageView, R.drawable.default_avatar);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"shape_color", "shape_radius", "shape_stroke_width", "shape_stroke_color"},requireAll = false)
|
||||
@BindingAdapter(value = {"shape_color", "shape_radius", "shape_stroke_width", "shape_stroke_color"}, requireAll = false)
|
||||
public static void setViewBackground(View view, int color, int radius_dp,
|
||||
float shape_stroke_width, int shape_stroke_color) {
|
||||
GradientDrawable drawable = new GradientDrawable();
|
||||
@@ -139,11 +144,11 @@ public class ViewAdapter {
|
||||
view.setSelected(selected);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"ktvRoundCover"},requireAll = false)
|
||||
public static void setKtvRoundCover(ImageView imageView, String url){
|
||||
if (TextUtils.isEmpty(url)){
|
||||
@BindingAdapter(value = {"ktvRoundCover"}, requireAll = false)
|
||||
public static void setKtvRoundCover(ImageView imageView, String url) {
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
imageView.setImageResource(R.drawable.default_cover);
|
||||
}else {
|
||||
} else {
|
||||
ImageLoadUtils.loadKtvRoundBackground(imageView.getContext(), url, imageView);
|
||||
}
|
||||
}
|
||||
@@ -160,4 +165,18 @@ public class ViewAdapter {
|
||||
drawable.setCornerRadius(UIUtil.dip2px(v.getContext(), radius));
|
||||
v.setBackground(drawable);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"android:layout_width"}, requireAll = false)
|
||||
public static void setLayoutWidth(View v, float width) {
|
||||
ViewGroup.LayoutParams params = v.getLayoutParams();
|
||||
params.width = (int) width;
|
||||
v.setLayoutParams(params);
|
||||
}
|
||||
|
||||
@BindingAdapter(value = {"android:layout_height"}, requireAll = false)
|
||||
public static void setLayoutHeight(View v, float height) {
|
||||
ViewGroup.LayoutParams params = v.getLayoutParams();
|
||||
params.height = (int) height;
|
||||
v.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@ import com.yizhuan.erban.base.BaseViewBindingFragment
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager.AbsOkDialogListener
|
||||
import com.yizhuan.erban.databinding.FragmentContactListBinding
|
||||
import com.yizhuan.erban.home.event.ContactTrashEvent
|
||||
import com.yizhuan.erban.relation.cp.activity.CpInviteRecordActivity
|
||||
import com.yizhuan.erban.ui.im.recent.RecentListFragment
|
||||
import com.yizhuan.erban.ui.relation.AttentionListActivity
|
||||
import com.yizhuan.erban.ui.relation.FansListActivity
|
||||
@@ -31,19 +32,19 @@ class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>
|
||||
|
||||
override fun init() {
|
||||
childFragmentManager.beginTransaction()
|
||||
.add(R.id.fcv, RecentListFragment.newInstance(false))
|
||||
.commitAllowingStateLoss()
|
||||
.add(R.id.fcv, RecentListFragment.newInstance(false))
|
||||
.commitAllowingStateLoss()
|
||||
//标记已读消息
|
||||
binding.ivContactTrash.setOnClickListener {
|
||||
if (NIMClient.getService(MsgService::class.java).totalUnreadCount > 0) {
|
||||
dialogManager.showOkCancelDialog(getString(R.string.tips_clear_unread_count),
|
||||
getString(R.string.text_canle), getString(R.string.tips_ok_label_clear),
|
||||
object : AbsOkDialogListener() {
|
||||
override fun onOk() {}
|
||||
override fun onCancel() {
|
||||
EventBus.getDefault().post(ContactTrashEvent())
|
||||
}
|
||||
})
|
||||
getString(R.string.text_canle), getString(R.string.tips_ok_label_clear),
|
||||
object : AbsOkDialogListener() {
|
||||
override fun onOk() {}
|
||||
override fun onCancel() {
|
||||
EventBus.getDefault().post(ContactTrashEvent())
|
||||
}
|
||||
})
|
||||
} else {
|
||||
toast("暂无未读消息需要清理")
|
||||
}
|
||||
@@ -58,7 +59,8 @@ class ContactsListFragment : BaseViewBindingFragment<FragmentContactListBinding>
|
||||
binding.tvFriend.setOnClickListener {
|
||||
FansListActivity.start(requireContext(), FansListActivity.TYPE_FRIEND)
|
||||
}
|
||||
binding.tvRelation.setOnClickListener {
|
||||
CpInviteRecordActivity.start(requireContext())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -26,6 +26,7 @@ import com.yizhuan.erban.home.helper.OpenRoomHelper;
|
||||
import com.yizhuan.erban.module_hall.HallDataManager;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity;
|
||||
import com.yizhuan.erban.relation.cp.activity.CpHomeActivity;
|
||||
import com.yizhuan.erban.skill.activity.SkillHomeActivity;
|
||||
import com.yizhuan.erban.ui.patriarch.PatriarchModeActivity;
|
||||
import com.yizhuan.erban.ui.pay.ChargeActivity;
|
||||
@@ -356,6 +357,9 @@ public class MeFragment extends BaseFragment implements View.OnClickListener {
|
||||
EventBus.getDefault().post(new VisitorUnreadCountEvent(0));
|
||||
VisitorListActivity.start(mContext);
|
||||
break;
|
||||
case R.id.me_item_relation:
|
||||
CpHomeActivity.Companion.start(mContext);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -1,5 +1,56 @@
|
||||
package com.yizhuan.erban.relation.cp
|
||||
|
||||
object CpViewHelper{
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.style.AbsoluteSizeSpan
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.ColorInt
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
|
||||
object CpViewHelper {
|
||||
|
||||
fun setInviteGiftPriceStyle(context: Context, price: String, tv: TextView) {
|
||||
val absoluteSizeSpan13 = AbsoluteSizeSpan(ScreenUtil.dip2px(13f))
|
||||
val absoluteSizeSpan10 = AbsoluteSizeSpan(ScreenUtil.dip2px(10f))
|
||||
val builder =
|
||||
SpannableStringBuilder(
|
||||
String.format(
|
||||
context.resources.getString(R.string.invite_gift_price_text),
|
||||
price
|
||||
)
|
||||
)
|
||||
builder.setSpan(
|
||||
absoluteSizeSpan13,
|
||||
0,
|
||||
3,
|
||||
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
|
||||
)
|
||||
|
||||
builder.setSpan(
|
||||
absoluteSizeSpan10,
|
||||
4,
|
||||
builder.length,
|
||||
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
|
||||
)
|
||||
tv.text = builder
|
||||
}
|
||||
|
||||
fun setInviteTimeRemain(time: String, tv: TextView) {
|
||||
val s = "请在${time}内决定,过期自动失效!"
|
||||
tv.text = getColorSpan(s, Color.RED, 2, time.length+2)
|
||||
}
|
||||
|
||||
fun getColorSpan(text: String, @ColorInt color: Int, start: Int, end: Int) =
|
||||
SpannableStringBuilder(text).apply {
|
||||
val colorSpan = ForegroundColorSpan(color)
|
||||
setSpan(
|
||||
colorSpan,
|
||||
start,
|
||||
end,
|
||||
SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE
|
||||
)
|
||||
}
|
||||
}
|
@@ -1,5 +1,7 @@
|
||||
package com.yizhuan.erban.relation.cp.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.activity.viewModels
|
||||
import com.yizhuan.erban.R
|
||||
@@ -18,7 +20,7 @@ class CpHomeActivity : BaseBindingActivity<ActivityCpHomeBinding>() {
|
||||
private val vm: CpViewModel by viewModels()
|
||||
override fun init() {
|
||||
initTitleBar("亲密关系")
|
||||
mBinding.click = this
|
||||
mBinding.cpCardView.setClick(this)
|
||||
initObserver()
|
||||
vm.getCpRelation(mUserId)
|
||||
}
|
||||
@@ -46,8 +48,7 @@ class CpHomeActivity : BaseBindingActivity<ActivityCpHomeBinding>() {
|
||||
}
|
||||
|
||||
vm.cpRelation.observe(this) {
|
||||
mBinding.cpEntity = it
|
||||
mBinding.cpCardView.setPageData(mUserId, PAGE_TYPE_SELF_CP, it)
|
||||
mBinding.cpCardView.setCpEntityData(mUserId, PAGE_TYPE_SELF_CP, it)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,4 +56,11 @@ class CpHomeActivity : BaseBindingActivity<ActivityCpHomeBinding>() {
|
||||
private fun toUserInfoActivity(uid: Long?) {
|
||||
uid?.let { UserInfoActivity.Companion.start(this, it) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun start(context: Context) {
|
||||
val intent = Intent(context, CpHomeActivity::class.java)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package com.yizhuan.erban.relation.cp.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.activity.viewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseBindingActivity
|
||||
import com.yizhuan.erban.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.databinding.ActivityCpInviteRecordBinding
|
||||
import com.yizhuan.erban.relation.cp.adapter.InviteRecordAdapter
|
||||
import com.yizhuan.erban.relation.cp.viewmodel.CpViewModel
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.activity_cp_invite_record)
|
||||
class CpInviteRecordActivity : BaseBindingActivity<ActivityCpInviteRecordBinding>() {
|
||||
private val vm: CpViewModel by viewModels()
|
||||
private lateinit var adapter: InviteRecordAdapter
|
||||
private val type = 1// 1-别人给我发的邀请,2-我给别人发的邀请
|
||||
override fun init() {
|
||||
initTitleBar("关系申请")
|
||||
|
||||
adapter = InviteRecordAdapter(this)
|
||||
val layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
mBinding.recyclerView.layoutManager = layoutManager
|
||||
adapter.emptyView = EmptyViewHelper.createEmptyView(this, "暂无数据")
|
||||
adapter.bindToRecyclerView(mBinding.recyclerView)
|
||||
mBinding.swipeRefresh.setOnRefreshListener {
|
||||
queryRecord(type)
|
||||
}
|
||||
vm.userCpListData.observe(this) {
|
||||
adapter.setNewData(it)
|
||||
}
|
||||
|
||||
vm.loadingLiveData.observe(this) {
|
||||
if (it) dialogManager.showProgressDialog(this)
|
||||
else dialogManager.dismissDialog()
|
||||
}
|
||||
}
|
||||
|
||||
private fun queryRecord(type: Int) {
|
||||
vm.getUserCpListData(type)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun start(context: Context) {
|
||||
val intent = Intent(context, CpInviteRecordActivity::class.java)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package com.yizhuan.erban.relation.cp.adapter
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.xchat_android_core.relation.cp.UserCpListEntity
|
||||
|
||||
|
||||
class InviteRecordAdapter(private val context: Context) :
|
||||
BaseQuickAdapter<UserCpListEntity, BaseViewHolder>(
|
||||
R.layout.item_cp_invite_record
|
||||
) {
|
||||
var onVisitClickListener: OnVisitClickListener? = null
|
||||
override fun convert(helper: BaseViewHolder, item: UserCpListEntity?) {
|
||||
item?.inviteUserAvatar?.let {
|
||||
val imageView = helper
|
||||
.getView<ImageView>(R.id.iv_avatar)
|
||||
ImageLoadUtilsV2.loadAvatar(imageView, it)
|
||||
}
|
||||
item?.inviteUserNick.let {
|
||||
val tvName = helper.getView<TextView>(R.id.tv_name)
|
||||
tvName.text = it
|
||||
}
|
||||
|
||||
val tvVisit = helper.getView<TextView>(R.id.tv_visit)
|
||||
item?.state?.let {
|
||||
when (it) {
|
||||
1 -> tvVisit.text = context.resources.getString(R.string.invite_cp_state_invited)
|
||||
2 -> tvVisit.text = context.resources.getString(R.string.invite_cp_state_agreed)
|
||||
3 -> tvVisit.text = context.resources.getString(R.string.invite_cp_state_refused)
|
||||
4 -> tvVisit.text = context.resources.getString(R.string.invite_cp_state_unbinding)
|
||||
5 -> tvVisit.text = context.resources.getString(R.string.invite_cp_state_unbound)
|
||||
}
|
||||
tvVisit.isEnabled = it == 0
|
||||
}
|
||||
tvVisit.setOnClickListener {
|
||||
if (item != null) {
|
||||
onVisitClickListener?.onVisitClick(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface OnVisitClickListener {
|
||||
fun onVisitClick(item: UserCpListEntity)
|
||||
}
|
||||
}
|
@@ -7,6 +7,7 @@ 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.relation.cp.CpViewHelper
|
||||
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
|
||||
@@ -19,14 +20,17 @@ class CpInvitePageDialog(context: Context) :
|
||||
var entity: CpInvitePageEntity? = null
|
||||
override fun init() {
|
||||
binding.setClick { this }
|
||||
binding.cpCard.setDialogPageData()
|
||||
initSpannable()
|
||||
}
|
||||
|
||||
fun setInvitePageData(invitePageEntity: CpInvitePageEntity) {
|
||||
binding.cpCard.setInviteDialogPageData(invitePageEntity)
|
||||
}
|
||||
|
||||
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))
|
||||
@@ -46,26 +50,7 @@ class CpInvitePageDialog(context: Context) :
|
||||
}
|
||||
|
||||
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
|
||||
)
|
||||
CpViewHelper.setInviteGiftPriceStyle(context, entity?.propsPrice ?: "", this)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,31 @@
|
||||
package com.yizhuan.erban.relation.cp.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.view.View
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogCpInviteReplyConfirmBinding
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.yizhuan.erban.ui.widget.dialog.CommonTipDialog
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_cp_invite_reply_confirm)
|
||||
class CpInviteReplyConfirmDialog(context: Context) :
|
||||
BaseBindingDialog<DialogCpInviteReplyConfirmBinding>(context), View.OnClickListener {
|
||||
|
||||
var okCancelListener: CommonTipDialog.OnActionListener? = null
|
||||
override fun init() {
|
||||
binding.click = this
|
||||
}
|
||||
|
||||
fun setTitle(text: SpannableStringBuilder) {
|
||||
binding.tvMessage.text = text
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.tv_refuse -> okCancelListener?.onCancel()
|
||||
R.id.tv_confirm -> okCancelListener?.onOk()
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,14 +1,118 @@
|
||||
package com.yizhuan.erban.relation.cp.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.TextUtils
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.View
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogCpInviteReplyBinding
|
||||
import com.yizhuan.erban.relation.cp.CpViewHelper
|
||||
import com.yizhuan.erban.relation.cp.CpViewHelper.getColorSpan
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.yizhuan.erban.utils.TimeUiUtils
|
||||
import com.yizhuan.xchat_android_core.relation.cp.UserCpListEntity
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import io.reactivex.*
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import java.lang.Exception
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_cp_invite_reply)
|
||||
class CpInviteReplyDialog(context:Context):BaseBindingDialog<DialogCpInviteReplyBinding>(context) {
|
||||
override fun init() {
|
||||
class CpInviteReplyDialog(context: Context) :
|
||||
BaseBindingDialog<DialogCpInviteReplyBinding>(context),
|
||||
View.OnClickListener {
|
||||
private val disposeSet by lazy {
|
||||
CompositeDisposable()
|
||||
}
|
||||
|
||||
var cpInviteData: UserCpListEntity? = null
|
||||
var listener: ReplyListener? = null
|
||||
override fun init() {
|
||||
binding.click = this
|
||||
cpInviteData?.let {
|
||||
setPage(it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setPage(data: UserCpListEntity) {
|
||||
|
||||
binding.tvDialogTitle.text = getColorSpan(
|
||||
"${data.inviteUserNick}邀请你达成CP关系,是否同意?",
|
||||
Color.parseColor("#4C5AF1"),
|
||||
0,
|
||||
data.inviteUserNick.length
|
||||
)
|
||||
CpViewHelper.setInviteTimeRemain(data.updateTime, binding.tvTime)
|
||||
CpViewHelper.setInviteGiftPriceStyle(context, data.propsPrice, binding.tvPrice)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.tv_refuse -> {
|
||||
listener?.onRefuse()
|
||||
}
|
||||
R.id.tv_agree -> {
|
||||
listener?.onAgree()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if (TextUtils.isEmpty(cpInviteData?.updateTime)) return
|
||||
try {
|
||||
val arr = cpInviteData?.updateTime?.split(":")
|
||||
if (arr != null) {
|
||||
val h = arr.getOrNull(0)?.toInt() ?: 0 * 3600
|
||||
val m = arr.getOrNull(1)?.toInt() ?: 0 * 60
|
||||
val s = arr.getOrNull(2)?.toInt() ?: 0
|
||||
val remain = h + m + s
|
||||
Observable.interval(1000, TimeUnit.MILLISECONDS)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(object : Observer<Long> {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
disposeSet.add(d)
|
||||
}
|
||||
|
||||
override fun onNext(t: Long) {
|
||||
val s = TimeUiUtils.getDynamicUi((remain - 1) * 1000.toLong())
|
||||
CpViewHelper.setInviteTimeRemain(s, binding.tvTime)
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
throw e
|
||||
}
|
||||
|
||||
override fun onComplete() {}
|
||||
})
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
stopCountDown()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
stopCountDown()
|
||||
}
|
||||
|
||||
private fun stopCountDown() {
|
||||
if (!disposeSet.isDisposed) {
|
||||
disposeSet.dispose()
|
||||
disposeSet.clear()
|
||||
}
|
||||
}
|
||||
|
||||
interface ReplyListener {
|
||||
fun onAgree()
|
||||
fun onRefuse()
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
package com.yizhuan.erban.relation.cp.event;
|
||||
|
||||
public class BalanceEvent {
|
||||
}
|
@@ -16,7 +16,7 @@ interface Api {
|
||||
* @param acceptUid (query) 被邀请用户uid
|
||||
*/
|
||||
@GET("/user/couple/cpInvitePage")
|
||||
fun getCpInvitePageData(
|
||||
suspend fun getCpInvitePageData(
|
||||
@Query("acceptUid") acceptUid: Long
|
||||
): ServiceResult<CpInvitePageEntity>
|
||||
|
||||
@@ -25,7 +25,7 @@ interface Api {
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/user/couple/cpMpApply")
|
||||
fun cpMpApply(
|
||||
suspend fun cpMpApply(
|
||||
@Field("mpId") mpId: Int,
|
||||
@Field("mpTxt") mpTxt: String
|
||||
): ServiceResult<Any>//无需关心返回值
|
||||
@@ -34,7 +34,7 @@ interface Api {
|
||||
*cp铭牌申请记录
|
||||
*/
|
||||
@GET("/user/couple/cpMpApplyList")
|
||||
fun getCpMpApplyList(
|
||||
suspend fun getCpMpApplyList(
|
||||
@Query("pageNumber") pageNumber: Int,
|
||||
@Query("pageSize") pageSize: Int
|
||||
): ServiceResult<List<CpMpApplyListEntity>>
|
||||
@@ -48,7 +48,7 @@ interface Api {
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/user/couple/makeCpInvite")
|
||||
fun makeCpInvite(
|
||||
suspend fun makeCpInvite(
|
||||
@Field("acceptUid") acceptUid: Long,
|
||||
@Field("declaration") declaration: String,
|
||||
@Field("propsId") propsId: Int
|
||||
@@ -61,7 +61,7 @@ interface Api {
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/user/couple/replyCpInvite")
|
||||
fun replyCpInvite(
|
||||
suspend fun replyCpInvite(
|
||||
@Field("id") id: Int, @Query("state") state: Int
|
||||
): ServiceResult<Any>
|
||||
|
||||
@@ -69,26 +69,26 @@ interface Api {
|
||||
* 撤销解除绑定
|
||||
*/
|
||||
@POST("/user/couple/revertUnboundCp")
|
||||
fun revertUnboundCp(): ServiceResult<Any>
|
||||
suspend fun revertUnboundCp(): ServiceResult<Any>
|
||||
|
||||
/**
|
||||
*解除绑定CP关系
|
||||
*/
|
||||
@POST("/user/couple/unboundCp")
|
||||
fun unboundCp(): ServiceResult<Any>
|
||||
suspend fun unboundCp(): ServiceResult<Any>
|
||||
|
||||
/**
|
||||
*用户CP等级可申请铭牌
|
||||
*/
|
||||
@GET("/user/couple/userCpLevelMp")
|
||||
fun userCpLevelMp(): ServiceResult<UserCpLevelMpRootEntity>
|
||||
suspend fun userCpLevelMp(): ServiceResult<UserCpLevelMpRootEntity>
|
||||
|
||||
/**
|
||||
*个人CP邀请列表
|
||||
* @param type 1-别人给我发的邀请,2-我给别人发的邀请
|
||||
*/
|
||||
@GET("/user/couple/userCpList")
|
||||
fun userCpList(
|
||||
suspend fun userCpList(
|
||||
@Query("type") type: Int
|
||||
): ServiceResult<List<UserCpListEntity>>
|
||||
|
||||
@@ -96,5 +96,5 @@ interface Api {
|
||||
*亲密(CP)关系
|
||||
*/
|
||||
@GET("/user/couple/cpRelation")
|
||||
fun cpRelation(@Query("uid") uid: Long): ServiceResult<CpRelation>
|
||||
suspend fun cpRelation(@Query("uid") uid: Long): ServiceResult<CpRelation>
|
||||
}
|
@@ -3,9 +3,13 @@ package com.yizhuan.erban.relation.cp.viewmodel
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
import com.yizhuan.erban.relation.cp.event.BalanceEvent
|
||||
import com.yizhuan.erban.relation.cp.model.CpModel
|
||||
import com.yizhuan.xchat_android_core.relation.cp.*
|
||||
import com.yizhuan.xchat_android_core.utils.net.BalanceNotEnoughExeption
|
||||
import com.yizhuan.xchat_android_core.utils.net.ServerException
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
class CpViewModel : BaseViewModel() {
|
||||
|
||||
@@ -58,20 +62,7 @@ class CpViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun getUserCpLevelMpData(type: Int) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.userCpList(type)?.let {
|
||||
_userCpListData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun getUserCpListData() {
|
||||
fun getUserCpLevelMpData() {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
@@ -84,6 +75,19 @@ class CpViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun getUserCpListData(type: Int) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.userCpList(type)?.let {
|
||||
_userCpListData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun getCpRelation(uid: Long) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
@@ -97,10 +101,22 @@ class CpViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun makeCpInvite(acceptUid: Long, declaration: String, propsId: Int) {
|
||||
fun makeCpInvite(
|
||||
acceptUid: Long,
|
||||
declaration: String,
|
||||
propsId: Int,
|
||||
onBalanceNotEnough: (() -> Unit)? = null
|
||||
) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
onError = {
|
||||
if (it is ServerException && it.code == BalanceNotEnoughExeption.code) {
|
||||
//余额不足
|
||||
onBalanceNotEnough?.invoke()
|
||||
} else {
|
||||
dealCpDataError()
|
||||
}
|
||||
},
|
||||
block = {
|
||||
CpModel.makeCpInvite(acceptUid, declaration, propsId)
|
||||
_loadingLiveData.value = false
|
||||
@@ -122,7 +138,7 @@ class CpViewModel : BaseViewModel() {
|
||||
|
||||
private fun dealCpDataError():
|
||||
(e: Throwable) -> Unit = {
|
||||
it.message.toast()
|
||||
_loadingLiveData.value = false
|
||||
it.message.toast()
|
||||
}
|
||||
}
|
@@ -9,6 +9,7 @@ import androidx.databinding.DataBindingUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.LayoutCpCardBinding
|
||||
import com.yizhuan.erban.relation.extention.visibility
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpInvitePageEntity
|
||||
import com.yizhuan.xchat_android_core.relation.cp.CpRelation
|
||||
|
||||
class RelationCpCardView(context: Context, attr: AttributeSet?, def: Int) :
|
||||
@@ -21,15 +22,23 @@ class RelationCpCardView(context: Context, attr: AttributeSet?, def: Int) :
|
||||
init {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
binding = DataBindingUtil.inflate(inflater, R.layout.layout_cp_card, this, true)
|
||||
setPageData(-1,-1,null,null)
|
||||
}
|
||||
|
||||
fun setPageData(selfUId: Long, type: Int, cpRelation: CpRelation?) {
|
||||
private fun setPageData(
|
||||
selfUId: Long,
|
||||
type: Int,
|
||||
cpRelation: CpRelation?,
|
||||
inviteData: CpInvitePageEntity?
|
||||
) {
|
||||
var userInfoVisibility = false
|
||||
var cpLevelVisibility = false
|
||||
var unbindVisibility = false
|
||||
var unbindRecoverVisibility = false
|
||||
var groupEmptyVisibility = false
|
||||
var declarationVisibility = false
|
||||
cpRelation?.let { binding.cpEntity = it }
|
||||
inviteData?.let { binding.inviteData = it }
|
||||
when (type) {
|
||||
PAGE_TYPE_SELF_CP -> {
|
||||
if (cpRelation == null) throw Exception("type:PAGE_TYPE_SELF_CP,cpRelation: CpRelation cant be null!!!")
|
||||
@@ -81,8 +90,16 @@ class RelationCpCardView(context: Context, attr: AttributeSet?, def: Int) :
|
||||
|
||||
}
|
||||
|
||||
fun setDialogPageData() {
|
||||
setPageData(0, PAGE_TYPE_INVITE_DIALOG, null)
|
||||
fun setInviteDialogPageData(inviteData: CpInvitePageEntity?) {
|
||||
setPageData(0, PAGE_TYPE_INVITE_DIALOG, null, inviteData)
|
||||
}
|
||||
|
||||
fun setCpEntityData(selfUId: Long, type: Int, cpRelation: CpRelation?) {
|
||||
setPageData(selfUId, type, cpRelation, null)
|
||||
}
|
||||
|
||||
fun setClick(click: OnClickListener) {
|
||||
binding.click = click
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@@ -2,12 +2,14 @@ package com.yizhuan.erban.ui.im.friend
|
||||
|
||||
import android.text.TextUtils
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.bun.miitmdid.core.JLibrary.context
|
||||
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.pay.ChargeActivity
|
||||
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
|
||||
@@ -55,6 +57,7 @@ class FriendFragmentCpDelegate(private val fragment: BaseFragment) {
|
||||
private fun showInvitePageDialog(info: CpInvitePageEntity) {
|
||||
with(cpInviteDialog) {
|
||||
entity = info
|
||||
setInvitePageData(info)
|
||||
if (isShowing) closeDialog()
|
||||
openDialog()
|
||||
}
|
||||
@@ -74,7 +77,11 @@ class FriendFragmentCpDelegate(private val fragment: BaseFragment) {
|
||||
cpInvitePageEntity.acceptUid,
|
||||
declaration,
|
||||
cpInvitePageEntity.propsId
|
||||
)
|
||||
) {
|
||||
DialogManager(fragment.context).showOkCancelDialog("钻石余额不足,请前去充值!") {
|
||||
ChargeActivity.start(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -22,6 +22,8 @@ import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.StringExtensionKt;
|
||||
|
||||
import lombok.val;
|
||||
|
||||
/**
|
||||
* @author chenran
|
||||
* @date 2017/10/3
|
||||
@@ -143,10 +145,14 @@ public class FriendListAdapter extends BaseQuickAdapter<UserInfo, BaseViewHolder
|
||||
case AbstractSelectFriendAction.TYPE_CP:
|
||||
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));
|
||||
}*/
|
||||
//1-邀请中,2-已有CP,3-可邀请
|
||||
final int cpState = item.getCpState();
|
||||
tvInvite.setEnabled(cpState != 1 && cpState != 2);
|
||||
tvInvite.setText(
|
||||
cpState == 1 ? context.getResources().getString(R.string.invite_cp_state_invited) :
|
||||
cpState == 2 ? context.getResources().getString(R.string.has_cp) :
|
||||
context.getResources().getString(R.string.invite_cp)
|
||||
);
|
||||
tvInvite.setOnClickListener(v -> {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.sendListener(item);
|
||||
|
@@ -3,6 +3,7 @@ package com.yizhuan.erban.ui.relation
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
@@ -51,6 +52,11 @@ class FansListActivity : BaseActivity() {
|
||||
|
||||
TYPE_CP -> {
|
||||
initWhiteTitleBar(getString(R.string.title_select_friend))
|
||||
val layoutSearch = findViewById<ViewGroup>(R.id.layout_search)
|
||||
layoutSearch.visibility = View.VISIBLE
|
||||
layoutSearch.setOnClickListener {
|
||||
SearchActivity.start(this, AbstractSelectFriendAction.TYPE_CP)
|
||||
}
|
||||
commitF(FriendListFragment.newInstance(false, AbstractSelectFriendAction.TYPE_CP))
|
||||
}
|
||||
else -> {
|
||||
@@ -58,9 +64,6 @@ class FansListActivity : BaseActivity() {
|
||||
commitF(FansListFragment.newInstance(Constants.FAN_NO_MAIN_PAGE_TYPE))
|
||||
}
|
||||
}
|
||||
findViewById<ViewGroup>(R.id.layout_search).setOnClickListener {
|
||||
SearchActivity.start(this, AbstractSelectFriendAction.TYPE_CP)
|
||||
}
|
||||
}
|
||||
|
||||
private fun commitF(fragment: Fragment) {
|
||||
|
@@ -236,7 +236,7 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
||||
List<Fragment> mTabs = new ArrayList<>();
|
||||
//CP
|
||||
if (type == AbstractSelectFriendAction.TYPE_CP) {
|
||||
userFrg = SearchDetailFragment.newInstance(SearchDetailFragment.TYPE_SEARCH_USER);
|
||||
userFrg = SearchDetailFragment.newInstance(SearchDetailFragment.TYPE_SEARCH_USER, AbstractSelectFriendAction.TYPE_CP);
|
||||
mTabs.add(userFrg);
|
||||
viewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), mTabs, null));
|
||||
return;
|
||||
@@ -473,10 +473,7 @@ public class SearchActivity extends BaseMvpActivity<ISearchView, SearchPresenter
|
||||
}
|
||||
|
||||
private void starSearch(String str) {
|
||||
if (userFrg == null) {
|
||||
initSearchDetail();
|
||||
}
|
||||
if (roomFrg == null && type != AbstractSelectFriendAction.TYPE_CP) {
|
||||
if (userFrg == null || roomFrg == null && type != AbstractSelectFriendAction.TYPE_CP) {
|
||||
initSearchDetail();
|
||||
}
|
||||
if (roomFrg != null) {
|
||||
|
@@ -52,6 +52,9 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
holder.userName.setText(item.getNick() != null ? item.getNick().replaceAll(RegexUtil.getNotPrintableStringReg(), "?") : "");
|
||||
holder.ivLive.setVisibility(item.getRoomUid() == 0 ? View.GONE : View.VISIBLE);
|
||||
holder.container.setOnClickListener(v -> {
|
||||
if (fromType == AbstractSelectFriendAction.TYPE_CP) {
|
||||
return;
|
||||
}
|
||||
UserInfoActivity.Companion.start(context, item.getUid());
|
||||
});
|
||||
} else {
|
||||
@@ -74,6 +77,14 @@ public class SearchAdapter extends BaseQuickAdapter<SearchRoomInfo, SearchAdapte
|
||||
} else {
|
||||
holder.stvOp.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
//CP
|
||||
else if (fromType == AbstractSelectFriendAction.TYPE_CP) {
|
||||
holder.stvOp.setVisibility(View.VISIBLE);
|
||||
final int cpState = item.getCpState();
|
||||
holder.stvOp.setText(cpState == 1 ? "已邀请" : cpState == 2 ? "已有CP" : "邀请");
|
||||
holder.stvOp.setEnabled(cpState != 1 && cpState != 2);
|
||||
holder.stvOp.setBackground(context.getResources().getDrawable(R.drawable.bg_button_relation_invite));
|
||||
} else {
|
||||
holder.stvOp.setVisibility(View.GONE);
|
||||
}
|
||||
|
@@ -60,6 +60,15 @@ public class SearchDetailFragment extends BaseMvpFragment<ISearchView, SearchPre
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public static SearchDetailFragment newInstance(int type, int fromType) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
args.putInt("fromType", fromType);
|
||||
SearchDetailFragment fragment = new SearchDetailFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public static SearchDetailFragment newInstance(long hallId, int type, int fromType) {
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("hallId", hallId);
|
||||
|
After Width: | Height: | Size: 105 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_invite_reply_agree.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_invite_reply_refuse.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_msg_relation.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
8
app/src/main/res/drawable/bg_white_round_10.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dp_10" />
|
||||
<solid android:color="@color/white" />
|
||||
|
||||
</shape>
|
@@ -1,16 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:bind="http://schemas.android.com/tools">
|
||||
<data>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<variable
|
||||
name="cpEntity"
|
||||
type="com.yizhuan.xchat_android_core.relation.cp.CpRelation" />
|
||||
|
||||
<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="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@@ -19,7 +9,6 @@
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.yizhuan.erban.relation.cp.widget.RelationCpCardView
|
||||
@@ -29,8 +18,6 @@
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
bind:cpEntity="@{cpEntity}"
|
||||
bind:click="@{click}"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
33
app/src/main/res/layout/activity_cp_invite_record.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.yizhuan.erban.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_20"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -47,6 +47,7 @@
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:enabled="false"
|
||||
android:hint="@string/search_hint"
|
||||
android:inputType="text"
|
||||
android:maxLength="20"
|
||||
@@ -59,8 +60,8 @@
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_15" />
|
||||
</LinearLayout>
|
||||
|
@@ -3,11 +3,6 @@
|
||||
<layout>
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="entity"
|
||||
type="com.yizhuan.xchat_android_core.relation.cp.CpInvitePageEntity" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="android.view.View.OnClickListener" />
|
||||
@@ -15,7 +10,6 @@
|
||||
|
||||
<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"
|
||||
@@ -58,8 +52,6 @@
|
||||
|
||||
<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"
|
||||
|
@@ -31,34 +31,34 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_close">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_dialog_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_marginLeft="@dimen/dp_45"
|
||||
android:layout_marginTop="@dimen/dp_22"
|
||||
android:layout_marginRight="@dimen/dp_45"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_13"
|
||||
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" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="一二三四五一二三四五一二三四五 邀请你达" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_declaration"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_marginLeft="@dimen/dp_7"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginRight="@dimen/dp_7"
|
||||
android:gravity="center"
|
||||
android:textColor="#4C5AF1"
|
||||
android:textSize="@dimen/sp_13"
|
||||
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" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_dialog_title"
|
||||
tools:text="一二三四五一二三四五一二三四五 邀请你达" />
|
||||
|
||||
|
||||
<TextView
|
||||
@@ -74,8 +74,50 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_declaration" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_refuse"
|
||||
android:layout_width="101dp"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:background="@drawable/bg_invite_reply_refuse"
|
||||
android:gravity="center"
|
||||
android:text="拒绝"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tv_agree"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_price" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_agree"
|
||||
android:layout_width="101dp"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:background="@drawable/bg_invite_reply_agree"
|
||||
android:gravity="center"
|
||||
android:text="同意"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_refuse"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_price" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_refuse"
|
||||
tools:text="内决定,过期自动失效!" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
65
app/src/main/res/layout/dialog_cp_invite_reply_confirm.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?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="300dp"
|
||||
android:background="@drawable/bg_dialog_cp_invite_reply_confirm"
|
||||
android:layout_height="180dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_message"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="56dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constrainedHeight="true"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:gravity="center"
|
||||
tools:text = "是否同意与与一二三四五六成为CP?"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_refuse"
|
||||
android:layout_width="101dp"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:background="@drawable/bg_invite_reply_refuse"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:onClick="@{click}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tv_agree"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_message" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_agree"
|
||||
android:layout_width="101dp"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
android:background="@drawable/bg_invite_reply_agree"
|
||||
android:gravity="center"
|
||||
android:text="确认"
|
||||
android:onClick="@{click}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_refuse"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_message" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -66,6 +66,17 @@
|
||||
android:text="粉丝"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_relation"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableTop="@drawable/ic_msg_relation"
|
||||
android:gravity="center"
|
||||
android:text="关系申请"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
|
@@ -489,6 +489,23 @@
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/me_item_relation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_me_text_padding_to_icon"
|
||||
android:drawableStart="@mipmap/icon_relation"
|
||||
android:drawableEnd="@drawable/arrow_right"
|
||||
android:drawablePadding="13dp"
|
||||
android:gravity="center_vertical"
|
||||
android:onClick="@{click}"
|
||||
android:paddingTop="@dimen/dp_15"
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingBottom="@dimen/dp_15"
|
||||
android:text="@string/menu_my_relation"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/me_item_wallet"
|
||||
android:layout_width="match_parent"
|
||||
|
61
app/src/main/res/layout/item_cp_invite_record.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:paddingBottom="6dp">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="@dimen/dp_45"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_desc"
|
||||
app:layout_constraintLeft_toRightOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="这就是大哥呀呀" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name"
|
||||
android:text="向你发出CP邀请" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_visit"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:background="@drawable/bg_button_relation_invite"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
tools:text="查看"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@@ -23,23 +23,25 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_cp_card"
|
||||
android:paddingLeft="@dimen/dp_4"
|
||||
android:paddingTop="@dimen/dp_5"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:minHeight="148dp"
|
||||
android:paddingBottom="@dimen/dp_5">
|
||||
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/mine_avatar"
|
||||
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_width="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog,default=@dimen/cp_avatar_normal}"
|
||||
android:layout_height="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog,default=@dimen/cp_avatar_normal}"
|
||||
android:layout_marginLeft="@dimen/dp_32"
|
||||
app:civ_border_color="@color/white"
|
||||
app:civ_border_width="1dp"
|
||||
android:onClick="@{click}"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_mine_name"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -71,10 +73,10 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_cp_heart"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_cp_time"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_mine_name"
|
||||
app:layout_constraintLeft_toRightOf="@id/mine_avatar"
|
||||
app:layout_constraintRight_toLeftOf="@id/other_avatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_level" />
|
||||
app:layout_constraintTop_toTopOf="@id/mine_avatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_level"
|
||||
@@ -97,26 +99,25 @@
|
||||
android:id="@+id/tv_cp_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_9"
|
||||
android:gravity="center"
|
||||
android:text="@{@string/cp_duration(String.valueOf(cpEntity.cpKeepDuration))}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_cp_heart"
|
||||
app:layout_constraintRight_toRightOf="@id/iv_cp_heart"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_cp_heart"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_mine_name"
|
||||
tools:text="已陪伴8888个小时" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/other_avatar"
|
||||
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_width="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog,default=@dimen/cp_avatar_normal}"
|
||||
android:layout_height="@{inviteData==null?@dimen/cp_avatar_normal:@dimen/cp_avatar_dialog,default=@dimen/cp_avatar_normal}"
|
||||
android:layout_marginRight="@dimen/dp_32"
|
||||
android:src="@drawable/ic_cp_invite"
|
||||
app:civ_border_color="@color/white"
|
||||
app:civ_border_width="1dp"
|
||||
android:onClick="@{click}"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_other_name"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@@ -113,18 +113,18 @@
|
||||
android:id="@+id/stv_op"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/bg_common_confirm_normal"
|
||||
android:gravity="start|center_vertical"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingEnd="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="邀请"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:visibility="gone"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingEnd="@dimen/dp_16"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="邀请"
|
||||
android:background="@drawable/bg_common_confirm_normal"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<View
|
||||
|
BIN
app/src/main/res/mipmap-xhdpi/icon_relation.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
@@ -96,6 +96,7 @@
|
||||
<string name="menu_my_income">我的礼物票</string>
|
||||
<string name="menu_my_level">我的等级</string>
|
||||
<string name="menu_my_invite">邀请好友</string>
|
||||
<string name="menu_my_relation">亲密关系</string>
|
||||
<string name="menu_my_decoration">我的装扮</string>
|
||||
<string name="menu_my_union">我的公会</string>
|
||||
<string name="menu_my_gold_charge">钻石/充值</string>
|
||||
@@ -918,11 +919,16 @@
|
||||
|
||||
<!--CP-->
|
||||
<string name="cp_empty_text"> </string>
|
||||
<string name="cp_level">CP Lv.s%</string>>
|
||||
<string name="cp_duration">已陪伴s%小时</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>
|
||||
<string name="invite_cp_state_invited">已邀请</string>
|
||||
<string name="invite_cp_state_agreed">已同意</string>
|
||||
<string name="invite_cp_state_refused">已拒绝</string>
|
||||
<string name="invite_cp_state_unbinding">解绑中</string>
|
||||
<string name="invite_cp_state_unbound">已解绑</string>
|
||||
</resources>
|
||||
|
@@ -47,7 +47,12 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
|
||||
private long birth;
|
||||
|
||||
/** 是否是靓号,1:靓号 */
|
||||
//Cp
|
||||
private int cpState;
|
||||
|
||||
/**
|
||||
* 是否是靓号,1:靓号
|
||||
*/
|
||||
public boolean hasPrettyErbanNo;
|
||||
public NobleInfo nobleUsers;
|
||||
public UserLevelVo userLevelVo;
|
||||
@@ -65,12 +70,14 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
defUser = in.readInt();
|
||||
erbanNo = in.readLong();
|
||||
badge = in.readString();
|
||||
cpState = in.readInt();
|
||||
hasPrettyErbanNo = in.readByte() != 0;
|
||||
|
||||
bannerInfos = in.createTypedArrayList(BannerInfo.CREATOR);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
super.writeToParcel(dest, flags);
|
||||
@@ -79,6 +86,7 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
dest.writeInt(defUser);
|
||||
dest.writeLong(erbanNo);
|
||||
dest.writeString(badge);
|
||||
dest.writeInt(cpState);
|
||||
dest.writeByte((byte) (hasPrettyErbanNo ? 1 : 0));
|
||||
|
||||
dest.writeTypedList(bannerInfos);
|
||||
@@ -89,8 +97,14 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
return TextUtils.isEmpty(nick) ? "" : nick;
|
||||
}
|
||||
|
||||
|
||||
public int getCpState() {
|
||||
return cpState;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为官方账号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isOfficial() {
|
||||
@@ -99,8 +113,8 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
|
||||
/**
|
||||
* 靓号变色
|
||||
* @param defColor
|
||||
* 非靓号颜色
|
||||
*
|
||||
* @param defColor 非靓号颜色
|
||||
*/
|
||||
public SpannableString getNick(int defColor) {
|
||||
if (TextUtils.isEmpty(nick))
|
||||
@@ -116,7 +130,7 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
spannableString.setSpan(colorSpan, 0, nick.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
|
||||
return spannableString;
|
||||
return spannableString;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,7 +152,7 @@ public class SearchRoomInfo extends RoomInfo implements Parcelable, MultiItemEnt
|
||||
|
||||
@Override
|
||||
public int getItemType() {
|
||||
return ListUtils.isListEmpty(bannerInfos)?NORMAL:BANNER;
|
||||
return ListUtils.isListEmpty(bannerInfos) ? NORMAL : BANNER;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -100,6 +100,10 @@ public class UserInfo implements Serializable {
|
||||
@Getter
|
||||
@Setter
|
||||
private List<String> absCardPics;
|
||||
//cpState
|
||||
@Getter
|
||||
@Setter
|
||||
private int cpState;
|
||||
@Getter
|
||||
@Setter
|
||||
private int registerDay;
|
||||
|