Skip to content

Commit

Permalink
#86 fix : 맛집리스트 보기에서 주소,이름 길어질 경우 생략
Browse files Browse the repository at this point in the history
Co-authored-by: plashdof <[email protected]>
Co-authored-by: BENDENG1 <[email protected]>
  • Loading branch information
3 people committed Dec 11, 2023
1 parent aad94fc commit 17510bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,8 @@ fun bindFilterType(tv: TextView, type: String) = with(tv) {
else -> ""
}
}

@BindingAdapter("adjustText")
fun bindLongText(tv: TextView, value: String) {
tv.text = if (value.length > 27) "${value.substring(0, 27)}.." else value
}
4 changes: 2 additions & 2 deletions Aos/app/src/main/res/layout/item_my_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
style="@style/TextSmallBold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{item.name}"
app:adjustText="@{item.name}"
app:layout_constraintStart_toStartOf="@id/gl_start"
app:layout_constraintTop_toTopOf="@id/gl_top" />

Expand All @@ -57,8 +57,8 @@
style="@style/CaptionRegular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{item.address}"
android:textColor="@color/nn_primary5"
app:adjustText="@{item.address}"
app:layout_constraintBottom_toBottomOf="@id/gl_bottom"
app:layout_constraintStart_toStartOf="@id/gl_start"
app:layout_constraintTop_toTopOf="@id/gl_top" />
Expand Down
4 changes: 2 additions & 2 deletions Aos/app/src/main/res/layout/item_wish_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@{item.name}"
app:adjustText="@{item.name}"
app:layout_constraintStart_toEndOf="@id/iv_star"
app:layout_constraintTop_toTopOf="@id/gl_top" />

Expand All @@ -69,8 +69,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@{item.address}"
android:textColor="@color/nn_primary5"
app:adjustText="@{item.address}"
app:layout_constraintBottom_toBottomOf="@id/gl_bottom"
app:layout_constraintStart_toEndOf="@id/iv_star" />

Expand Down

0 comments on commit 17510bd

Please sign in to comment.