From a1ce3797e3da2590872b32ca2ab4864e1869ddf8 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 18 Oct 2020 09:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/widget/image/CoverImageView.kt | 6 +++++- app/src/main/res/layout/item_bookshelf_grid.xml | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt index f2b4373a4..52b0517c2 100644 --- a/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/image/CoverImageView.kt @@ -16,7 +16,10 @@ import io.legado.app.constant.PreferKey import io.legado.app.help.ImageLoader import io.legado.app.utils.getPrefString - +/** + * 封面 + */ +@Suppress("unused") class CoverImageView : androidx.appcompat.widget.AppCompatImageView { internal var width: Float = 0.toFloat() internal var height: Float = 0.toFloat() @@ -171,6 +174,7 @@ class CoverImageView : androidx.appcompat.widget.AppCompatImageView { upDefaultCover() } + @SuppressLint("UseCompatLoadingForDrawables") fun upDefaultCover() { val path = App.INSTANCE.getPrefString(PreferKey.defaultCover) var dw = Drawable.createFromPath(path) diff --git a/app/src/main/res/layout/item_bookshelf_grid.xml b/app/src/main/res/layout/item_bookshelf_grid.xml index 618dc8c1f..0816a9a83 100644 --- a/app/src/main/res/layout/item_bookshelf_grid.xml +++ b/app/src/main/res/layout/item_bookshelf_grid.xml @@ -52,13 +52,11 @@ android:id="@+id/tv_name" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="8dp" + android:layout_marginTop="6dp" android:ellipsize="end" android:gravity="top|center_horizontal" android:includeFontPadding="false" android:lines="2" - android:paddingLeft="4dp" - android:paddingRight="4dp" android:text="@string/book_name" android:textColor="@color/primaryText" android:textSize="12sp"