feat: fadeapp.widgets:scrollless-recyclerView导致有些手机重影,暂时去除

pull/248/head
gedoor 5 years ago
parent 5aeecdc801
commit df09bf25b4
  1. 4
      app/build.gradle
  2. 4
      app/src/main/java/io/legado/app/ui/about/AboutFragment.kt
  3. 4
      app/src/main/java/io/legado/app/ui/about/DonateFragment.kt
  4. 2
      app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt
  5. 2
      app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverDialog.kt
  6. 2
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceDialog.kt
  7. 2
      app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt
  8. 2
      app/src/main/java/io/legado/app/ui/book/explore/ExploreShowActivity.kt
  9. 1
      app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt
  10. 2
      app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt
  11. 1
      app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt
  12. 2
      app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt
  13. 2
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  14. 4
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  15. 4
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudConfigDialog.kt
  16. 2
      app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt
  17. 4
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt
  18. 2
      app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugActivity.kt
  19. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  20. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  21. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt
  22. 4
      app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt
  23. 3
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  24. 4
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  25. 3
      app/src/main/java/io/legado/app/ui/filechooser/FileChooserDialog.kt
  26. 2
      app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt
  27. 2
      app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt
  28. 3
      app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt
  29. 2
      app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt
  30. 2
      app/src/main/java/io/legado/app/ui/replacerule/GroupManageDialog.kt
  31. 2
      app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt
  32. 2
      app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugActivity.kt
  33. 2
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt
  34. 2
      app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt
  35. 2
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt
  36. 2
      app/src/main/java/io/legado/app/ui/widget/KeyboardToolPop.kt
  37. 1
      app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt
  38. 2
      app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt
  39. 2
      app/src/main/java/io/legado/app/ui/widget/recycler/RefreshRecyclerView.kt
  40. 5
      app/src/main/java/io/legado/app/ui/widget/recycler/scroller/FastScrollRecyclerView.kt
  41. 41
      app/src/main/java/io/legado/app/utils/PreferenceFragmentSupport.kt
  42. 2
      app/src/main/res/layout/activity_arrange_book.xml
  43. 6
      app/src/main/res/layout/activity_book_search.xml
  44. 2
      app/src/main/res/layout/activity_book_source_edit.xml
  45. 2
      app/src/main/res/layout/activity_download.xml
  46. 2
      app/src/main/res/layout/activity_explore_show.xml
  47. 2
      app/src/main/res/layout/activity_import_book.xml
  48. 2
      app/src/main/res/layout/activity_replace_rule.xml
  49. 2
      app/src/main/res/layout/activity_rss_source_edit.xml
  50. 2
      app/src/main/res/layout/activity_source_debug.xml
  51. 2
      app/src/main/res/layout/dialog_book_group_picker.xml
  52. 2
      app/src/main/res/layout/dialog_change_cover.xml
  53. 2
      app/src/main/res/layout/dialog_change_source.xml
  54. 4
      app/src/main/res/layout/dialog_file_chooser.xml
  55. 2
      app/src/main/res/layout/dialog_font_select.xml
  56. 2
      app/src/main/res/layout/dialog_read_bg_text.xml
  57. 2
      app/src/main/res/layout/dialog_recycler_view.xml
  58. 2
      app/src/main/res/layout/dialog_toc_regex.xml
  59. 2
      app/src/main/res/layout/fragment_books.xml
  60. 2
      app/src/main/res/layout/fragment_find_book.xml
  61. 2
      app/src/main/res/layout/fragment_rss.xml
  62. 4
      app/src/main/res/layout/popup_action_menu.xml
  63. 2
      app/src/main/res/layout/popup_keyboard_tool.xml
  64. 2
      app/src/main/res/layout/view_refresh_recycler.xml

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

@ -6,16 +6,16 @@ import android.os.Bundle
import android.view.View
import androidx.annotation.StringRes
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.App
import io.legado.app.R
import io.legado.app.lib.dialogs.alert
import io.legado.app.ui.widget.dialog.TextDialog
import io.legado.app.utils.PreferenceFragmentSupport
import io.legado.app.utils.openUrl
import io.legado.app.utils.sendToClip
import io.legado.app.utils.toast
class AboutFragment : PreferenceFragmentSupport() {
class AboutFragment : PreferenceFragmentCompat() {
private val licenseUrl = "https://github.com/gedoor/legado/blob/master/LICENSE"
private val disclaimerUrl = "https://gedoor.github.io/MyBookshelf/disclaimer.html"

@ -5,14 +5,14 @@ import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R
import io.legado.app.utils.ACache
import io.legado.app.utils.PreferenceFragmentSupport
import io.legado.app.utils.openUrl
import io.legado.app.utils.sendToClip
import org.jetbrains.anko.longToast
class DonateFragment : PreferenceFragmentSupport() {
class DonateFragment : PreferenceFragmentCompat() {
private val zfbHbRwmUrl = "https://gitee.com/gekunfei/Donate/raw/master/zfbhbrwm.png"
private val zfbSkRwmUrl = "https://gitee.com/gekunfei/Donate/raw/master/zfbskrwm.jpg"

@ -15,7 +15,6 @@ import io.legado.app.constant.AppConst
import io.legado.app.constant.PreferKey
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookGroup
import io.legado.app.help.AppConfig
import io.legado.app.help.ItemTouchCallback
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.noButton
@ -66,7 +65,6 @@ class ArrangeBookActivity : VMBaseActivity<ArrangeBookViewModel>(R.layout.activi
private fun initView() {
ATH.applyEdgeEffectColor(recycler_view)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.addItemDecoration(VerticalDivider(this))
adapter = ArrangeBookAdapter(this, this)

@ -14,7 +14,6 @@ import androidx.recyclerview.widget.GridLayoutManager
import io.legado.app.R
import io.legado.app.base.BaseDialogFragment
import io.legado.app.constant.Theme
import io.legado.app.help.AppConfig
import io.legado.app.utils.applyTint
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.dialog_change_source.*
@ -74,7 +73,6 @@ class ChangeCoverDialog : BaseDialogFragment(),
}
private fun initView() {
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = GridLayoutManager(requireContext(), 3)
adapter = CoverAdapter(requireContext(), this)
recycler_view.adapter = adapter

@ -19,7 +19,6 @@ import io.legado.app.constant.PreferKey
import io.legado.app.constant.Theme
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.SearchBook
import io.legado.app.help.AppConfig
import io.legado.app.ui.widget.recycler.VerticalDivider
import io.legado.app.utils.applyTint
import io.legado.app.utils.getPrefBoolean
@ -93,7 +92,6 @@ class ChangeSourceDialog : BaseDialogFragment(),
private fun initRecyclerView() {
adapter = ChangeSourceAdapter(requireContext(), this)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(context)
recycler_view.addItemDecoration(VerticalDivider(requireContext()))
recycler_view.adapter = adapter

@ -16,7 +16,6 @@ import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookChapter
import io.legado.app.help.AppConfig
import io.legado.app.help.BookHelp
import io.legado.app.service.help.Download
import io.legado.app.ui.filechooser.FileChooserDialog
@ -75,7 +74,6 @@ class DownloadActivity : VMBaseActivity<DownloadViewModel>(R.layout.activity_dow
}
private fun initRecyclerView() {
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
adapter = DownloadAdapter(this, this)
recycler_view.adapter = adapter

@ -8,7 +8,6 @@ import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.SearchBook
import io.legado.app.help.AppConfig
import io.legado.app.ui.book.info.BookInfoActivity
import io.legado.app.ui.widget.recycler.LoadMoreView
import io.legado.app.ui.widget.recycler.VerticalDivider
@ -33,7 +32,6 @@ class ExploreShowActivity : VMBaseActivity<ExploreShowViewModel>(R.layout.activi
}
private fun initRecyclerView() {
recycler_view.isEnableScroll = !AppConfig.isEInkMode
adapter = ExploreShowAdapter(this, this)
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.addItemDecoration(VerticalDivider(this))

@ -71,7 +71,6 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener {
private fun initData() {
adapter = GroupAdapter(requireContext())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(requireContext())
recycler_view.addItemDecoration(VerticalDivider(requireContext()))
recycler_view.adapter = adapter

@ -22,7 +22,6 @@ import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.constant.Theme
import io.legado.app.data.entities.BookGroup
import io.legado.app.help.AppConfig
import io.legado.app.help.ItemTouchCallback
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.customView
@ -97,7 +96,6 @@ class GroupSelectDialog : DialogFragment(), Toolbar.OnMenuItemClickListener {
tool_bar.setOnMenuItemClickListener(this)
tool_bar.menu.setGroupVisible(R.id.menu_groups, false)
adapter = GroupAdapter(requireContext())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(requireContext())
recycler_view.addItemDecoration(VerticalDivider(requireContext()))
recycler_view.adapter = adapter

@ -62,7 +62,6 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity
}
private fun initView() {
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
adapter = ImportBookAdapter(this, this)
recycler_view.adapter = adapter

@ -20,7 +20,6 @@ import androidx.core.view.isVisible
import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.help.AppConfig
import io.legado.app.service.BaseReadAloudService
import io.legado.app.utils.gone
import io.legado.app.utils.isAbsUrl
@ -62,7 +61,6 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac
}
private fun initRecyclerView() = with(contentView) {
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.adapter = adapter
recycler_view_more.adapter = adapter
SupportMenuInflater(context).inflate(R.menu.content_select_action, menu)

@ -22,7 +22,6 @@ import io.legado.app.base.BaseDialogFragment
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.constant.EventBus
import io.legado.app.help.AppConfig
import io.legado.app.help.ImageLoader
import io.legado.app.help.ReadBookConfig
import io.legado.app.help.permission.Permissions
@ -84,7 +83,6 @@ class BgTextConfigDialog : BaseDialogFragment() {
private fun initData() = with(ReadBookConfig.durConfig) {
sw_dark_status_icon.isChecked = statusIconDark()
adapter = BgAdapter(requireContext())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager =
LinearLayoutManager(requireContext(), RecyclerView.HORIZONTAL, false)
recycler_view.adapter = adapter

@ -10,6 +10,7 @@ import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.fragment.app.DialogFragment
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R
import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey
@ -17,7 +18,6 @@ import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.PreferenceFragmentSupport
import io.legado.app.utils.dp
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.postEvent
@ -64,7 +64,7 @@ class MoreConfigDialog : DialogFragment() {
.commit()
}
class ReadPreferenceFragment : PreferenceFragmentSupport(),
class ReadPreferenceFragment : PreferenceFragmentCompat(),
SharedPreferences.OnSharedPreferenceChangeListener {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {

@ -10,6 +10,7 @@ import android.widget.LinearLayout
import androidx.fragment.app.DialogFragment
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R
import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey
@ -19,7 +20,6 @@ import io.legado.app.lib.theme.backgroundColor
import io.legado.app.service.BaseReadAloudService
import io.legado.app.service.help.ReadAloud
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.PreferenceFragmentSupport
import io.legado.app.utils.postEvent
class ReadAloudConfigDialog : DialogFragment() {
@ -59,7 +59,7 @@ class ReadAloudConfigDialog : DialogFragment() {
.commit()
}
class ReadAloudPreferenceFragment : PreferenceFragmentSupport(),
class ReadAloudPreferenceFragment : PreferenceFragmentCompat(),
SharedPreferences.OnSharedPreferenceChangeListener {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {

@ -23,7 +23,6 @@ import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.constant.Theme
import io.legado.app.data.entities.TxtTocRule
import io.legado.app.help.AppConfig
import io.legado.app.help.ItemTouchCallback
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.cancelButton
@ -78,7 +77,6 @@ class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener {
private fun initView() {
adapter = TocRegexAdapter(requireContext())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(requireContext())
recycler_view.addItemDecoration(VerticalDivider(requireContext()))
recycler_view.adapter = adapter

@ -18,7 +18,6 @@ import io.legado.app.constant.PreferKey
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.SearchBook
import io.legado.app.data.entities.SearchKeyword
import io.legado.app.help.AppConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.primaryTextColor
import io.legado.app.ui.book.info.BookInfoActivity
@ -135,9 +134,6 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se
ATH.applyEdgeEffectColor(recycler_view)
ATH.applyEdgeEffectColor(rv_bookshelf_search)
ATH.applyEdgeEffectColor(rv_history_key)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
rv_bookshelf_search.isEnableScroll = !AppConfig.isEInkMode
rv_history_key.isEnableScroll = !AppConfig.isEInkMode
bookAdapter = BookAdapter(this, this)
rv_bookshelf_search.layoutManager = FlexboxLayoutManager(this)
rv_bookshelf_search.adapter = bookAdapter

@ -8,7 +8,6 @@ import androidx.appcompat.widget.SearchView
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.help.AppConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.qrcode.QrCodeActivity
@ -45,7 +44,6 @@ class BookSourceDebugActivity :
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
adapter = BookSourceDebugAdapter(this)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.adapter = adapter
rotate_loading.loadingColor = accentColor

@ -21,7 +21,6 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.constant.AppConst
import io.legado.app.data.entities.BookSource
import io.legado.app.data.entities.rule.*
import io.legado.app.help.AppConfig
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.book.source.debug.BookSourceDebugActivity
@ -121,7 +120,6 @@ class BookSourceEditActivity :
ATH.applyEdgeEffectColor(recycler_view)
mSoftKeyboardTool = KeyboardToolPop(this, AppConst.keyboardToolChars, this)
window.decorView.viewTreeObserver.addOnGlobalLayoutListener(KeyboardOnGlobalChangeListener())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.adapter = adapter
tab_layout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {

@ -20,7 +20,6 @@ import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.BookSource
import io.legado.app.help.AppConfig
import io.legado.app.help.ItemTouchCallback
import io.legado.app.lib.dialogs.*
import io.legado.app.lib.theme.ATH
@ -153,7 +152,6 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.addItemDecoration(VerticalDivider(this))
adapter = BookSourceAdapter(this, this)

@ -18,7 +18,6 @@ import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.constant.Theme
import io.legado.app.help.AppConfig
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.customView
import io.legado.app.lib.dialogs.noButton
@ -64,7 +63,6 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener {
tool_bar.menu.applyTint(requireContext(), Theme.getTheme())
tool_bar.setOnMenuItemClickListener(this)
adapter = GroupAdapter(requireContext())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(requireContext())
recycler_view.addItemDecoration(VerticalDivider(requireContext()))
recycler_view.adapter = adapter

@ -8,15 +8,15 @@ import android.view.View
import androidx.preference.EditTextPreference
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.R
import io.legado.app.constant.PreferKey
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.filechooser.FileChooserDialog
import io.legado.app.utils.PreferenceFragmentSupport
import io.legado.app.utils.getPrefString
class BackupConfigFragment : PreferenceFragmentSupport(),
class BackupConfigFragment : PreferenceFragmentCompat(),
SharedPreferences.OnSharedPreferenceChangeListener,
FileChooserDialog.CallBack {

@ -7,6 +7,7 @@ import android.os.Bundle
import android.view.View
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.App
import io.legado.app.R
import io.legado.app.constant.EventBus
@ -20,7 +21,7 @@ import io.legado.app.ui.widget.number.NumberPickerDialog
import io.legado.app.utils.*
class OtherConfigFragment : PreferenceFragmentSupport(),
class OtherConfigFragment : PreferenceFragmentCompat(),
SharedPreferences.OnSharedPreferenceChangeListener {
private val packageManager = App.INSTANCE.packageManager

@ -9,6 +9,7 @@ import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.App
import io.legado.app.R
import io.legado.app.constant.EventBus
@ -25,7 +26,8 @@ import io.legado.app.ui.widget.prefs.IconListPreference
import io.legado.app.utils.*
class ThemeConfigFragment : PreferenceFragmentSupport(), SharedPreferences.OnSharedPreferenceChangeListener {
class ThemeConfigFragment : PreferenceFragmentCompat(),
SharedPreferences.OnSharedPreferenceChangeListener {
val items = arrayListOf("极简", "曜夜", "经典", "黑白", "A屏黑")

@ -13,7 +13,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import io.legado.app.R
import io.legado.app.constant.Theme
import io.legado.app.help.AppConfig
import io.legado.app.ui.filechooser.adapter.FileAdapter
import io.legado.app.ui.filechooser.adapter.PathAdapter
import io.legado.app.ui.widget.recycler.VerticalDivider
@ -138,12 +137,10 @@ class FileChooserDialog : DialogFragment(),
fileAdapter = FileAdapter(requireContext(), this)
pathAdapter = PathAdapter(requireContext(), this)
rv_file.isEnableScroll = !AppConfig.isEInkMode
rv_file.addItemDecoration(VerticalDivider(requireContext()))
rv_file.layoutManager = LinearLayoutManager(activity)
rv_file.adapter = fileAdapter
rv_path.isEnableScroll = !AppConfig.isEInkMode
rv_path.layoutManager = LinearLayoutManager(activity, RecyclerView.HORIZONTAL, false)
rv_path.adapter = pathAdapter

@ -16,7 +16,6 @@ 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
@ -77,7 +76,6 @@ 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) {

@ -15,7 +15,6 @@ import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.VMBaseFragment
import io.legado.app.data.entities.BookSource
import io.legado.app.help.AppConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.primaryTextColor
import io.legado.app.ui.book.explore.ExploreShowActivity
@ -76,7 +75,6 @@ class ExploreFragment : VMBaseFragment<ExploreViewModel>(R.layout.fragment_find_
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(rv_find)
rv_find.isEnableScroll = !AppConfig.isEInkMode
linearLayoutManager = LinearLayoutManager(context)
rv_find.layoutManager = linearLayoutManager
adapter = ExploreAdapter(requireContext(), this, this)

@ -7,6 +7,7 @@ import android.view.Menu
import android.view.MenuItem
import android.view.View
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.BaseFragment
@ -66,7 +67,7 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog.
BackupRestoreUi.onActivityResult(requestCode, resultCode, data)
}
class PreferenceFragment : PreferenceFragmentSupport(),
class PreferenceFragment : PreferenceFragmentCompat(),
SharedPreferences.OnSharedPreferenceChangeListener {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {

@ -10,7 +10,6 @@ import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.VMBaseFragment
import io.legado.app.data.entities.RssSource
import io.legado.app.help.AppConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.main.MainViewModel
import io.legado.app.ui.rss.article.RssSortActivity
@ -52,7 +51,6 @@ class RssFragment : VMBaseFragment<RssSourceViewModel>(R.layout.fragment_rss),
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
adapter = RssAdapter(requireContext(), this)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = GridLayoutManager(requireContext(), 4)
recycler_view.adapter = adapter
}

@ -18,7 +18,6 @@ import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.constant.Theme
import io.legado.app.help.AppConfig
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.customView
import io.legado.app.lib.dialogs.noButton
@ -64,7 +63,6 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener {
tool_bar.menu.applyTint(requireContext(), Theme.getTheme())
tool_bar.setOnMenuItemClickListener(this)
adapter = GroupAdapter(requireContext())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(requireContext())
recycler_view.addItemDecoration(VerticalDivider(requireContext()))
recycler_view.adapter = adapter

@ -20,7 +20,6 @@ import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.ReplaceRule
import io.legado.app.help.AppConfig
import io.legado.app.help.BookHelp
import io.legado.app.help.ItemTouchCallback
import io.legado.app.help.coroutine.Coroutine
@ -102,7 +101,6 @@ class ReplaceRuleActivity : VMBaseActivity<ReplaceRuleViewModel>(R.layout.activi
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
adapter = ReplaceRuleAdapter(this, this)
recycler_view.adapter = adapter

@ -4,7 +4,6 @@ import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.help.AppConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.utils.getViewModel
@ -41,7 +40,6 @@ class RssSourceDebugActivity : VMBaseActivity<RssSourceDebugModel>(R.layout.acti
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
adapter = RssSourceDebugAdapter(this)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.adapter = adapter
rotate_loading.loadingColor = accentColor

@ -18,7 +18,6 @@ import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.constant.AppConst
import io.legado.app.data.entities.RssSource
import io.legado.app.help.AppConfig
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.theme.ATH
import io.legado.app.ui.qrcode.QrCodeActivity
@ -120,7 +119,6 @@ class RssSourceEditActivity :
ATH.applyEdgeEffectColor(recycler_view)
mSoftKeyboardTool = KeyboardToolPop(this, AppConst.keyboardToolChars, this)
window.decorView.viewTreeObserver.addOnGlobalLayoutListener(this)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.adapter = adapter
}

@ -18,7 +18,6 @@ import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.constant.Theme
import io.legado.app.help.AppConfig
import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.customView
import io.legado.app.lib.dialogs.noButton
@ -62,7 +61,6 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener {
tool_bar.menu.applyTint(requireContext(), Theme.getTheme())
tool_bar.setOnMenuItemClickListener(this)
adapter = GroupAdapter(requireContext())
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(requireContext())
recycler_view.addItemDecoration(VerticalDivider(requireContext()))
recycler_view.adapter = adapter

@ -20,7 +20,6 @@ import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.RssSource
import io.legado.app.help.AppConfig
import io.legado.app.help.ItemTouchCallback
import io.legado.app.lib.dialogs.*
import io.legado.app.lib.theme.ATH
@ -138,7 +137,6 @@ class RssSourceActivity : VMBaseActivity<RssSourceViewModel>(R.layout.activity_r
private fun initRecyclerView() {
ATH.applyEdgeEffectColor(recycler_view)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(this)
recycler_view.addItemDecoration(VerticalDivider(this))
adapter = RssSourceAdapter(this, this)

@ -10,7 +10,6 @@ import androidx.recyclerview.widget.RecyclerView
import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.help.AppConfig
import kotlinx.android.synthetic.main.item_fillet_text.view.*
import kotlinx.android.synthetic.main.popup_keyboard_tool.view.*
import org.jetbrains.anko.sdk27.listeners.onClick
@ -35,7 +34,6 @@ class KeyboardToolPop(
private fun initRecyclerView() = with(contentView) {
val adapter = Adapter(context)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)
recycler_view.adapter = adapter
adapter.setItems(chars)

@ -64,7 +64,6 @@ class FontSelectDialog : BaseDialogFragment(),
tool_bar.setTitle(R.string.select_font)
tool_bar.inflateMenu(R.menu.font_select)
tool_bar.setOnMenuItemClickListener(this)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
adapter = FontAdapter(requireContext(), this)
recycler_view.layoutManager = LinearLayoutManager(context)
recycler_view.adapter = adapter

@ -18,7 +18,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.help.AppConfig
import io.legado.app.utils.getCompatDrawable
import kotlinx.android.synthetic.main.dialog_recycler_view.*
import kotlinx.android.synthetic.main.item_icon_preference.view.*
@ -139,7 +138,6 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
tool_bar.setTitle(R.string.change_icon)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.layoutManager = LinearLayoutManager(requireContext())
val adapter = Adapter(requireContext())
recycler_view.adapter = adapter

@ -9,7 +9,6 @@ import android.view.View
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R
import io.legado.app.help.AppConfig
import kotlinx.android.synthetic.main.view_refresh_recycler.view.*
@ -23,7 +22,6 @@ class RefreshRecyclerView(context: Context?, attrs: AttributeSet?) : LinearLayou
init {
orientation = VERTICAL
LayoutInflater.from(context).inflate(R.layout.view_refresh_recycler, this, true)
recycler_view.isEnableScroll = !AppConfig.isEInkMode
recycler_view.setOnTouchListener(object : OnTouchListener {
@SuppressLint("ClickableViewAccessibility")
override fun onTouch(v: View?, event: MotionEvent?): Boolean {

@ -5,11 +5,9 @@ import android.util.AttributeSet
import android.view.ViewGroup
import androidx.annotation.ColorInt
import androidx.recyclerview.widget.RecyclerView
import fadeapp.widgets.ScrollLessRecyclerView
import io.legado.app.R
import io.legado.app.help.AppConfig
class FastScrollRecyclerView : ScrollLessRecyclerView {
class FastScrollRecyclerView : RecyclerView {
private var mFastScroller: FastScroller? = null
@ -191,7 +189,6 @@ class FastScrollRecyclerView : ScrollLessRecyclerView {
private fun layout(context: Context, attrs: AttributeSet?) {
mFastScroller = FastScroller(context, attrs)
mFastScroller?.id = R.id.fast_scroller
isEnableScroll = !AppConfig.isEInkMode
}
}

@ -1,41 +0,0 @@
package io.legado.app.utils
import android.content.pm.PackageManager
import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.view.setPadding
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceRecyclerViewAccessibilityDelegate
import androidx.recyclerview.widget.RecyclerView
import fadeapp.widgets.ScrollLessRecyclerView
import io.legado.app.R
import io.legado.app.help.AppConfig
abstract class PreferenceFragmentSupport : PreferenceFragmentCompat(){
override fun onCreateRecyclerView(
inflater: LayoutInflater,
parent: ViewGroup,
savedInstanceState: Bundle?
): RecyclerView {
if (context?.packageManager?.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)==true) {
val recyclerView: RecyclerView?= parent.findViewById(R.id.recycler_view)
if (recyclerView != null) {
return recyclerView
}
}
val recyclerView = ScrollLessRecyclerView(inflater.context,null,R.attr.preferenceFragmentListStyle)
recyclerView.id = R.id.recycler_view
recyclerView.setPadding(0)
recyclerView.clipToPadding = false
recyclerView.isEnableScroll = !AppConfig.isEInkMode
recyclerView.layoutManager = onCreateLayoutManager()
recyclerView.setAccessibilityDelegateCompat(
PreferenceRecyclerViewAccessibilityDelegate(recyclerView)
)
return recyclerView
}
}

@ -11,7 +11,7 @@
android:layout_height="wrap_content"
app:title="@string/arrange_bookshelf" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"

@ -29,7 +29,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/refresh_progress_bar">
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
@ -56,7 +56,7 @@
android:text="@string/bookshelf"
android:visibility="gone" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_bookshelf_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -84,7 +84,7 @@
</LinearLayout>
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_history_key"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -96,7 +96,7 @@
</com.google.android.material.tabs.TabLayout>
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -11,7 +11,7 @@
android:layout_height="wrap_content"
app:title="@string/download_offline" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -22,7 +22,7 @@
app:layout_constraintTop_toBottomOf="@id/title_bar">
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -53,7 +53,7 @@
tools:ignore="UnusedAttribute" />
</LinearLayout>
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
app:layout_constraintTop_toBottomOf="@id/layTop"

@ -14,7 +14,7 @@
app:contentLayout="@layout/view_search"
app:title="@string/replace_purify" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"

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

@ -14,7 +14,7 @@
app:layout_constraintTop_toTopOf="parent"
app:title="@string/debug_source" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"

@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:background="@color/background_card"
android:layout_width="match_parent"

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

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

@ -10,7 +10,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_path"
android:layout_width="match_parent"
android:layout_height="24dp"
@ -24,7 +24,7 @@
android:layout_height="match_parent"
android:background="@color/background_card">
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_file"
android:layout_width="match_parent"
android:layout_height="match_parent" />

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

@ -79,7 +79,7 @@
android:layout_height="wrap_content"
android:text="@string/bg_image" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="100dp" />

@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:background="@color/background_card"
android:layout_width="match_parent"

@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:background="@color/background_card"
android:layout_width="match_parent"

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

@ -14,7 +14,7 @@
app:layout_constraintTop_toTopOf="parent"
app:title="@string/find" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_find"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -12,7 +12,7 @@
app:attachToActivity="false"
app:title="@string/rss" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -13,7 +13,7 @@
android:orientation="horizontal"
android:gravity="center_vertical">
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -33,7 +33,7 @@
</LinearLayout>
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<fadeapp.widgets.ScrollLessRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"

@ -8,7 +8,7 @@
android:layout_height="2dp"
app:layout_constraintTop_toBottomOf="@id/title_bar" />
<fadeapp.widgets.ScrollLessRecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

Loading…
Cancel
Save