Skip to content

Commit

Permalink
add space between content and images
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff committed Sep 22, 2023
1 parent ee65bd2 commit 6f2430c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ class ForumFragment : BaseFragment() {
holder.binding.previewImage2.visibility = View.GONE
holder.binding.previewImage3.visibility = View.GONE
}
holder.binding.imageSpace.isGone = noImage || !state.expanded
holder.binding.expandBtn.apply {
isVisible = thread.isTop
setImageResource(if (state.expanded) R.drawable.ic_up else R.drawable.ic_down)
Expand All @@ -414,6 +415,7 @@ class ForumFragment : BaseFragment() {
if (!noImage && state.expanded) if (image2 != null) View.VISIBLE else View.INVISIBLE else View.GONE
holder.binding.previewImage3.visibility =
if (!noImage && state.expanded) if (image3 != null) View.VISIBLE else View.INVISIBLE else View.GONE
holder.binding.imageSpace.isGone = noImage || !state.expanded
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/res/layout/fragment_forum_thread_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
android:id="@+id/expand_btn"
android:src="@drawable/ic_down"
android:background="@android:color/transparent"
app:layout_constraintStart_toEndOf="@id/thread_title"
app:layout_constraintTop_toTopOf="@id/thread_title"
app:layout_constraintBottom_toBottomOf="@id/thread_title"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -78,10 +79,18 @@
android:maxLines="3"
android:ellipsize="end"
app:layout_goneMarginTop="16dp"
app:layout_constraintBottom_toTopOf="@id/image_barrier"
app:layout_constraintBottom_toTopOf="@id/image_space"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/thread_title" />

<androidx.legacy.widget.Space
android:layout_height="4dp"
android:layout_width="match_parent"
android:id="@+id/image_space"
app:layout_constraintTop_toBottomOf="@id/thread_content"
app:layout_constraintBottom_toTopOf="@id/image_barrier"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/image_barrier"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 6f2430c

Please sign in to comment.