material-components / material-components/material-components-android

[Motion] Container transform with Dialog (Date Range Dialog)

Open
#2,474 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Feature: Transition
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.