Make the selection of tags and source filters exclusive (#399)

* Make the selection of tags and source filters exclusive

* Update changelog
This commit is contained in:
davidoskky 2022-01-16 20:49:54 +01:00 committed by GitHub
parent ca5186d20a
commit 9693dec807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View File

@ -44,6 +44,8 @@
- Closing #236. New sources can be added in Selfoss 2.19. - Closing #236. New sources can be added in Selfoss 2.19.
- Closing #397 and #355. Tag and Sources filters are now exclusive.
- Dropped support for android 4, the last version supporting it is v1721030811 - Dropped support for android 4, the last version supporting it is v1721030811
**1.6.x** **1.6.x**

View File

@ -101,9 +101,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
private var fullHeightCards: Boolean = false private var fullHeightCards: Boolean = false
private var itemsNumber: Int = 200 private var itemsNumber: Int = 200
private var elementsShown: Int = 1 private var elementsShown: Int = 1
private var maybeTagFilter: Tag? = null
private var maybeSourceFilter: Source? = null
private var maybeSearchFilter: String? = null
private var userIdentifier: String = "" private var userIdentifier: String = ""
private var displayAccountHeader: Boolean = false private var displayAccountHeader: Boolean = false
private var infiniteScroll: Boolean = false private var infiniteScroll: Boolean = false
@ -563,8 +560,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
color = ColorHolder.fromColor(appColors.colorAccent) } color = ColorHolder.fromColor(appColors.colorAccent) }
onDrawerItemClickListener = { _,_,_ -> onDrawerItemClickListener = { _,_,_ ->
allItems = ArrayList() allItems = ArrayList()
maybeTagFilter = it
SharedItems.tagFilter = it.tag SharedItems.tagFilter = it.tag
SharedItems.sourceFilter = null
SharedItems.sourceIDFilter = null
getElementsAccordingToTab() getElementsAccordingToTab()
fetchOnEmptyList() fetchOnEmptyList()
false false
@ -615,8 +613,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
color = ColorHolder.fromColor(appColors.colorAccent) } color = ColorHolder.fromColor(appColors.colorAccent) }
onDrawerItemClickListener = { _,_,_ -> onDrawerItemClickListener = { _,_,_ ->
allItems = ArrayList() allItems = ArrayList()
maybeTagFilter = it
SharedItems.tagFilter = it.tag SharedItems.tagFilter = it.tag
SharedItems.sourceFilter = null
SharedItems.sourceIDFilter = null
getElementsAccordingToTab() getElementsAccordingToTab()
fetchOnEmptyList() fetchOnEmptyList()
false false
@ -650,9 +649,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
iconUrl = source.getIcon(this@HomeActivity) iconUrl = source.getIcon(this@HomeActivity)
onDrawerItemClickListener = { _,_,_ -> onDrawerItemClickListener = { _,_,_ ->
allItems = ArrayList() allItems = ArrayList()
maybeSourceFilter = source
SharedItems.sourceIDFilter = source.id.toLong() SharedItems.sourceIDFilter = source.id.toLong()
SharedItems.sourceFilter = source.title SharedItems.sourceFilter = source.title
SharedItems.tagFilter = null
getElementsAccordingToTab() getElementsAccordingToTab()
fetchOnEmptyList() fetchOnEmptyList()
false false
@ -673,11 +672,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
badgeRes = R.string.drawer_action_clear badgeRes = R.string.drawer_action_clear
onDrawerItemClickListener = { _,_,_ -> onDrawerItemClickListener = { _,_,_ ->
allItems = ArrayList() allItems = ArrayList()
maybeSourceFilter = null
SharedItems.sourceFilter = null SharedItems.sourceFilter = null
SharedItems.sourceIDFilter = null SharedItems.sourceIDFilter = null
maybeTagFilter = null
SharedItems.tagFilter = null SharedItems.tagFilter = null
binding.mainDrawer.setSelectionAtPosition(-1)
getElementsAccordingToTab() getElementsAccordingToTab()
fetchOnEmptyList() fetchOnEmptyList()
false false
@ -1122,7 +1120,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
override fun onQueryTextChange(p0: String?): Boolean { override fun onQueryTextChange(p0: String?): Boolean {
if (p0.isNullOrBlank()) { if (p0.isNullOrBlank()) {
maybeSearchFilter = null
SharedItems.searchFilter = null SharedItems.searchFilter = null
getElementsAccordingToTab() getElementsAccordingToTab()
fetchOnEmptyList() fetchOnEmptyList()
@ -1131,7 +1128,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
} }
override fun onQueryTextSubmit(p0: String?): Boolean { override fun onQueryTextSubmit(p0: String?): Boolean {
maybeSearchFilter = p0
SharedItems.searchFilter = p0 SharedItems.searchFilter = p0
getElementsAccordingToTab() getElementsAccordingToTab()
fetchOnEmptyList() fetchOnEmptyList()