1.关系系统Model ViewModel 2.关系任务界面,名牌定制弹窗
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package com.yizhuan.erban.relation.cp.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.view.View
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogCpMpBinding
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.yizhuan.xchat_android_library.utils.TextWatcherWrapper
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_cp_mp)
|
||||
class CpMpDialog(context: Context, private val type: Int) :
|
||||
BaseBindingDialog<DialogCpMpBinding>(context),
|
||||
View.OnClickListener {
|
||||
//type:0 申请 1 定制
|
||||
override fun init() {
|
||||
binding.pageType = type
|
||||
binding.click = this
|
||||
// binding.data = ?
|
||||
binding.editCpMpCustomized.addTextChangedListener(textWatcher)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.btn_require_current -> {
|
||||
//申请名牌
|
||||
}
|
||||
R.id.btn_require_next -> {
|
||||
//申请名牌
|
||||
}
|
||||
R.id.iv_cp_mp_customized -> {
|
||||
//定制名牌
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
binding.editCpMpCustomized.removeTextChangedListener(textWatcher)
|
||||
}
|
||||
|
||||
private val textWatcher = object : TextWatcherWrapper() {
|
||||
private var hasEnabled = false
|
||||
override fun afterTextChanged(editable: Editable?) {
|
||||
super.afterTextChanged(editable)
|
||||
if (editable?.length ?: 0 > 0) {
|
||||
if (!hasEnabled) {
|
||||
binding.customizeEnable = true
|
||||
hasEnabled = true
|
||||
}
|
||||
} else {
|
||||
binding.customizeEnable = false
|
||||
hasEnabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
93
app/src/main/java/com/yizhuan/erban/relation/cp/model/Api.kt
Normal file
93
app/src/main/java/com/yizhuan/erban/relation/cp/model/Api.kt
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.yizhuan.erban.relation.cp.model
|
||||
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult
|
||||
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 retrofit2.http.*
|
||||
|
||||
interface Api {
|
||||
|
||||
/**
|
||||
* 获取组CP邀请弹窗页面所需信息
|
||||
*
|
||||
* @param acceptUid (query) 被邀请用户uid
|
||||
*/
|
||||
@GET("/user/couple/cpInvitePage")
|
||||
fun getCpInvitePageData(
|
||||
@Query("acceptUid") acceptUid: Int
|
||||
): ServiceResult<CpInvitePageEntity>
|
||||
|
||||
/**
|
||||
* cp铭牌申请
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/user/couple/cpMpApply")
|
||||
fun cpMpApply(
|
||||
@Field("mpId") mpId: Int,
|
||||
@Field("mpTxt") mpTxt: String
|
||||
): ServiceResult<Any>//无需关心返回值
|
||||
|
||||
/**
|
||||
*cp铭牌申请记录
|
||||
*/
|
||||
@GET("/user/couple/cpMpApplyList")
|
||||
fun getCpMpApplyList(
|
||||
@Query("pageNumber") pageNumber: Int,
|
||||
@Query("pageSize") pageSize: Int
|
||||
): ServiceResult<List<CpMpApplyListEntity>>
|
||||
|
||||
|
||||
/**
|
||||
* 发起组CP邀请
|
||||
* @param acceptUid
|
||||
* @param declaration
|
||||
* @param propsId
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/user/couple/makeCpInvite")
|
||||
fun makeCpInvite(
|
||||
@Field("acceptUid") acceptUid: Int,
|
||||
@Field("declaration") declaration: String,
|
||||
@Field("propsId") propsId: Int
|
||||
): ServiceResult<Any>
|
||||
|
||||
/**
|
||||
* 回复CP邀请
|
||||
* @param state 组CP邀请同意或拒绝:2-同意,3-拒绝
|
||||
* @param id 组cp邀请记录id
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/user/couple/replyCpInvite")
|
||||
fun replyCpInvite(
|
||||
@Field("id") id: Int, @Query("state") state: Int
|
||||
): ServiceResult<Any>
|
||||
|
||||
/**
|
||||
* 撤销解除绑定
|
||||
*/
|
||||
@POST("/user/couple/revertUnboundCp")
|
||||
fun revertUnboundCp(): ServiceResult<Any>
|
||||
|
||||
/**
|
||||
*解除绑定CP关系
|
||||
*/
|
||||
@POST("/user/couple/unboundCp")
|
||||
fun unboundCp(): ServiceResult<Any>
|
||||
|
||||
/**
|
||||
*用户CP等级可申请铭牌
|
||||
*/
|
||||
@GET("/user/couple/userCpLevelMp")
|
||||
fun userCpLevelMp(): ServiceResult<UserCpLevelMpRootEntity>
|
||||
|
||||
/**
|
||||
*个人CP邀请列表
|
||||
* @param type 1-别人给我发的邀请,2-我给别人发的邀请
|
||||
*/
|
||||
@GET("/user/couple/userCpList")
|
||||
fun userCpList(
|
||||
@Query("type") type: Int
|
||||
): ServiceResult<List<UserCpListEntity>>
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
package com.yizhuan.erban.relation.cp.model
|
||||
|
||||
import com.yizhuan.xchat_android_core.base.BaseModel
|
||||
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.utils.net.launchRequest
|
||||
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? =
|
||||
launchRequest {
|
||||
api.getCpInvitePageData(acceptUid)
|
||||
}
|
||||
|
||||
suspend fun cpMpApply(mpId: Int, mpText: String): Any? =
|
||||
launchRequest {
|
||||
api.cpMpApply(mpId, mpText)
|
||||
}
|
||||
|
||||
suspend fun cpMpApplyList(pageNumber: Int, pageSize: Int): List<CpMpApplyListEntity>? =
|
||||
launchRequest {
|
||||
api.getCpMpApplyList(pageNumber, pageSize)
|
||||
}
|
||||
|
||||
suspend fun makeCpInvite(acceptUid: Int, declaration: String, propsId: Int): Any? =
|
||||
launchRequest {
|
||||
api.makeCpInvite(acceptUid, declaration, propsId)
|
||||
}
|
||||
|
||||
suspend fun replyCpInvite(id: Int, state: Int): Any? =
|
||||
launchRequest {
|
||||
api.replyCpInvite(id, state)
|
||||
}
|
||||
|
||||
suspend fun revertUnboundCp(): Any? =
|
||||
launchRequest {
|
||||
api.revertUnboundCp()
|
||||
}
|
||||
|
||||
suspend fun unboundCp(): Any? =
|
||||
launchRequest {
|
||||
api.unboundCp()
|
||||
}
|
||||
|
||||
suspend fun userCpLevelMp(): UserCpLevelMpRootEntity? =
|
||||
launchRequest {
|
||||
api.userCpLevelMp()
|
||||
}
|
||||
|
||||
suspend fun userCpList(type: Int): List<UserCpListEntity>? =
|
||||
launchRequest {
|
||||
api.userCpList(type)
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
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.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.utils.toast
|
||||
|
||||
class CpViewModel : BaseViewModel() {
|
||||
|
||||
private val _loadingLiveData = MutableLiveData<Boolean>()
|
||||
val loadingLiveData: LiveData<Boolean> = _loadingLiveData
|
||||
|
||||
//发起邀请组队CP弹窗数据
|
||||
private val _cpInvitePageData = MutableLiveData<CpInvitePageEntity>()
|
||||
val cpInvitePageData = _cpInvitePageData
|
||||
|
||||
//cp铭牌申请记录
|
||||
private val _cpMpApplyListData = MutableLiveData<List<CpMpApplyListEntity>>()
|
||||
val cpMpApplyListData = _cpMpApplyListData
|
||||
|
||||
//用户CP等级可申请铭牌
|
||||
private val _userCpLevelMpData = MutableLiveData<UserCpLevelMpRootEntity>()
|
||||
val userCpLevelMpData = _userCpLevelMpData
|
||||
|
||||
//个人CP邀请列表
|
||||
private val _userCpListData = MutableLiveData<List<UserCpListEntity>>()
|
||||
val userCpListData = _userCpListData
|
||||
|
||||
fun getCpInvitePageData(userCpList: Int) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.getCpInvitePageData(userCpList)?.let {
|
||||
cpInvitePageData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun getCpMpApplyListData(pageNumber: Int, pageSize: Int) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.cpMpApplyList(pageNumber, pageSize)?.let {
|
||||
_cpMpApplyListData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun getUserCpLevelMpData(type: Int) {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.userCpList(type)?.let {
|
||||
userCpListData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun getUserCpListData() {
|
||||
_loadingLiveData.value = true
|
||||
safeLaunch(
|
||||
onError = dealCpDataError(),
|
||||
block = {
|
||||
CpModel.userCpLevelMp()?.let {
|
||||
_userCpLevelMpData.value = it
|
||||
}
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun dealCpDataError():
|
||||
(e: Throwable) -> Unit = {
|
||||
it.message.toast()
|
||||
_loadingLiveData.value = false
|
||||
}
|
||||
}
|
BIN
app/src/main/res/drawable-xhdpi/ic_cp_apply_enable.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_cp_apply_enable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_cp_apply_unable.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_cp_apply_unable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
@@ -1,9 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#DEBEFF"
|
||||
android:startColor="#9E8CFF" />
|
||||
<corners android:radius="14dp" />
|
||||
</shape>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_enabled="true">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#DEBEFF" android:startColor="#9E8CFF" />
|
||||
<corners android:radius="14dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_enabled="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#D2D5D7" />
|
||||
<corners android:radius="14dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
11
app/src/main/res/drawable/bg_cp_level_label.xml
Normal file
11
app/src/main/res/drawable/bg_cp_level_label.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_2"
|
||||
android:bottomRightRadius="@dimen/dp_8"
|
||||
android:topLeftRadius="@dimen/dp_8"
|
||||
android:topRightRadius="@dimen/dp_2" />
|
||||
<solid android:color="@color/white_transparent_60" />
|
||||
|
||||
</shape>
|
7
app/src/main/res/drawable/bg_cp_mp_card.xml
Normal file
7
app/src/main/res/drawable/bg_cp_mp_card.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?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_8" />
|
||||
<solid android:color="#54B8BCFF" />
|
||||
|
||||
</shape>
|
27
app/src/main/res/drawable/bg_cp_pink_selector.xml
Normal file
27
app/src/main/res/drawable/bg_cp_pink_selector.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
|
||||
<item android:state_enabled="true">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#FFAFC3" android:startColor="#FF696F" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_enabled="false">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:centerColor="#ffc8c2e5" android:endColor="#ffd2c2e2" android:startColor="#ffbdc3e9" android:type="linear" android:useLevel="true" />
|
||||
<corners android:radius="4dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#FFAFC3" android:startColor="#FF696F" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
||||
</selector>
|
10
app/src/main/res/drawable/bg_cp_task_pager.xml
Normal file
10
app/src/main/res/drawable/bg_cp_task_pager.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#8579FB" />
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/dp_8"
|
||||
android:bottomRightRadius="8dp"
|
||||
android:topLeftRadius="0dp"
|
||||
android:topRightRadius="0dp" />
|
||||
</shape>
|
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#FFAFC3"
|
||||
android:startColor="#FF696F" />
|
||||
<corners android:radius="@dimen/dp_4" />
|
||||
|
||||
</shape>
|
26
app/src/main/res/drawable/selector_cp_task_label.xml
Normal file
26
app/src/main/res/drawable/selector_cp_task_label.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#8579FB" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" android:topLeftRadius="@dimen/dp_8" android:topRightRadius="@dimen/dp_8" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_selected="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#CAC7FF" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" android:topLeftRadius="@dimen/dp_8" android:topRightRadius="@dimen/dp_8" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#8579FB" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" android:topLeftRadius="@dimen/dp_8" android:topRightRadius="@dimen/dp_8" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
||||
</selector>
|
55
app/src/main/res/layout/activity_cp_task.xml
Normal file
55
app/src/main/res/layout/activity_cp_task.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="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" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
android:background="#A4A4FF"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_15"
|
||||
android:paddingBottom="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:paddingBottom="@dimen/dp_12"
|
||||
android:layout_height="176dp"
|
||||
android:background="@drawable/bg_cp_task_pager"
|
||||
app:layout_constraintTop_toBottomOf="@id/indicator" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
181
app/src/main/res/layout/dialog_cp_mp.xml
Normal file
181
app/src/main/res/layout/dialog_cp_mp.xml
Normal file
@@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<!--0 申请 1 定制-->
|
||||
<variable
|
||||
name="pageType"
|
||||
type="Integer" />
|
||||
|
||||
<import type="com.yizhuan.erban.R" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="customize_enable"
|
||||
type="Boolean" />
|
||||
|
||||
<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"
|
||||
android:layout_width="316dp"
|
||||
android:layout_height="188dp"
|
||||
android:background="@{pageType==0?R.mipmap.bg_cp_mp_card_apply:R.mipmap.bg_cp_mp_card_customized}"
|
||||
android:paddingLeft="@dimen/dp_15"
|
||||
android:paddingRight="@dimen/dp_15">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_mp_current"
|
||||
android:layout_width="137dp"
|
||||
android:layout_height="86dp"
|
||||
android:layout_marginTop="@dimen/dp_45"
|
||||
android:background="@drawable/bg_cp_mp_card"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/layout_mp_next"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_level_current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_cp_level_label"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:textColor="#9372FF"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintDimensionRatio="h,54:16"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="CP Lv.1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cp_level_current"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:layout_marginRight="@dimen/dp_23"
|
||||
app:layout_constraintDimensionRatio="98:30"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/layout_mp_next"
|
||||
android:layout_width="137dp"
|
||||
android:layout_height="86dp"
|
||||
android:layout_marginTop="@dimen/dp_45"
|
||||
android:background="@drawable/bg_cp_mp_card"
|
||||
app:layout_constraintLeft_toRightOf="@id/layout_mp_current"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_level_next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_cp_level_label"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:textColor="#9372FF"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintDimensionRatio="h,54:16"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="CP Lv.1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cp_level_next"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:layout_marginRight="@dimen/dp_23"
|
||||
app:layout_constraintDimensionRatio="98:30"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_require_current"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
app:layout_constraintLeft_toLeftOf="@id/layout_mp_current"
|
||||
app:layout_constraintRight_toRightOf="@id/layout_mp_current"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_mp_current" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_require_next"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
app:layout_constraintLeft_toLeftOf="@id/layout_mp_next"
|
||||
app:layout_constraintRight_toRightOf="@id/layout_mp_next"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_mp_next" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_cp_mp_customized"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="@dimen/dp_12"
|
||||
android:layout_marginRight="@dimen/dp_12"
|
||||
android:background="#AB96FF"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="h,276:24"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cp_mp_customized"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:text="铭牌文字:"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toTopOf="@id/edit_cp_mp_customized"
|
||||
app:layout_constraintLeft_toLeftOf="@id/edit_cp_mp_customized" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cp_mp_customized"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:onClick="@{click}"
|
||||
android:src="@{customize_enable?R.mipmap.ic_cp_mp_customized_enable:R.mipmap.ic_cp_mp_customized_disable}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_apply"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="@{pageType==1?View.GONE:View.VISIBLE}"
|
||||
app:constraint_referenced_ids="layout_mp_current,layout_mp_next,btn_require_current,btn_require_next" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/group_customized"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="@{pageType==0?View.GONE:View.VISIBLE}"
|
||||
app:constraint_referenced_ids="edit_cp_mp_customized,tv_cp_mp_customized,iv_cp_mp_customized" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
11
app/src/main/res/layout/fragment_cp_task.xml
Normal file
11
app/src/main/res/layout/fragment_cp_task.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="176dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/recycler_view"
|
||||
/>
|
||||
</FrameLayout>
|
69
app/src/main/res/layout/item_cp_task.xml
Normal file
69
app/src/main/res/layout/item_cp_task.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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:paddingLeft="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_12"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:paddingBottom="@dimen/dp_5">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_task_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="53dp"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tv_task_status"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_task_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:textColor="#FFE551"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tv_task_title"
|
||||
app:layout_constraintRight_toRightOf="@id/tv_task_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_task_title"
|
||||
tools:text="10钻=1亲密值,最多增加520亲密值" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_task_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_cp_pink_selector"
|
||||
android:enabled="false"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dp_14"
|
||||
android:paddingRight="@dimen/dp_14"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintDimensionRatio="64:24"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/task_done" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_task_completed"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:textColor="#C1BAFF"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tv_task_status"
|
||||
app:layout_constraintRight_toRightOf="@id/tv_task_status"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_task_status"
|
||||
tools:text="10/10" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
@@ -121,7 +121,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="26dp"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:background="@drawable/bg_ff696f_ffafc3_4"
|
||||
android:background="@drawable/bg_cp_pink_selector"
|
||||
android:paddingLeft="@dimen/dp_8"
|
||||
android:paddingRight="@dimen/dp_8"
|
||||
android:text="撤销解除关系"
|
||||
|
BIN
app/src/main/res/mipmap-xhdpi/bg_cp_mp_card_apply.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/bg_cp_mp_card_apply.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
BIN
app/src/main/res/mipmap-xhdpi/bg_cp_mp_card_customized.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/bg_cp_mp_card_customized.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_cp_mp_customized_disable.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/ic_cp_mp_customized_disable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_cp_mp_customized_enable.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/ic_cp_mp_customized_enable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
@@ -0,0 +1,21 @@
|
||||
package com.yizhuan.xchat_android_core.relation.cp
|
||||
|
||||
/**
|
||||
* 邀请CP弹窗信息
|
||||
*
|
||||
* /user/couple/cpInvitePage 获取组CP邀请弹窗页面所需信息
|
||||
*/
|
||||
data class CpInvitePageEntity(
|
||||
val acceptAvatar: String?,
|
||||
val acceptGender: Int,//1-男2-女
|
||||
val acceptNick: String,
|
||||
val acceptUid: Int,
|
||||
val inviteAvatar: String?,
|
||||
val inviteGender: Int,
|
||||
val inviteNick: String,
|
||||
val inviteUid: Int,
|
||||
val propsId: Int,
|
||||
val propsImg: String,
|
||||
val propsName: String,
|
||||
val propsPrice: String
|
||||
)
|
@@ -0,0 +1,16 @@
|
||||
package com.yizhuan.xchat_android_core.relation.cp
|
||||
|
||||
/**
|
||||
*
|
||||
* 铭牌申请记录
|
||||
*
|
||||
*/
|
||||
data class CpMpApplyListEntity(
|
||||
val applyTime: String?,
|
||||
val auditType: Int,//0、待审核,1、审核不通过,2、审核通过
|
||||
val iconPic: String,
|
||||
val mpId: Int,
|
||||
val mpName: String,
|
||||
val mpTxt: String,
|
||||
val noPassReason: String
|
||||
)
|
@@ -0,0 +1,13 @@
|
||||
package com.yizhuan.xchat_android_core.relation.cp
|
||||
|
||||
data class UserCpLevelMpRootEntity(
|
||||
val haveCp: Boolean,
|
||||
val mpDtoList: List<UserCpLevelMpEntity>
|
||||
)
|
||||
|
||||
data class UserCpLevelMpEntity(
|
||||
val iconPic: String,
|
||||
val isHave: Boolean,//是否已经申请过:true-是,false-否
|
||||
val mpId: Int,
|
||||
val mpName: String
|
||||
)
|
@@ -0,0 +1,23 @@
|
||||
package com.yizhuan.xchat_android_core.relation.cp
|
||||
|
||||
data class UserCpListEntity(
|
||||
val acceptUid: Int,
|
||||
val acceptUserAvatar: String?,
|
||||
val acceptUserNick: String,
|
||||
val acceptUserSex: Int,//1-男 2女
|
||||
val createTime: String,
|
||||
val declaration: String,//关系誓言
|
||||
val id: Int,//邀请记录id
|
||||
val inviteUid: Int,//邀请人uid
|
||||
val inviteUserAvatar: String?,//邀请方头像
|
||||
val inviteUserNick: String,
|
||||
val inviteUserSex: Int,
|
||||
val levelSeq: Int,//CP等级
|
||||
val propsId: Int,
|
||||
val propsImg: String,
|
||||
val propsName: String,
|
||||
val propsPrice: String,
|
||||
val state: Int,//状态:1-邀请中,2-CP中,3-拒绝,4-解绑中,5-解绑完成
|
||||
val unboundUid: Int,//解绑人
|
||||
val updateTime: String
|
||||
)
|
Reference in New Issue
Block a user