Refresh the articles if using Mark On Scroll. (#342)

This commit is contained in:
davidoskky 2021-04-08 14:10:58 +02:00 committed by GitHub
parent 56720659ee
commit 6e3381fb61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,6 +103,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
private var lastFetchDone: Boolean = false private var lastFetchDone: Boolean = false
private var itemsCaching: Boolean = false private var itemsCaching: Boolean = false
private var updateSources: Boolean = true private var updateSources: Boolean = true
private var markOnScroll: Boolean = false
private var hiddenTags: List<String> = emptyList() private var hiddenTags: List<String> = emptyList()
private var apiVersionMajor: Int = 0 private var apiVersionMajor: Int = 0
@ -381,6 +382,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
handleRecurringTask() handleRecurringTask()
handleOfflineActions() handleOfflineActions()
if (markOnScroll) {
getElementsAccordingToTab()
}
} }
private fun getAndStoreAllItems() { private fun getAndStoreAllItems() {
@ -454,6 +459,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
infiniteScroll = sharedPref.getBoolean("infinite_loading", false) infiniteScroll = sharedPref.getBoolean("infinite_loading", false)
itemsCaching = sharedPref.getBoolean("items_caching", false) itemsCaching = sharedPref.getBoolean("items_caching", false)
updateSources = sharedPref.getBoolean("update_sources", true) updateSources = sharedPref.getBoolean("update_sources", true)
markOnScroll = sharedPref.getBoolean("mark_on_scroll", false)
hiddenTags = if (sharedPref.getString("hidden_tags", "")!!.isNotEmpty()) { hiddenTags = if (sharedPref.getString("hidden_tags", "")!!.isNotEmpty()) {
sharedPref.getString("hidden_tags", "")!!.replace("\\s".toRegex(), "").split(",") sharedPref.getString("hidden_tags", "")!!.replace("\\s".toRegex(), "").split(",")
} else { } else {