feat:初步搭建房间banner-Web展示页面
This commit is contained in:
@@ -78,11 +78,11 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
|
||||
binding.rlyPermission.setOnClickListener(this)
|
||||
binding.rlyCheck.setOnClickListener(this)
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
// if (BuildConfig.DEBUG) {
|
||||
binding.titleBar.setOnTitleClickListener {
|
||||
debug()
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@@ -220,8 +220,9 @@ class SettingActivity : BaseViewBindingActivity<ActivitySettingBinding>(), View.
|
||||
// RedPackageOpenDialog2().show(this)
|
||||
// val json = "{\"first\":3,\"second\":32,\"data\":{\"recvUserUid\":2735,\"recvUserAvatar\":\"https://img.pekolive.com/default_avatar.png\",\"recvUserNick\":\"66丢丢丢丢丢多多多的hhhh\",\"sendUserNick\":\"11的ass\",\"sendUserAvatar\":\"http://beta.img.pekolive.com/Fk7aur-1RBqKXC-qqBwMTjivZ3lV?imageslim\",\"sendUserUid\":2737,\"giftUrl\":\"http://beta.img.pekolive.com/Fn6h_gPFD5MwA-Ql_kcWqNpKp0JM?imageslim\",\"giftName\":\"幽靈糖果\",\"giftId\":2075,\"giftNum\":${Random.nextInt(1,1000)},\"giftGolds\":33440,\"notifyStaySecond\":5,\"isHomeShow\":true,\"isSkipRoom\":true,\"isFullScreen\":false,\"isSendMsg\":false,\"roomUid\":2737,\"roomErbanNo\":11,\"roomTitle\":\"11的工会\",\"levelNum\":${Random.nextInt(1,4)}}}"
|
||||
// onReceivedNimBroadcastMessage(json)
|
||||
val json = "{\"first\":85,\"second\":855,\"data\":{\"nick\":\"66丢丢丢丢丢多多多的hhhh\",\"preVipName\":\"子爵\",\"floatPic\":\"https://image.hfighting.com/Fq3JtbK2acO3FN-3vWZo8ldtHfse\",\"uid\":2735,\"currVipName\":\"侯爵\",\"erbanNo\":66,\"roomUid\":2734,\"avatar\":\"https://img.pekolive.com/default_avatar.png\",\"currVipLevel\":5}}"
|
||||
onReceivedNimBroadcastMessage(json)
|
||||
// CommonWebViewActivity.start(this,"https://api.anan.chat/anan_vestBag/modules/myincome/index.html#/DiamondLog")
|
||||
// val json = "{\"first\":85,\"second\":855,\"data\":{\"nick\":\"66丢丢丢丢丢多多多的hhhh\",\"preVipName\":\"子爵\",\"floatPic\":\"https://image.hfighting.com/Fq3JtbK2acO3FN-3vWZo8ldtHfse\",\"uid\":2735,\"currVipName\":\"侯爵\",\"erbanNo\":66,\"roomUid\":2734,\"avatar\":\"https://img.pekolive.com/default_avatar.png\",\"currVipLevel\":5}}"
|
||||
// onReceivedNimBroadcastMessage(json)
|
||||
CommonWebViewActivity.start(this,"https://api.anan.chat/anan_vestBag/modules/rank/index.html#/rank")
|
||||
CommonWebViewActivity.start(this,"https://api.anan.chat/anan_vestBag/modules/myincome/index.html#/DiamondLog")
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package com.yizhuan.habu.ui.webview.room_banner
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.core.view.isVisible
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.habu.R
|
||||
import com.yizhuan.habu.ui.utils.load
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/17 12:30
|
||||
* Desc:
|
||||
**/
|
||||
class BannerTabAdapter :
|
||||
BaseQuickAdapter<BannerInfo, BaseViewHolder>(R.layout.room_banner_item_tab) {
|
||||
|
||||
private var selectedPosition = -1
|
||||
override fun convert(helper: BaseViewHolder, item: BannerInfo?) {
|
||||
helper.getView<ImageView>(R.id.iv_content).load(item?.bannerPic)
|
||||
convertState(helper, item)
|
||||
}
|
||||
|
||||
override fun convertPayloads(
|
||||
helper: BaseViewHolder,
|
||||
item: BannerInfo?,
|
||||
payloads: MutableList<Any>
|
||||
) {
|
||||
super.convertPayloads(helper, item, payloads)
|
||||
convertState(helper, item)
|
||||
}
|
||||
|
||||
private fun convertState(helper: BaseViewHolder, item: BannerInfo?) {
|
||||
helper.getView<View>(R.id.v_selector).isVisible =
|
||||
helper.absoluteAdapterPosition == selectedPosition
|
||||
}
|
||||
|
||||
fun select(position: Int) {
|
||||
this.selectedPosition = position
|
||||
notifyItemRangeChanged(0, itemCount, true)
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package com.yizhuan.habu.ui.webview.room_banner
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.yizhuan.habu.R
|
||||
import com.yizhuan.habu.ui.webview.CommonWebViewActivity
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/17 11:38
|
||||
* Desc:房间内-Banner-WEB展示页面
|
||||
**/
|
||||
class RoomBannerWebDialogActivity : CommonWebViewActivity() {
|
||||
|
||||
private var recyclerView: RecyclerView? = null
|
||||
private var adapter: BannerTabAdapter? = null
|
||||
|
||||
companion object {
|
||||
@JvmOverloads
|
||||
fun start(context: Context, url: String?, list: ArrayList<BannerInfo>) {
|
||||
val intent = Intent(context, RoomBannerWebDialogActivity::class.java)
|
||||
intent.putExtra("url", url)
|
||||
intent.putExtra("list", list)
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
recyclerView = findViewById(R.id.recyclerView)
|
||||
val list = intent.getSerializableExtra("list") as? ArrayList<BannerInfo>
|
||||
if ((list?.size ?: 0) <= 1) {
|
||||
recyclerView?.isVisible = false
|
||||
} else {
|
||||
adapter = BannerTabAdapter()
|
||||
recyclerView?.adapter = adapter
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.room_banner_dialog
|
||||
}
|
||||
}
|
118
app/src/main/res/layout/room_banner_dialog.xml
Normal file
118
app/src/main/res/layout/room_banner_dialog.xml
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/v_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_168" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardBackgroundColor="@color/color_262629"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/layout_title_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_left" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_close_black" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_share"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_share_white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:textColor="@color/text_normal_c6c6e9"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
tools:text="@string/layout_activity_dialog_web_view_01" />
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progress_drawable"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
25
app/src/main/res/layout/room_banner_item_tab.xml
Normal file
25
app/src/main/res/layout/room_banner_item_tab.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/v_selector"
|
||||
android:layout_width="@dimen/dp_94"
|
||||
android:layout_height="@dimen/dp_46"
|
||||
android:layout_gravity="center"
|
||||
android:background="@color/red_font"
|
||||
app:riv_corner_radius="8dp" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_content"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_corner_radius="4dp"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
</FrameLayout>
|
@@ -7,4 +7,5 @@
|
||||
<color name="color_FF9C7E">#FF9C7E</color>
|
||||
<color name="color_FE6974">#FE6974</color>
|
||||
<color name="color_45C21A">#45C21A</color>
|
||||
<color name="color_262629">#262629</color>
|
||||
</resources>
|
Reference in New Issue
Block a user