From a4d488d9c721e175c8c60e422857641955c1b580 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 17 Mar 2020 19:45:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/main/explore/ExploreAdapter.kt | 6 ++++++ app/src/main/res/layout/item_find_book.xml | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt index 0f9f3d729..faf9cef8a 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt @@ -12,6 +12,7 @@ import io.legado.app.data.entities.BookSource import io.legado.app.help.coroutine.Coroutine import io.legado.app.lib.theme.accentColor import io.legado.app.utils.ACache +import io.legado.app.utils.dp import io.legado.app.utils.gone import io.legado.app.utils.visible import kotlinx.android.synthetic.main.item_fillet_text.view.* @@ -28,6 +29,11 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList) { with(holder.itemView) { + if (holder.layoutPosition == getActualItemCount() - 1) { + setPadding(16.dp, 12.dp, 16.dp, 12.dp) + } else { + setPadding(16.dp, 12.dp, 16.dp, 0) + } if (payloads.isEmpty()) { tv_name.text = item.bookSourceName } diff --git a/app/src/main/res/layout/item_find_book.xml b/app/src/main/res/layout/item_find_book.xml index 900aa9eed..d689630d2 100644 --- a/app/src/main/res/layout/item_find_book.xml +++ b/app/src/main/res/layout/item_find_book.xml @@ -4,9 +4,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="15dp" - android:paddingLeft="16dp" - android:paddingRight="16dp" android:gravity="center" android:orientation="vertical"> @@ -36,7 +33,8 @@ android:layout_gravity="center" android:layout_marginRight="4dp" app:hide_mode="gone" - app:loading_width="1dp" /> + app:loading_width="1dp" + tools:ignore="RtlHardcoded" />