恢复 E-Ink 开关,调整主题 黑白、A 屏黑底栏颜色,书架列表去除动画

pull/241/head
Modificator 5 years ago
parent ebf499f27a
commit 92d6012e9f
  1. 2
      app/build.gradle
  2. 1
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  3. 4
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  4. 2
      app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt
  5. 3
      app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt
  6. 2
      app/src/main/res/layout/fragment_books.xml
  7. 8
      app/src/main/res/xml/pref_main.xml

@ -193,6 +193,8 @@ dependencies {
//
implementation 'com.hankcs:hanlp:portable-1.7.7'
//E-Ink
implementation 'fadeapp.widgets:scrollless-recyclerView:1.0.2'
}
apply plugin: 'com.google.gms.google-services'

@ -43,4 +43,5 @@ object PreferKey {
const val readStyleSelect = "readStyleSelect"
const val systemTypefaces = "system_typefaces"
const val readBodyToLh = "readBodyToLh"
const val einkMode = "isEInkMode"
}

@ -156,18 +156,20 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnShar
putPrefInt("colorPrimary", getCompatColor(R.color.white))
putPrefInt("colorAccent", getCompatColor(R.color.black))
putPrefInt("colorBackground", getCompatColor(R.color.white))
putPrefInt("colorBottomBackground", getCompatColor(R.color.white))
AppConfig.isNightTheme = false
}
4 -> {
putPrefInt("colorPrimaryNight", getCompatColor(R.color.black))
putPrefInt(
"colorAccentNight",
getCompatColor(R.color.md_grey_600)
getCompatColor(R.color.md_grey_500)
)
putPrefInt(
"colorBackgroundNight",
getCompatColor(R.color.black)
)
putPrefInt("colorBottomBackgroundNight", getCompatColor(R.color.black))
AppConfig.isNightTheme = true
}
}

@ -16,6 +16,7 @@ import io.legado.app.constant.BookType
import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey
import io.legado.app.data.entities.Book
import io.legado.app.help.AppConfig
import io.legado.app.help.IntentDataHelp
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
@ -76,6 +77,7 @@ class BooksFragment : BaseFragment(R.layout.fragment_books),
rv_bookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout + 2)
booksAdapter = BooksAdapterGrid(requireContext(), this)
}
rv_bookshelf.isEnableScroll = !AppConfig.isEInkMode
rv_bookshelf.adapter = booksAdapter
booksAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {

@ -121,6 +121,9 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog.
}
}
"recordLog" -> LogUtils.upLevel()
PreferKey.einkMode -> {
postEvent(EventBus.RECREATE, "")
}
}
}

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
<fadeapp.widgets.ScrollLessRecyclerView
android:id="@+id/rv_bookshelf"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -30,13 +30,13 @@
android:icon="@drawable/ic_cfg_theme"
app:iconSpaceReserved="false" />
<!-- <io.legado.app.ui.widget.prefs.SwitchPreference
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_cfg_e_lnk"
android:key="isEInkMode"
android:title="@string/eink_theme"
android:summary="@string/eink_theme_desc"
android:icon="@drawable/ic_cfg_e_lnk"
app:iconSpaceReserved="false" />-->
android:title="@string/eink_theme"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"

Loading…
Cancel
Save