diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 64f30839c..e9681da2e 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -3,6 +3,9 @@ * 请关注公众号[开源阅读]()支持我,同时关注合作公众号[小说拾遗](),阅读公众号小编。 * 新公众号[开源阅读]()已启用,[开源阅读软件]()备用 +**2020/06/19** +* 修复eInk bug + **2020/06/18** * fadeapp.widgets:scrollless-recyclerView导致有些手机重影,暂时去除 * 下载界面添加分组 diff --git a/app/src/main/java/io/legado/app/constant/PreferKey.kt b/app/src/main/java/io/legado/app/constant/PreferKey.kt index e4d8eafae..e82154432 100644 --- a/app/src/main/java/io/legado/app/constant/PreferKey.kt +++ b/app/src/main/java/io/legado/app/constant/PreferKey.kt @@ -63,6 +63,5 @@ object PreferKey { const val cLBBackground = "lastColorBottomBackground" const val lastPageAnim = "lastPageAnim" - const val lastIsNight = "lastIsNightTheme" const val lastThemeMode = "lastThemeMode" } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 9288a1c76..1381e3838 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -26,25 +26,20 @@ object ReadBookConfig { val json = String(App.INSTANCE.assets.open(readConfigFileName).readBytes()) GSON.fromJsonArray(json)!! } - val durConfig get() = - if (AppConfig.isEInkMode) - einkConfig - else - getConfig(styleSelect) + val durConfig get() = getConfig(styleSelect) var bg: Drawable? = null var bgMeanColor: Int = 0 - private val einkConfig: Config + val textColor: Int + get() = + if (AppConfig.isEInkMode && !AppConfig.isNightTheme) { + Color.BLACK + } else { + durConfig.textColor() + } init { upConfig() - einkConfig = Config( - bgStr = "#FFFFFF", - bgStrNight = "#FFFFFF", - textColor = "#000000", - textColorNight = "#000000", - darkStatusIconNight = true - ) } @Synchronized @@ -83,11 +78,16 @@ object ReadBookConfig { val dm = resources.displayMetrics val width = dm.widthPixels val height = dm.heightPixels - bg = durConfig.bgDrawable(width, height).apply { - if (this is BitmapDrawable) { - bgMeanColor = BitmapUtils.getMeanColor(bitmap) - } else if (this is ColorDrawable) { - bgMeanColor = color + if (AppConfig.isEInkMode && !AppConfig.isNightTheme) { + bg = ColorDrawable(Color.WHITE) + bgMeanColor = Color.WHITE + } else { + bg = durConfig.bgDrawable(width, height).apply { + if (this is BitmapDrawable) { + bgMeanColor = BitmapUtils.getMeanColor(bitmap) + } else if (this is ColorDrawable) { + bgMeanColor = color + } } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index 15f3ac23c..5f52bd12f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -6,7 +6,6 @@ import android.text.Layout import android.text.StaticLayout import android.text.TextPaint import android.text.TextUtils -import com.hankcs.hanlp.HanLP import io.legado.app.App import io.legado.app.constant.PreferKey import io.legado.app.data.entities.BookChapter @@ -293,14 +292,14 @@ object ChapterProvider { //标题 titlePaint = TextPaint() - titlePaint.color = ReadBookConfig.durConfig.textColor() + titlePaint.color = ReadBookConfig.textColor titlePaint.letterSpacing = ReadBookConfig.letterSpacing titlePaint.typeface = titleFont titlePaint.textSize = with(ReadBookConfig) { textSize + titleSize }.sp.toFloat() titlePaint.isAntiAlias = true //正文 contentPaint = TextPaint() - contentPaint.color = ReadBookConfig.durConfig.textColor() + contentPaint.color = ReadBookConfig.textColor contentPaint.letterSpacing = ReadBookConfig.letterSpacing contentPaint.typeface = textFont contentPaint.textSize = ReadBookConfig.textSize.sp.toFloat() diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 62f240303..fb996cc29 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -144,7 +144,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at ) { val textPaint = if (isTitle) ChapterProvider.titlePaint else ChapterProvider.contentPaint textPaint.color = - if (isReadAloud) context.accentColor else ReadBookConfig.durConfig.textColor() + if (isReadAloud) context.accentColor else ReadBookConfig.textColor textChars.forEach { canvas.drawText(it.charData, it.start, lineBase, textPaint) if (it.selected) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 8cf679114..37a3acd77 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -7,10 +7,8 @@ import android.view.MotionEvent import android.widget.FrameLayout import androidx.core.view.isGone import androidx.core.view.isInvisible -import com.hankcs.hanlp.HanLP import io.legado.app.R import io.legado.app.constant.AppConst.timeFormat -import io.legado.app.help.AppConfig import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadTipConfig import io.legado.app.ui.book.read.page.entities.TextPage @@ -57,14 +55,14 @@ class ContentView(context: Context) : FrameLayout(context) { tv_footer_left.typeface = ChapterProvider.typeface tv_footer_middle.typeface = ChapterProvider.typeface tv_footer_right.typeface = ChapterProvider.typeface - bv_header_left.setColor(durConfig.textColor()) - tv_header_left.setColor(durConfig.textColor()) - tv_header_middle.setColor(durConfig.textColor()) - tv_header_right.setColor(durConfig.textColor()) - bv_footer_left.setColor(durConfig.textColor()) - tv_footer_left.setColor(durConfig.textColor()) - tv_footer_middle.setColor(durConfig.textColor()) - tv_footer_right.setColor(durConfig.textColor()) + bv_header_left.setColor(textColor) + tv_header_left.setColor(textColor) + tv_header_middle.setColor(textColor) + tv_header_right.setColor(textColor) + bv_footer_left.setColor(textColor) + tv_footer_left.setColor(textColor) + tv_footer_middle.setColor(textColor) + tv_footer_right.setColor(textColor) //显示状态栏时隐藏header vw_status_bar.setPadding(0, context.statusBarHeight, 0, 0) vw_status_bar.isGone = hideStatusBar diff --git a/app/src/main/res/layout/activity_import_book.xml b/app/src/main/res/layout/activity_import_book.xml index 38d0b4f55..7fb75bdb2 100644 --- a/app/src/main/res/layout/activity_import_book.xml +++ b/app/src/main/res/layout/activity_import_book.xml @@ -53,13 +53,19 @@ tools:ignore="UnusedAttribute" /> - + android:layout_weight="1" + app:layout_constraintTop_toBottomOf="@id/layTop" + app:layout_constraintBottom_toTopOf="@id/select_action_bar"> + + + +