warn the user if he has all event types filtered out

This commit is contained in:
tibbi 2023-01-10 15:54:44 +01:00
parent 0d0c797733
commit 9df5855897
3 changed files with 19 additions and 2 deletions

View File

@ -70,7 +70,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:a95c7109bd' implementation 'com.github.SimpleMobileTools:Simple-Commons:4dc76358a0'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

View File

@ -1193,6 +1193,13 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
search_results_list.adapter = null search_results_list.adapter = null
} }
val placeholderTextId = if (config.displayEventTypes.isEmpty()) {
R.string.everything_filtered_out
} else {
R.string.no_items_found
}
search_placeholder.setText(placeholderTextId)
search_placeholder_2.beVisibleIf(text.length == 1) search_placeholder_2.beVisibleIf(text.length == 1)
if (text.length >= 2) { if (text.length >= 2) {
if (search_results_list.adapter == null) { if (search_results_list.adapter == null) {

View File

@ -162,8 +162,18 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
mView.calendar_empty_list_placeholder.beVisibleIf(mEvents.isEmpty()) mView.calendar_empty_list_placeholder.beVisibleIf(mEvents.isEmpty())
mView.calendar_empty_list_placeholder_2.beVisibleIf(mEvents.isEmpty()) mView.calendar_empty_list_placeholder_2.beVisibleIf(mEvents.isEmpty())
mView.calendar_events_list.beGoneIf(mEvents.isEmpty()) mView.calendar_events_list.beGoneIf(mEvents.isEmpty())
if (activity != null) if (activity != null) {
mView.calendar_empty_list_placeholder.setTextColor(requireActivity().getProperTextColor()) mView.calendar_empty_list_placeholder.setTextColor(requireActivity().getProperTextColor())
if (mEvents.isEmpty()) {
val placeholderTextId = if (requireActivity().config.displayEventTypes.isEmpty()) {
R.string.everything_filtered_out
} else {
R.string.no_upcoming_events
}
mView.calendar_empty_list_placeholder.setText(placeholderTextId)
}
}
} }
private fun fetchPreviousPeriod() { private fun fetchPreviousPeriod() {