material-components / material-components/material-components-android
[Motion] Container transform with Dialog (Date Range Dialog)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm trying to implements material motion animation with the date range picker components :
https://material.io/components/date-pickers#mobile-pickers
My requirement is to use the container transform in order to open the full screen date range picker. In the documentation, the required example is described with the following sentence : "Switching from a mobile date range picker to a mobile date input picker". In the previous link provided.
For example : I have a fragment that launch a new ActivityB when clicking on a button. I tried to add the following code in the ActivityB onCreate method.
val dateRangePicker =
MaterialDatePicker.Builder.dateRangePicker()
.setTitleText("Select dates")
.setSelection(
Pair(
MaterialDatePicker.thisMonthInUtcMilliseconds(),
MaterialDatePicker.todayInUtcMilliseconds()
)
)
.build()
dateRangePicker.show(childFragmentManager, "tag")
Howewer, the animation is not working as expected. It only show the dialog date ranger picker without animations. Seems that the the apparition of the ActivityB and the dialog is not synchronized.
Could you give me some advices ?
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ActivityB onCreate example using MaterialDatePicker.Builder.dateRangePicker() and dateRangePicker.show(childFragmentManager, "tag"). Compare it with the linked mobile date picker documentation and investigate why the ActivityB transition and dialog appearance are not synchronized. Done means the full-screen date range picker opens with the intended container transform animation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100