mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
1afadc8d5a
commit
ca5f40704e
@ -36,6 +36,7 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
var clickActionBC = appCtx.getPrefInt(PreferKey.clickActionBC, 1)
|
var clickActionBC = appCtx.getPrefInt(PreferKey.clickActionBC, 1)
|
||||||
var clickActionBR = appCtx.getPrefInt(PreferKey.clickActionBR, 1)
|
var clickActionBR = appCtx.getPrefInt(PreferKey.clickActionBR, 1)
|
||||||
var themeMode = appCtx.getPrefString(PreferKey.themeMode, "0")
|
var themeMode = appCtx.getPrefString(PreferKey.themeMode, "0")
|
||||||
|
var useDefaultCover = appCtx.getPrefBoolean(PreferKey.useDefaultCover, false)
|
||||||
|
|
||||||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
||||||
when (key) {
|
when (key) {
|
||||||
@ -43,6 +44,7 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
themeMode = appCtx.getPrefString(PreferKey.themeMode, "0")
|
themeMode = appCtx.getPrefString(PreferKey.themeMode, "0")
|
||||||
isEInkMode = themeMode == "3"
|
isEInkMode = themeMode == "3"
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferKey.clickActionTL -> clickActionTL =
|
PreferKey.clickActionTL -> clickActionTL =
|
||||||
appCtx.getPrefInt(PreferKey.clickActionTL, 2)
|
appCtx.getPrefInt(PreferKey.clickActionTL, 2)
|
||||||
|
|
||||||
@ -80,6 +82,9 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
|
|
||||||
PreferKey.antiAlias -> useAntiAlias = appCtx.getPrefBoolean(PreferKey.antiAlias)
|
PreferKey.antiAlias -> useAntiAlias = appCtx.getPrefBoolean(PreferKey.antiAlias)
|
||||||
|
|
||||||
|
PreferKey.useDefaultCover -> useDefaultCover =
|
||||||
|
appCtx.getPrefBoolean(PreferKey.useDefaultCover, false)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,9 +137,6 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val useDefaultCover: Boolean
|
|
||||||
get() = appCtx.getPrefBoolean(PreferKey.useDefaultCover, false)
|
|
||||||
|
|
||||||
val isTransparentStatusBar: Boolean
|
val isTransparentStatusBar: Boolean
|
||||||
get() = appCtx.getPrefBoolean(PreferKey.transparentStatusBar, true)
|
get() = appCtx.getPrefBoolean(PreferKey.transparentStatusBar, true)
|
||||||
|
|
||||||
|
@ -79,7 +79,10 @@ class BooksAdapterList(
|
|||||||
|
|
||||||
private fun upLastUpdateTime(binding: ItemBookshelfListBinding, item: Book) {
|
private fun upLastUpdateTime(binding: ItemBookshelfListBinding, item: Book) {
|
||||||
if (AppConfig.showLastUpdateTime && !item.isLocal) {
|
if (AppConfig.showLastUpdateTime && !item.isLocal) {
|
||||||
binding.tvLastUpdateTime.text = item.latestChapterTime.toTimeAgo()
|
val time = item.latestChapterTime.toTimeAgo()
|
||||||
|
if (binding.tvLastUpdateTime.text != time) {
|
||||||
|
binding.tvLastUpdateTime.text = time
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
binding.tvLastUpdateTime.text = ""
|
binding.tvLastUpdateTime.text = ""
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
android:background="@drawable/bg_item_focused_on_tv"
|
android:background="@drawable/bg_item_focused_on_tv"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:scrollbars="none"
|
||||||
tools:ignore="UnusedAttribute">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<io.legado.app.ui.widget.image.CoverImageView
|
<io.legado.app.ui.widget.image.CoverImageView
|
||||||
@ -41,6 +42,7 @@
|
|||||||
android:layout_gravity="right"
|
android:layout_gravity="right"
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
|
android:scrollbars="none"
|
||||||
tools:ignore="RtlHardcoded" />
|
tools:ignore="RtlHardcoded" />
|
||||||
|
|
||||||
<io.legado.app.ui.widget.anima.RotateLoading
|
<io.legado.app.ui.widget.anima.RotateLoading
|
||||||
@ -62,6 +64,7 @@
|
|||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:paddingLeft="2dp"
|
android:paddingLeft="2dp"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="4dp"
|
||||||
|
android:scrollbars="none"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/book_name"
|
android:text="@string/book_name"
|
||||||
android:textColor="@color/primaryText"
|
android:textColor="@color/primaryText"
|
||||||
@ -79,6 +82,7 @@
|
|||||||
android:contentDescription="@string/author"
|
android:contentDescription="@string/author"
|
||||||
android:paddingStart="2dp"
|
android:paddingStart="2dp"
|
||||||
android:paddingEnd="2dp"
|
android:paddingEnd="2dp"
|
||||||
|
android:scrollbars="none"
|
||||||
android:src="@drawable/ic_author"
|
android:src="@drawable/ic_author"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_author"
|
app:layout_constraintBottom_toBottomOf="@+id/tv_author"
|
||||||
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
|
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
|
||||||
@ -93,6 +97,7 @@
|
|||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingEnd="6dp"
|
android:paddingEnd="6dp"
|
||||||
|
android:scrollbars="none"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/author"
|
android:text="@string/author"
|
||||||
android:textColor="@color/tv_text_summary"
|
android:textColor="@color/tv_text_summary"
|
||||||
@ -110,6 +115,7 @@
|
|||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingEnd="6dp"
|
android:paddingEnd="6dp"
|
||||||
|
android:scrollbars="none"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/tv_text_summary"
|
android:textColor="@color/tv_text_summary"
|
||||||
@ -128,6 +134,7 @@
|
|||||||
android:contentDescription="@string/read_dur_progress"
|
android:contentDescription="@string/read_dur_progress"
|
||||||
android:paddingStart="2dp"
|
android:paddingStart="2dp"
|
||||||
android:paddingEnd="2dp"
|
android:paddingEnd="2dp"
|
||||||
|
android:scrollbars="none"
|
||||||
android:src="@drawable/ic_history"
|
android:src="@drawable/ic_history"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_read"
|
app:layout_constraintBottom_toBottomOf="@+id/tv_read"
|
||||||
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
|
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
|
||||||
@ -140,6 +147,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
|
android:scrollbars="none"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/read_dur_progress"
|
android:text="@string/read_dur_progress"
|
||||||
android:textColor="@color/tv_text_summary"
|
android:textColor="@color/tv_text_summary"
|
||||||
@ -157,6 +165,7 @@
|
|||||||
android:contentDescription="@string/lasted_show"
|
android:contentDescription="@string/lasted_show"
|
||||||
android:paddingStart="2dp"
|
android:paddingStart="2dp"
|
||||||
android:paddingEnd="2dp"
|
android:paddingEnd="2dp"
|
||||||
|
android:scrollbars="none"
|
||||||
android:src="@drawable/ic_book_last"
|
android:src="@drawable/ic_book_last"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_last"
|
app:layout_constraintBottom_toBottomOf="@+id/tv_last"
|
||||||
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
|
app:layout_constraintLeft_toLeftOf="@+id/tv_name"
|
||||||
@ -169,6 +178,7 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
android:scrollbars="none"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@string/lasted_show"
|
android:text="@string/lasted_show"
|
||||||
android:textColor="@color/tv_text_summary"
|
android:textColor="@color/tv_text_summary"
|
||||||
@ -184,6 +194,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:scrollbars="none"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.0"
|
app:layout_constraintVertical_bias="0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user