diff --git a/app/src/main/java/io/legado/app/base/adapter/InfiniteScrollListener.kt b/app/src/main/java/io/legado/app/base/adapter/InfiniteScrollListener.kt index 08f9716f3..65aa03496 100644 --- a/app/src/main/java/io/legado/app/base/adapter/InfiniteScrollListener.kt +++ b/app/src/main/java/io/legado/app/base/adapter/InfiniteScrollListener.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView * 上拉加载更多 */ @Suppress("unused") -abstract class InfiniteScrollListener() : RecyclerView.OnScrollListener() { +abstract class InfiniteScrollListener : RecyclerView.OnScrollListener() { private val loadMoreRunnable = Runnable { onLoadMore() } override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { diff --git a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt b/app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt similarity index 99% rename from app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt rename to app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt index 6a8017eb5..29eb6f4fa 100644 --- a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt +++ b/app/src/main/java/io/legado/app/base/adapter/RecyclerAdapter.kt @@ -16,7 +16,7 @@ import java.util.* * 通用的adapter 可添加header,footer,以及不同类型item */ @Suppress("unused", "MemberVisibilityCanBePrivate") -abstract class CommonRecyclerAdapter(protected val context: Context) : +abstract class RecyclerAdapter(protected val context: Context) : RecyclerView.Adapter() { val inflater: LayoutInflater = LayoutInflater.from(context) diff --git a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt index 45659854b..7153f2e2a 100644 --- a/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt +++ b/app/src/main/java/io/legado/app/ui/about/ReadRecordActivity.kt @@ -8,8 +8,8 @@ import android.view.ViewGroup import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseActivity -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.ReadRecordShow import io.legado.app.databinding.ActivityReadRecordBinding import io.legado.app.databinding.ItemReadRecordBinding @@ -92,7 +92,7 @@ class ReadRecordActivity : BaseActivity() { } inner class RecordAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemReadRecordBinding { return ItemReadRecordBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt index d37c1cc3a..6aa236744 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt @@ -12,8 +12,8 @@ import androidx.appcompat.widget.Toolbar import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.PreferKey import io.legado.app.data.entities.BookSource import io.legado.app.databinding.DialogEditTextBinding @@ -126,7 +126,7 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList } inner class SourcesAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemSourceImportBinding { return ItemSourceImportBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt index 7c3fa1591..41bda67fd 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt @@ -12,8 +12,8 @@ import androidx.appcompat.widget.Toolbar import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.PreferKey import io.legado.app.data.entities.RssSource import io.legado.app.databinding.DialogEditTextBinding @@ -126,7 +126,7 @@ class ImportRssSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListe } inner class SourcesAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemSourceImportBinding { return ItemSourceImportBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt index afb865e24..bb65d4d83 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt @@ -5,8 +5,8 @@ import android.view.View import android.view.ViewGroup import androidx.core.os.bundleOf import androidx.recyclerview.widget.RecyclerView -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookGroup import io.legado.app.databinding.ItemArrangeBookBinding @@ -18,7 +18,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick import java.util.* class ArrangeBookAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context), + RecyclerAdapter(context), ItemTouchCallback.Callback { val groupRequestCode = 12 diff --git a/app/src/main/java/io/legado/app/ui/book/cache/CacheAdapter.kt b/app/src/main/java/io/legado/app/ui/book/cache/CacheAdapter.kt index d936f0d17..c7e3209b8 100644 --- a/app/src/main/java/io/legado/app/ui/book/cache/CacheAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/cache/CacheAdapter.kt @@ -4,8 +4,8 @@ import android.content.Context import android.view.ViewGroup import android.widget.ImageView import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.databinding.ItemDownloadBinding @@ -16,7 +16,7 @@ import java.util.concurrent.CopyOnWriteArraySet class CacheAdapter(context: Context, private val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { val cacheChapters = hashMapOf>() var downloadMap: ConcurrentHashMap>? = null diff --git a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt index 45dccfd0b..77b15300a 100644 --- a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt @@ -3,8 +3,8 @@ package io.legado.app.ui.book.explore import android.content.Context import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.Book import io.legado.app.data.entities.SearchBook import io.legado.app.databinding.ItemSearchBinding @@ -13,7 +13,7 @@ import io.legado.app.utils.visible import org.jetbrains.anko.sdk27.listeners.onClick class ExploreShowAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemSearchBinding { return ItemSearchBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt index 23f4d6cb5..a6908e354 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt @@ -15,8 +15,8 @@ import androidx.recyclerview.widget.RecyclerView import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.BookGroup import io.legado.app.databinding.DialogBookGroupPickerBinding import io.legado.app.databinding.DialogEditTextBinding @@ -152,7 +152,7 @@ class GroupSelectDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener } private inner class GroupAdapter(context: Context) : - CommonRecyclerAdapter(context), + RecyclerAdapter(context), ItemTouchCallback.Callback { private var isMoved: Boolean = false diff --git a/app/src/main/java/io/legado/app/ui/book/info/ChapterListAdapter.kt b/app/src/main/java/io/legado/app/ui/book/info/ChapterListAdapter.kt index a7ad5ef6b..dab2525ec 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/ChapterListAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/ChapterListAdapter.kt @@ -3,8 +3,8 @@ package io.legado.app.ui.book.info import android.content.Context import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.BookChapter import io.legado.app.databinding.ItemChapterListBinding import io.legado.app.lib.theme.accentColor @@ -12,7 +12,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.textColorResource class ChapterListAdapter(context: Context, var callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemChapterListBinding { return ItemChapterListBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt index 417bf96aa..62371053f 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt @@ -4,8 +4,8 @@ import android.content.Context import android.net.Uri import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.AppConst import io.legado.app.databinding.ItemImportBookBinding import io.legado.app.utils.* @@ -13,7 +13,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick class ImportBookAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { var selectedUris = hashSetOf() var checkableCount = 0 private var bookFileNames = arrayListOf() diff --git a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt index 48c74e2bd..6ec4d86fe 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt @@ -19,8 +19,8 @@ import androidx.appcompat.view.menu.MenuBuilder import androidx.appcompat.view.menu.MenuItemImpl import androidx.core.view.isVisible import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemTextBinding import io.legado.app.databinding.PopupActionMenuBinding import io.legado.app.service.BaseReadAloudService @@ -89,7 +89,7 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac } inner class Adapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemTextBinding { return ItemTextBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/BgAdapter.kt b/app/src/main/java/io/legado/app/ui/book/read/config/BgAdapter.kt index 135c66c1b..826a701f2 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/BgAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/BgAdapter.kt @@ -2,8 +2,8 @@ package io.legado.app.ui.book.read.config import android.content.Context import android.view.ViewGroup -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.EventBus import io.legado.app.databinding.ItemBgImageBinding import io.legado.app.help.ImageLoader @@ -13,7 +13,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick import java.io.File class BgAdapter(context: Context, val textColor: Int) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemBgImageBinding { return ItemBgImageBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt index 1e93c1d48..556545e95 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt @@ -6,8 +6,8 @@ import android.view.* import androidx.core.view.get import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.EventBus import io.legado.app.databinding.DialogReadBookStyleBinding import io.legado.app.databinding.ItemReadStyleBinding @@ -207,7 +207,7 @@ class ReadStyleDialog : BaseDialogFragment(), FontSelectDialog.CallBack { } inner class StyleAdapter : - CommonRecyclerAdapter(requireContext()) { + RecyclerAdapter(requireContext()) { override fun getViewBinding(parent: ViewGroup): ItemReadStyleBinding { return ItemReadStyleBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt index 92c857d99..542853559 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt @@ -13,8 +13,8 @@ import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.PreferKey import io.legado.app.data.entities.HttpTTS import io.legado.app.databinding.DialogHttpTtsEditBinding @@ -128,7 +128,7 @@ class SpeakEngineDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener } inner class Adapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemHttpTtsBinding { return ItemHttpTtsBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt index 1c4252c3c..7fe704620 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt @@ -17,8 +17,8 @@ import com.google.android.material.snackbar.Snackbar import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.TxtTocRule import io.legado.app.databinding.DialogEditTextBinding import io.legado.app.databinding.DialogTocRegexBinding @@ -189,7 +189,7 @@ class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { } inner class TocRegexAdapter(context: Context) : - CommonRecyclerAdapter(context), + RecyclerAdapter(context), ItemTouchCallback.Callback { override fun getViewBinding(parent: ViewGroup): ItemTocRegexBinding { diff --git a/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt index 042468ad5..3f27b52c6 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/BookAdapter.kt @@ -2,14 +2,14 @@ package io.legado.app.ui.book.search import android.content.Context import android.view.ViewGroup -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.Book import io.legado.app.databinding.ItemFilletTextBinding import org.jetbrains.anko.sdk27.listeners.onClick class BookAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemFilletTextBinding { return ItemFilletTextBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/search/HistoryKeyAdapter.kt b/app/src/main/java/io/legado/app/ui/book/search/HistoryKeyAdapter.kt index 7417c16c3..15c0695c9 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/HistoryKeyAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/HistoryKeyAdapter.kt @@ -2,8 +2,8 @@ package io.legado.app.ui.book.search import android.view.ViewGroup import io.legado.app.App -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.SearchKeyword import io.legado.app.databinding.ItemFilletTextBinding import io.legado.app.ui.widget.anima.explosion_field.ExplosionField @@ -15,7 +15,7 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick class HistoryKeyAdapter(activity: SearchActivity, val callBack: CallBack) : - CommonRecyclerAdapter(activity) { + RecyclerAdapter(activity) { private val explosionField = ExplosionField.attach2Window(activity) diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt index 8041d54e3..cd2221888 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt @@ -4,8 +4,8 @@ import android.content.Context import android.os.Bundle import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.SearchBook import io.legado.app.databinding.ItemSearchBinding import io.legado.app.utils.gone @@ -13,7 +13,7 @@ import io.legado.app.utils.visible import org.jetbrains.anko.sdk27.listeners.onClick class SearchAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemSearchBinding { return ItemSearchBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/searchContent/SearchContentAdapter.kt b/app/src/main/java/io/legado/app/ui/book/searchContent/SearchContentAdapter.kt index b8bca39b7..f65042827 100644 --- a/app/src/main/java/io/legado/app/ui/book/searchContent/SearchContentAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/searchContent/SearchContentAdapter.kt @@ -3,8 +3,8 @@ package io.legado.app.ui.book.searchContent import android.content.Context import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemSearchListBinding import io.legado.app.lib.theme.accentColor import io.legado.app.utils.getCompatColor @@ -12,7 +12,7 @@ import io.legado.app.utils.hexString import org.jetbrains.anko.sdk27.listeners.onClick class SearchContentAdapter(context: Context, val callback: Callback) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { val cacheFileNames = hashSetOf() val textColor = context.getCompatColor(R.color.primaryText).hexString.substring(2) diff --git a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt index c91c336eb..dd93b0a59 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/debug/BookSourceDebugAdapter.kt @@ -4,12 +4,12 @@ import android.content.Context import android.view.View import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemLogBinding class BookSourceDebugAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemLogBinding { return ItemLogBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt index 1a221453c..45e973c8b 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt @@ -12,8 +12,8 @@ import androidx.fragment.app.DialogFragment import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.App import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.AppPattern import io.legado.app.databinding.DialogEditTextBinding import io.legado.app.databinding.DialogRecyclerViewBinding @@ -109,7 +109,7 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { } private inner class GroupAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemGroupManageBinding { return ItemGroupManageBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt index f0409de61..13176acae 100644 --- a/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/toc/ChapterListAdapter.kt @@ -3,8 +3,8 @@ package io.legado.app.ui.book.toc import android.content.Context import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.BookChapter import io.legado.app.databinding.ItemChapterListBinding import io.legado.app.lib.theme.accentColor @@ -13,7 +13,7 @@ import io.legado.app.utils.visible import org.jetbrains.anko.sdk27.listeners.onClick class ChapterListAdapter(context: Context, val callback: Callback) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { val cacheFileNames = hashSetOf() diff --git a/app/src/main/java/io/legado/app/ui/config/ThemeListDialog.kt b/app/src/main/java/io/legado/app/ui/config/ThemeListDialog.kt index 656490788..974924802 100644 --- a/app/src/main/java/io/legado/app/ui/config/ThemeListDialog.kt +++ b/app/src/main/java/io/legado/app/ui/config/ThemeListDialog.kt @@ -9,8 +9,8 @@ import androidx.appcompat.widget.Toolbar import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.DialogRecyclerViewBinding import io.legado.app.databinding.ItemThemeConfigBinding import io.legado.app.help.ThemeConfig @@ -96,7 +96,7 @@ class ThemeListDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { } inner class Adapter : - CommonRecyclerAdapter(requireContext()) { + RecyclerAdapter(requireContext()) { override fun getViewBinding(parent: ViewGroup): ItemThemeConfigBinding { return ItemThemeConfigBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/filepicker/adapter/FileAdapter.kt b/app/src/main/java/io/legado/app/ui/filepicker/adapter/FileAdapter.kt index e59a59b9a..cdd8301fc 100644 --- a/app/src/main/java/io/legado/app/ui/filepicker/adapter/FileAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/filepicker/adapter/FileAdapter.kt @@ -3,8 +3,8 @@ package io.legado.app.ui.filepicker.adapter import android.content.Context import android.view.ViewGroup -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemFileFilepickerBinding import io.legado.app.help.AppConfig import io.legado.app.lib.theme.getPrimaryDisabledTextColor @@ -19,7 +19,7 @@ import java.util.* class FileAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { private var rootPath: String? = null var currentPath: String? = null private set diff --git a/app/src/main/java/io/legado/app/ui/filepicker/adapter/PathAdapter.kt b/app/src/main/java/io/legado/app/ui/filepicker/adapter/PathAdapter.kt index 88c2d9a9f..4ad56534f 100644 --- a/app/src/main/java/io/legado/app/ui/filepicker/adapter/PathAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/filepicker/adapter/PathAdapter.kt @@ -3,8 +3,8 @@ package io.legado.app.ui.filepicker.adapter import android.content.Context import android.os.Environment import android.view.ViewGroup -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemPathFilepickerBinding import io.legado.app.ui.filepicker.utils.ConvertUtils import io.legado.app.ui.filepicker.utils.FilePickerIcon @@ -13,7 +13,7 @@ import java.util.* class PathAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { private val paths = LinkedList() private val arrowIcon = ConvertUtils.toDrawable(FilePickerIcon.getArrow()) diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt index 98b935638..b0aba869f 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt @@ -7,8 +7,8 @@ import android.view.ViewGroup import android.widget.PopupMenu import io.legado.app.App import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.BookSource import io.legado.app.databinding.ItemFilletTextBinding import io.legado.app.databinding.ItemFindBookBinding @@ -24,7 +24,7 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick class ExploreAdapter(context: Context, private val scope: CoroutineScope, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { private var exIndex = -1 private var scrollTo = -1 diff --git a/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt b/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt index 9006f2e61..40218e5d3 100644 --- a/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/rss/RssAdapter.kt @@ -5,8 +5,8 @@ import android.view.View import android.view.ViewGroup import androidx.appcompat.widget.PopupMenu import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.RssSource import io.legado.app.databinding.ItemRssBinding import io.legado.app.help.ImageLoader @@ -14,7 +14,7 @@ import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onLongClick class RssAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemRssBinding { return ItemRssBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt index c2b8941de..a5e23d96f 100644 --- a/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt @@ -12,8 +12,8 @@ import androidx.fragment.app.DialogFragment import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.App import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.AppPattern import io.legado.app.databinding.DialogEditTextBinding import io.legado.app.databinding.DialogRecyclerViewBinding @@ -114,7 +114,7 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { } private inner class GroupAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemGroupManageBinding { return ItemGroupManageBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt index 48ac5eec1..f198d05f0 100644 --- a/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/replace/ReplaceRuleAdapter.kt @@ -8,8 +8,8 @@ import android.widget.PopupMenu import androidx.core.os.bundleOf import androidx.recyclerview.widget.RecyclerView import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.ReplaceRule import io.legado.app.databinding.ItemReplaceRuleBinding import io.legado.app.lib.theme.backgroundColor @@ -20,7 +20,7 @@ import java.util.* class ReplaceRuleAdapter(context: Context, var callBack: CallBack) : - CommonRecyclerAdapter(context), + RecyclerAdapter(context), ItemTouchCallback.Callback { private val selected = linkedSetOf() diff --git a/app/src/main/java/io/legado/app/ui/rss/article/BaseRssArticlesAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/article/BaseRssArticlesAdapter.kt index d2d5650b3..69eb4ccd6 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/BaseRssArticlesAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/BaseRssArticlesAdapter.kt @@ -2,12 +2,12 @@ package io.legado.app.ui.rss.article import android.content.Context import androidx.viewbinding.ViewBinding -import io.legado.app.base.adapter.CommonRecyclerAdapter +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.RssArticle abstract class BaseRssArticlesAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { interface CallBack { val isGridLayout: Boolean diff --git a/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt index f630ec25e..775388364 100644 --- a/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/favorites/RssFavoritesAdapter.kt @@ -7,8 +7,8 @@ import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.target.Target -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.RssStar import io.legado.app.databinding.ItemRssArticleBinding import io.legado.app.help.ImageLoader @@ -17,7 +17,7 @@ import io.legado.app.utils.visible import org.jetbrains.anko.sdk27.listeners.onClick class RssFavoritesAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemRssArticleBinding { return ItemRssArticleBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugAdapter.kt index bb14033b7..dc92e12d6 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/debug/RssSourceDebugAdapter.kt @@ -4,12 +4,12 @@ import android.content.Context import android.view.View import android.view.ViewGroup import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemLogBinding class RssSourceDebugAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemLogBinding { return ItemLogBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt index b467131d4..b5444cebe 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt @@ -12,8 +12,8 @@ import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.constant.AppPattern import io.legado.app.databinding.DialogEditTextBinding import io.legado.app.databinding.DialogRecyclerViewBinding @@ -113,7 +113,7 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener } private inner class GroupAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemGroupManageBinding { return ItemGroupManageBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubAdapter.kt index 0efea8371..f8e1c916d 100644 --- a/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/subscription/RuleSubAdapter.kt @@ -6,15 +6,15 @@ import android.view.ViewGroup import android.widget.PopupMenu import androidx.recyclerview.widget.RecyclerView import io.legado.app.R -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.entities.RuleSub import io.legado.app.databinding.ItemRuleSubBinding import io.legado.app.ui.widget.recycler.ItemTouchCallback import org.jetbrains.anko.sdk27.listeners.onClick class RuleSubAdapter(context: Context, val callBack: Callback) : - CommonRecyclerAdapter(context), + RecyclerAdapter(context), ItemTouchCallback.Callback { private val typeArray = context.resources.getStringArray(R.array.rule_type) diff --git a/app/src/main/java/io/legado/app/ui/widget/KeyboardToolPop.kt b/app/src/main/java/io/legado/app/ui/widget/KeyboardToolPop.kt index e0b66934a..dbbc10af4 100644 --- a/app/src/main/java/io/legado/app/ui/widget/KeyboardToolPop.kt +++ b/app/src/main/java/io/legado/app/ui/widget/KeyboardToolPop.kt @@ -6,8 +6,8 @@ import android.view.ViewGroup import android.widget.PopupWindow import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemFilletTextBinding import io.legado.app.databinding.PopupKeyboardToolBinding import org.jetbrains.anko.sdk27.listeners.onClick @@ -40,7 +40,7 @@ class KeyboardToolPop( } inner class Adapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemFilletTextBinding { return ItemFilletTextBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt index 4c0643ba1..ba356c6e1 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dialog/TextListDialog.kt @@ -9,8 +9,8 @@ import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.DialogRecyclerViewBinding import io.legado.app.databinding.ItemLogBinding import io.legado.app.utils.getSize @@ -59,7 +59,7 @@ class TextListDialog : BaseDialogFragment() { } class TextAdapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemLogBinding { return ItemLogBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt b/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt index 73559cd1f..c2b1619be 100644 --- a/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/widget/font/FontAdapter.kt @@ -4,8 +4,8 @@ import android.content.Context import android.graphics.Typeface import android.os.Build import android.view.ViewGroup -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.ItemFontBinding import io.legado.app.utils.DocItem import io.legado.app.utils.RealPathUtil @@ -16,7 +16,7 @@ import org.jetbrains.anko.toast import java.io.File class FontAdapter(context: Context, val callBack: CallBack) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemFontBinding { return ItemFontBinding.inflate(inflater, parent, false) diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt index 9cad1cdb7..673ba1aca 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt @@ -15,8 +15,8 @@ import androidx.preference.PreferenceViewHolder import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.BaseDialogFragment -import io.legado.app.base.adapter.CommonRecyclerAdapter import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.databinding.DialogRecyclerViewBinding import io.legado.app.databinding.ItemIconPreferenceBinding import io.legado.app.lib.theme.primaryColor @@ -156,7 +156,7 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference inner class Adapter(context: Context) : - CommonRecyclerAdapter(context) { + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemIconPreferenceBinding { return ItemIconPreferenceBinding.inflate(inflater, parent, false)