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
Time Selection Feature #15128
Time Selection Feature #15128
Conversation
Implemented time selection for blogging reminders
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can test the changes on this Pull Request by downloading the APKs: |
Needs an update to FluxC in a separate PR here |
Thanks for the changes! I'm not sure if this is ready for review, but I've taken a quick look and it seems that the time picker is behaving a bit weirdly after I dismiss it by tapping on the outside:
video.7.mp4
Also, I noticed that the time formatting is not following my current locale?
Let me know if this is ready for a proper review, so I can take a deeper look at the code as well.
Thanks @renanferrari for a quick look. Good catch on the issue. Looks like if the time picker is cancelled, then it is not dismissing the dialog. Unfortunately, I couldn't use material MaterialTimePicker even after upgrading material version. MaterialTimePicker is crashing due to bridge theme in use in the app. I've now fixed the issue with Cancel of TimePicker. You can may be review this after I merge the FluxC PR first, then update this one. Thanks |
Thanks for the changes! After testing, it seems that the dialog behavior is still there if we press the back button. I've taken a look at the code and left a few suggestions below. Let me know what you think.
.../main/java/org/wordpress/android/ui/bloggingreminders/BloggingReminderBottomSheetFragment.kt
Outdated
Show resolved
Hide resolved
...Press/src/main/java/org/wordpress/android/ui/bloggingreminders/BloggingReminderTimePicker.kt
Outdated
Show resolved
Hide resolved
fun newInstance(hour: Int, minute: Int): BloggingReminderTimePicker { | ||
return BloggingReminderTimePicker().apply { | ||
arguments = Bundle().apply { | ||
putInt(ARG_HOUR, hour) | ||
putInt(ARG_MINUTE, minute) | ||
} | ||
} | ||
} |
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 that we're not using these arguments anywhere yet. I imagine you're planning to use them to pass the currently selected time to the dialog? If so, I think that's the way to go
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.
Yes, once I merge the FluxC PR
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.
Removed the arguments now, no longer needed as time and hour are available after FluxC update
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 believe we should still pass the currently selected time to the dialog. If we don't, the time picker will display a different time from the one that's being displayed on the bottom sheet:
notification-time.mp4
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.
Updated to reflect current time selection on the picker after merging FluxC PR
@@ -44,5 +52,11 @@ sealed class BloggingRemindersItem(val type: Type) { | |||
data class DayItem(val text: UiString, val isSelected: Boolean, val onClick: ListItemInteraction) | |||
} | |||
|
|||
data class TimeItem( | |||
val time: UiString, | |||
val isInvisible: Boolean = false, |
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 looks like isInvisible
is not being used anywhere?
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.
Need to seek clarification on this one. We had discussion if you remember, whether the time selection should always be displayed or only after a day selection is made. If we decide to default to display always, then this can be removed
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.
Update it now, to be visible only when at least a day is selected
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'm not sure what's the best approach here, but the way we are currently hiding the item looks quite weird IMHO:
notification-time-visibility.mp4
If we want to hide that, we should consider conditionally adding this TimeItem
to the list instead of hiding its content. Personally, I'd probably just default to always show it, though.
Either way, we should probably ask for a design review here. You can do that by adding the "Needs design review" label and/or pinging a designer yourself.
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.
Yeah, Chris is AFK, will ask next week when he returns. For now, made TimeItem conditional. Thanks
WordPress/src/main/java/org/wordpress/android/ui/bloggingreminders/BloggingRemindersUiModel.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/bloggingreminders/BloggingRemindersUiModel.kt
Outdated
Show resolved
Hide resolved
...ress/src/main/java/org/wordpress/android/ui/bloggingreminders/BloggingRemindersViewHolder.kt
Outdated
Show resolved
Hide resolved
refactored time picker handling
Fix ciktlint issue
Left a few more comments above. Let me know if you need a hand with anything!
WordPress/src/main/java/org/wordpress/android/workers/reminder/ReminderScheduler.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/bloggingreminders/DaySelectionBuilder.kt
Outdated
Show resolved
Hide resolved
Refactored and updated after merging FluxC PR
Track time selection feature by adding a selected_time property to the blogging_reminders_scheduled event
Great work!
LGTM
Feel free to merge this after resolving the merge conflicts. I think we can address any design issues separately as well, but it's up to you.
fix lint checks
…vents-for-blogging-reminders-v2 Add tracking for time selection
with FluxCVersion
Hey @renanferrari @ravishanker I had a think about the time display when the user has not selected any days yet. What if we display it but disabled until days are selected? Then we follow the same rational that its not interactive before days are selected, but, the UI doesn't jump when it becomes active. WDYT? The only thing I wasn't sure is if we should display the default time, or no time, before a day is selected. I also thought Ravi had a nice idea about using a button style for the time to make it more clear that its interactive. Here's a quick mock. I think it looks pretty nice but I'm not sure if its ok to put a text button in a list item like this? |
As discussed elsewhere, we have good reason for 'hiding' rather than disabling the time initially. So we can ignore my above suggestion for now! |
ravishanker commentedAug 4, 2021
•
edited
Loading
Implemented time selection for blogging reminders
Fixes #15123
To test:
Regression Notes
Potential unintended areas of impact
Reminder scheduling
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing
What automated tests I added (or what prevented me from doing so)
Unit testing
PR submission checklist:
RELEASE-NOTES.txt
if necessary.The text was updated successfully, but these errors were encountered: