feat:首页列表新增房间标签展示
This commit is contained in:
@@ -3,9 +3,12 @@ package com.chwl.app.home.adapter
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.ui.utils.ImageLoadUtils
|
||||
import com.chwl.app.ui.utils.ImageLoadUtilsV2
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.core.home.bean.HomeRoomInfo
|
||||
|
||||
@@ -45,5 +48,13 @@ class HomeHotAdapter :
|
||||
} else {
|
||||
topView.visibility = View.INVISIBLE
|
||||
}
|
||||
val tagPict = item.tagPict
|
||||
val tagView = helper.getView<ImageView>(R.id.iv_tag)
|
||||
if (tagPict.isNullOrEmpty()) {
|
||||
tagView.isVisible = false
|
||||
} else {
|
||||
ImageLoadUtils.loadImage(tagView, tagPict)
|
||||
tagView.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
@@ -124,6 +124,15 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:text="266" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/bg_like_pk" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_top"
|
||||
android:layout_width="match_parent"
|
||||
@@ -131,13 +140,4 @@
|
||||
app:layout_constraintDimensionRatio="345:92"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/bg_like_pk" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Reference in New Issue
Block a user