Commit 43602498 by 霍志良

feat:UI修改

parent e34dcd42
......@@ -4,6 +4,8 @@ import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.RecyclerView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
......@@ -37,9 +39,18 @@ class ConsultantTopAdapter(
if (consultList[position].specialTopicSubhead?.isNotEmpty() == true) {
holder.consult_tag.visibility = View.VISIBLE
holder.consult_tag.text = consultList[position].specialTopicSubhead
if (consultList[position].specialTopicSubhead?.toCharArray()?.size!! <= 2) {
val params = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
)
params.setMargins(46, 0, 0, 0)
holder.consult_tag.layoutParams = params
}
} else {
holder.consult_tag.visibility = View.GONE
}
GlideApp.with(context)
.load(consultList[position].topicImage)
.into(holder.consult_img)
......
......@@ -61,7 +61,8 @@
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:visibility="visible"></androidx.recyclerview.widget.RecyclerView>
android:paddingBottom="@dimen/platform_dp_17"
android:visibility="visible" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
......
......@@ -7,32 +7,41 @@
android:layout_marginStart="@dimen/platform_dp_25"
android:background="@color/white">
<ImageView
android:id="@+id/consult_img"
android:layout_width="44dp"
android:layout_height="44dp"
<FrameLayout
android:id="@+id/fl_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/consult_img"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginTop="@dimen/platform_dp_10" />
<TextView
android:id="@+id/consult_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginBottom="@dimen/platform_dp_40"
android:background="@drawable/consultant_bg_top_tag"
android:gravity="center"
android:includeFontPadding="false"
android:maxLength="5"
android:minWidth="@dimen/platform_dp_25"
android:paddingStart="@dimen/platform_dp_4"
android:paddingTop="@dimen/platform_dp_2"
android:paddingEnd="@dimen/platform_dp_4"
android:paddingBottom="@dimen/platform_dp_2"
android:textColor="@color/white"
android:textSize="9sp"
tools:text="dd" />
</FrameLayout>
<TextView
android:id="@+id/consult_tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginBottom="@dimen/platform_dp_40"
android:background="@drawable/consultant_bg_top_tag"
android:includeFontPadding="false"
android:paddingStart="@dimen/platform_dp_4"
android:paddingTop="@dimen/platform_dp_2"
android:paddingEnd="@dimen/platform_dp_4"
android:paddingBottom="@dimen/platform_dp_2"
android:textColor="@color/white"
android:textSize="9sp"
app:layout_constraintBottom_toBottomOf="@id/consult_img"
app:layout_constraintStart_toStartOf="@id/consult_img"
tools:text="99元专区" />
<TextView
android:id="@+id/consult_title"
......@@ -44,7 +53,7 @@
android:textSize="@dimen/platform_sp_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/consult_img"
app:layout_constraintTop_toBottomOf="@id/fl_img"
tools:text="新人专区">
</TextView>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment