-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/implement UI for event filtering #224
Conversation
…into feat/implement-ui-for-event-filtering # Conflicts: # app/src/main/java/com/android/streetworkapp/MainActivity.kt # app/src/main/java/com/android/streetworkapp/ui/map/MapUi.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR!
The filters are a welcome addition to better help users narrow down specific parks.
I do have a couple suggestion to help make your code cleaner and make your filters easier and clearer to use for users
/** The default filter settings. */ | ||
companion object { | ||
val DEFAULT_RATING = 1 | ||
val DEFAULT_EVENT_DENSITY = listOf(EventDensity.LOW, EventDensity.MEDIUM, EventDensity.HIGH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems as though as though all your filters start as selected, which means that they will all be applied without user input. I don't know if this is intentional but it feels a bit misleading as when you click on a filter for the first time, you would expect it to be selected and not the contrary, i would suggest for the eventDensity
list to initally start as empty instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the default filters are the following :
- Minimum rating of 1 star (the minimum rating possible to give to a park)
- By default all kinds of event densities are accepted, giving an empty list would mean no park to display.
The sole thing which could be problematic is if when a park is added, its rating is initialized outside the allowed range [1, 5]. But I do not know how it is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What i meant is that i think it would be better to make it that your density filters all start as unselected and accept all park densities in such a default state, then if a user clicks on HIGH density for example, then it will show only the high density parks, the other way around which you are currently doing feels a bit confusing to me, this might just be a detail, if you feel the filters are fine as is i'll still approve the review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is a bad idea, because if a user does not choose to select any density, then no park will be displayed.
The current implementation will display all of the parks if the user touches nothing. Then he can opt-out some parks.
app/src/main/java/com/android/streetworkapp/utils/ParkFilter.kt
Outdated
Show resolved
Hide resolved
app/src/test/java/com/android/streetworkapp/utils/ParkFilterTest.kt
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changes!
Event filtering looks really good now
Description
This PR aims to create a pop-up in which the user can set filters for the parks in the map.
Features
Park filters
LOW
,MEDIUM
,HIGH
}New components
class ParkFilter
, which handle filtering using FilterSettings.class FilterSettings
, which store the value of each park filter setting.fun ParkFilterSettings
, which is the content of the pop-up, an interactible UI for settings of the filter.Big issues
I encountered MANY issues with the EventViewModel.
Initialy called eventViewModel.getEvent(park) then uiState => but it was always
uiState.Empty
I implemented two new eventViewModel functions
getEventsByParkList()
which callsgetEventsByEid(eid_list)
Now that the new implementation is called, the eventList remains empty all the time !
When going into
ParkOverview()
, exiting it will cause parks with events to have their event list loaded.Essentially, the filters worked only after going into
ParkOverview()
once, becacuse the event list would remain empty otherwise.I merged main with this branch, causing the
ParkOverview()
to no longer display the event list. Some calls are made which correctly load the event list, but the filters are only given empty lists. I am thinking of rolling back.Not enough time remains to fix the eventViewModel bizarre behavior, nor the main branch breaking changes. Choose to remove the following filtering features :
CREATED
,ONGOING
,FINISHED
}Tests
FilterSettings
/ParkFilter
APITesting the feature :
Screen.MAP
.