From f5415575c1049bff62b264ec9cfdf17ad79766b6 Mon Sep 17 00:00:00 2001 From: Administrator <1760316362@qq.com> Date: Tue, 20 Aug 2019 18:45:22 +0800 Subject: [PATCH] update pageview --- .../java/io/legado/app/ui/widget/page/ContentView.kt | 10 +++++++++- 1 file changed, 9 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 8692a7b12..b555c93c1 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 @@ -1,6 +1,7 @@ package io.legado.app.ui.widget.page import android.content.Context +import android.graphics.drawable.Drawable import android.util.AttributeSet import android.widget.FrameLayout import androidx.appcompat.widget.AppCompatImageView @@ -30,11 +31,18 @@ class ContentView : FrameLayout { fun upStyle() { page_panel.horizontalPadding = 16.dp - ImageLoader.load(context, R.drawable.bg1) + } + + fun setBg(bg: Drawable?) { + ImageLoader.load(context, bg) .centerCrop() .setAsDrawable(bgImage) } + fun setBgColor(color: Int) { + page_panel.setBackgroundColor(color) + } + fun upTime() { }