From 8762cd3696e6849eca5242d7106f55140a898343 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 24 Aug 2019 10:15:12 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/widget/page/ContentView.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 bd80e8136..e0804359b 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 @@ -18,17 +18,20 @@ import java.util.* class ContentView : FrameLayout { - private val bgImage: AppCompatImageView by lazy { - val iv = AppCompatImageView(context) - iv.scaleType = ImageView.ScaleType.CENTER_CROP - iv - } + private val bgImage: AppCompatImageView = AppCompatImageView(context) + .apply { + scaleType = ImageView.ScaleType.CENTER_CROP + } constructor(context: Context) : super(context) constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super( + context, + attrs, + defStyleAttr + ) init { addView(bgImage, LayoutParams(matchParent, matchParent))