登录svga,资源位找大神优化
This commit is contained in:
BIN
app/src/main/assets/svga/login.svga
Normal file
BIN
app/src/main/assets/svga/login.svga
Normal file
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
package com.nnbc123.app.home.fragment
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
@@ -27,6 +28,7 @@ import com.nnbc123.app.home.dialog.RecommendRoomDialog
|
||||
import com.nnbc123.app.home.helper.BannerHelper
|
||||
import com.nnbc123.app.ui.im.avtivity.NimP2PMessageActivity
|
||||
import com.nnbc123.app.ui.utils.RVDelegate
|
||||
import com.nnbc123.app.ui.utils.load
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity
|
||||
import com.nnbc123.app.ui.widget.NewFriendsFilterWindow
|
||||
import com.nnbc123.app.ui.widget.magicindicator.ViewPagerHelper
|
||||
@@ -62,7 +64,7 @@ class RecommendFragment : BaseFragment(),
|
||||
private var currGender: Int? = null
|
||||
|
||||
//仅埋点使用,不影响业务逻辑
|
||||
private val abcArray = arrayOf("A", "B", "C")
|
||||
private val abcArray = arrayOf("A", "B", "C", "D")
|
||||
private var currMatchClick = abcArray[0]
|
||||
|
||||
companion object {
|
||||
@@ -89,6 +91,7 @@ class RecommendFragment : BaseFragment(),
|
||||
homeViewModel.getServiceGiftRecord()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun initiate() {
|
||||
initRefreshView()
|
||||
initTitleTab()
|
||||
@@ -113,19 +116,22 @@ class RecommendFragment : BaseFragment(),
|
||||
}
|
||||
}
|
||||
homeViewModel.resourceLiveData.observe(this) {
|
||||
if (it.isNullOrEmpty() || it.size != 3) {
|
||||
if (it.isNullOrEmpty() || it.size != 4) {
|
||||
mBinding.llResource.isGone = true
|
||||
return@observe
|
||||
}
|
||||
it.add(0, it.removeAt(1))
|
||||
mBinding.llResource.isGone = false
|
||||
val resourceViews = arrayOf(
|
||||
mBinding.ivResource0,
|
||||
mBinding.ivResource1,
|
||||
mBinding.ivResource2
|
||||
mBinding.ivResource2,
|
||||
mBinding.ivResource3
|
||||
)
|
||||
|
||||
for (i in resourceViews.indices) {
|
||||
resourceViews[i].load(it[i].icon)
|
||||
if (it[i].resourceType == 8) {
|
||||
mBinding.tvOnlineNum.text = "${it[i].resourceContent}人组队中"
|
||||
}
|
||||
resourceViews[i].setOnClickListener { _ ->
|
||||
currMatchClick = abcArray[i]
|
||||
StatisticManager.Instance().onEvent(
|
||||
@@ -133,15 +139,22 @@ class RecommendFragment : BaseFragment(),
|
||||
"资源位点击",
|
||||
mapOf("user_id" to AuthModel.get().currentUid.toString())
|
||||
)
|
||||
if (it[i].resourceType == 5) {
|
||||
when {
|
||||
it[i].resourceType == 5 -> {
|
||||
CommonWebViewActivity.start(context, it[i].resourceContent)
|
||||
} else {
|
||||
}
|
||||
i == 3 -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getHomeChatPick()
|
||||
}
|
||||
else -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getResourceJumpInfo(it[i].id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
homeViewModel.resourceJumpLiveData.observe(this) {
|
||||
dialogManager.dismissDialog()
|
||||
@@ -159,10 +172,6 @@ class RecommendFragment : BaseFragment(),
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.ivResource3.setOnClickListener {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getHomeChatPick()
|
||||
}
|
||||
homeViewModel.homeChatPickLiveData.observe(viewLifecycleOwner) {
|
||||
dialogManager.dismissDialog()
|
||||
it?.let {
|
||||
|
@@ -131,6 +131,7 @@
|
||||
android:text="忘记密码?"
|
||||
android:textColor="@color/text_secondary_878b9c"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/ll_password"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_password" />
|
||||
|
||||
|
@@ -153,17 +153,18 @@
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_online_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:drawableStart="@drawable/shape_circle_82fbff_small"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="999人组队中"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_resource_3"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_resource_3" />
|
||||
app:layout_constraintStart_toStartOf="@id/iv_resource_3"
|
||||
tools:text="999人组队中" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
@@ -180,8 +181,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="21dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:src="@drawable/ic_home_hot"
|
||||
/>
|
||||
android:src="@drawable/ic_home_hot" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_gift_service"
|
||||
|
@@ -6,16 +6,20 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
|
||||
<ImageView
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_logo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/bg_login_top"
|
||||
app:autoPlay="true"
|
||||
app:fillMode="Forward"
|
||||
app:layout_constraintDimensionRatio="750:726"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:loopCount="1"
|
||||
app:source="svga/login.svga" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_top_guile_line"
|
||||
|
Reference in New Issue
Block a user