新增足迹页面
This commit is contained in:
@@ -1285,7 +1285,9 @@
|
||||
<activity
|
||||
android:name=".home.activity.VisitorListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".home.activity.RoomHistoryListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".skill.activity.SkillDetailActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
@@ -0,0 +1,96 @@
|
||||
package com.yizhuan.erban.home.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.base.TitleBar
|
||||
import com.yizhuan.erban.common.EmptyViewHelper
|
||||
import com.yizhuan.erban.databinding.ActivityRoomHistoryListBinding
|
||||
import com.yizhuan.erban.home.adapter.RoomHistoryListAdapter
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.bean.RoomHistoryInfo
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
|
||||
@ActLayoutRes(R.layout.activity_room_history_list)
|
||||
class RoomHistoryListActivity : BaseViewBindingActivity<ActivityRoomHistoryListBinding>() {
|
||||
|
||||
private lateinit var rvDelegate: RVDelegate<RoomHistoryInfo>
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, RoomHistoryListActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
initTitleBar("足迹")
|
||||
mTitleBar?.addAction(object : TitleBar.TextAction(
|
||||
"全部清除", Color.parseColor("#999999")
|
||||
) {
|
||||
override fun performAction(view: View) {
|
||||
dialogManager.showOkCancelDialog(
|
||||
"确定清空进房记录吗?", "清空", "手滑了"
|
||||
) { clearHistory() }
|
||||
}
|
||||
})
|
||||
rvDelegate = RVDelegate.Builder<RoomHistoryInfo>()
|
||||
.setRefreshLayout(binding.swipeRefresh)
|
||||
.setLayoutManager(LinearLayoutManager(this))
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.setAdapter(RoomHistoryListAdapter())
|
||||
.setEmptyView(EmptyViewHelper.createEmptyView(this, "暂无记录"))
|
||||
.build()
|
||||
|
||||
binding.swipeRefresh.setOnRefreshListener {
|
||||
loadData()
|
||||
}
|
||||
loadData()
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private fun clearHistory() {
|
||||
UserModel.get()
|
||||
.deleteInRoomRecord()
|
||||
.compose(bindToLifecycle())
|
||||
.flatMap { UserModel.get().updateCurrentUserInfo() }
|
||||
.subscribe({
|
||||
rvDelegate.setNewData(null)
|
||||
}, {
|
||||
SingleToastUtil.showToast("清空失败,请检查您的网络再试!")
|
||||
})
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private fun loadData() {
|
||||
UserModel.get()
|
||||
.inRoomRecord
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(
|
||||
{
|
||||
rvDelegate.loadData(it, true)
|
||||
},
|
||||
{
|
||||
rvDelegate.loadErr(true)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun needSteepStateBar() = true
|
||||
|
||||
override fun setStatusBar() {
|
||||
super.setStatusBar()
|
||||
StatusBarUtil.transparencyBar(this)
|
||||
StatusBarUtil.StatusBarLightMode(this)
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package com.yizhuan.erban.home.adapter
|
||||
|
||||
import android.widget.ImageView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||
import com.yizhuan.erban.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.bean.RoomHistoryInfo
|
||||
import com.yizhuan.xchat_android_library.utils.TimeUtils
|
||||
|
||||
|
||||
class RoomHistoryListAdapter :
|
||||
BaseQuickAdapter<RoomHistoryInfo, BaseViewHolder>(R.layout.item_room_history_list) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: RoomHistoryInfo) {
|
||||
helper.apply {
|
||||
getView<ImageView>(R.id.iv_room_image).load(item.avatar)
|
||||
setText(R.id.tv_room_title, item.title)
|
||||
setText(R.id.tv_id, "ID:${item.erbanNo}")
|
||||
setText(R.id.tv_room_title, item.title)
|
||||
setText(
|
||||
R.id.tv_time,
|
||||
TimeUtils.getDateTimeString(item.updateTime, TimeUtils.DATE_FORMAT)
|
||||
)
|
||||
itemView.setOnClickListener {
|
||||
AVRoomActivity.start(mContext, item.roomUid)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -21,6 +21,7 @@ import com.yizhuan.erban.base.BaseFragment
|
||||
import com.yizhuan.erban.databinding.FragmentMeBinding
|
||||
import com.yizhuan.erban.home.HomeViewModel
|
||||
import com.yizhuan.erban.home.MeViewModel
|
||||
import com.yizhuan.erban.home.activity.RoomHistoryListActivity
|
||||
import com.yizhuan.erban.home.activity.VisitorListActivity
|
||||
import com.yizhuan.erban.home.adapter.MeCenterAdapter
|
||||
import com.yizhuan.erban.home.adapter.MeGameAdapter
|
||||
@@ -384,8 +385,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
val id = v.id
|
||||
when (id) {
|
||||
when (v.id) {
|
||||
R.id.iv_user_head, R.id.rl_user_info ->
|
||||
mUserInfo?.let { UIHelper.showUserInfoAct(mContext, it.uid) }
|
||||
R.id.iv_edit ->
|
||||
@@ -416,6 +416,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
)
|
||||
R.id.tv_user_visitor -> VisitorListActivity.start(mContext)
|
||||
R.id.me_item_wallet -> ChargeActivity.start(mContext)
|
||||
R.id.tv_user_history -> RoomHistoryListActivity.start(mContext)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
8
app/src/main/res/drawable/shape_ffd15a_to_ffc000.xml
Normal file
8
app/src/main/res/drawable/shape_ffd15a_to_ffc000.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">
|
||||
<gradient
|
||||
android:endColor="#FFC000"
|
||||
android:startColor="#FFD15A" />
|
||||
<corners android:radius="30dp" />
|
||||
</shape>
|
27
app/src/main/res/layout/activity_room_history_list.xml
Normal file
27
app/src/main/res/layout/activity_room_history_list.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/color_f4f4fa"
|
||||
android:orientation="vertical">
|
||||
|
||||
<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_30" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipe_refresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="20dp" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
</LinearLayout>
|
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@@ -376,6 +376,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_history_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
@@ -479,10 +480,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textStyle="bold"
|
||||
android:text="贵族中心"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/sp_18" />
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -577,15 +578,29 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_setting_entrance"
|
||||
app:layout_constraintVertical_bias="0">
|
||||
|
||||
<TextView
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="快捷进房"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold" />
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<View
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:background="@drawable/shape_ffd15a_to_ffc000" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="快捷进房"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/view_pager_game"
|
||||
|
67
app/src/main/res/layout/item_room_history_list.xml
Normal file
67
app/src/main/res/layout/item_room_history_list.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_room_image"
|
||||
android:layout_width="39dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:src="@drawable/default_cover"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_corner_radius="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_room_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_id"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_room_image"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_room_image"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="余生点唱歌曲交友房间" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_room_image"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_room_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_room_title"
|
||||
tools:text="ID:1234" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_999999"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_room_title"
|
||||
tools:text="2020-07-18" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1px"
|
||||
android:background="#EAEAF1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -8,6 +8,8 @@ import lombok.Data;
|
||||
public class RoomHistoryInfo implements Serializable {
|
||||
private long roomUid;
|
||||
private long roomId;
|
||||
private long erbanNo;
|
||||
private long updateTime;
|
||||
private String title;
|
||||
private String avatar;
|
||||
private boolean valid;
|
||||
|
Reference in New Issue
Block a user