From 6acd9bd02570d92bb89e77cef4e1c2b659e9f74d Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 24 Aug 2019 08:38:22 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/widget/page/ContentView.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index c7b1480ce..dfa912836 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -4,6 +4,7 @@ import android.content.Context import android.graphics.drawable.Drawable import android.util.AttributeSet import android.widget.FrameLayout +import android.widget.ImageView import androidx.appcompat.widget.AppCompatImageView import io.legado.app.R import io.legado.app.constant.AppConst.TIME_FORMAT @@ -17,7 +18,11 @@ import java.util.* class ContentView : FrameLayout { - private val bgImage: AppCompatImageView = AppCompatImageView(context) + private val bgImage: AppCompatImageView by lazy { + val iv = AppCompatImageView(context) + iv.scaleType = ImageView.ScaleType.CENTER_CROP + iv + } constructor(context: Context) : super(context)