Before, if there was any change to the layout inside BackLayerLayout while the back layer was already expanded, the developer had to manually call setExpanded(true) for it to animate to the new size.
Now, the behavior reacts automatically and animates the size change on its own, simplifying the code path and allowing more flexibility.
PiperOrigin-RevId: 165175310
This CL also changes the API from a explicit expand()/collapse() method duo to a single setExpanded(boolean) to match other expandable widgets in MDC, for consistency.
This is a breaking change but there has been no release of MDC that contains BackLayerLayout in a usable state, so this is the right time to do this kind of change.
PiperOrigin-RevId: 164664813
The content for the backlayer should be able to change in runtime to allow for multiple experiences in the backlayer. Furthermore, changing to a different experience should not imply collapsing and re-expanding the backlayer, it should happen in-place with the content layer sliding to accommodate the size of the new content.
If expand is called when the backlayer is already expanded then the backlayer
animates a possible size change.
If there is no need to change the size then the duration for the animation is
zero.
On the side, this changes BackLayer to be a LinearLayout.
PiperOrigin-RevId: 162277051
In previous code reviews there was a concern over the performance hit of
RelativeLayout's double measurement, and BackLayerLayout's own double measurement.
As a compromise we chose to use LinearLayout instead. Furthermore after
switching to LinearLayout, the EndBackLayerLayoutTest works, so this commit
also commits that new test.
PiperOrigin-RevId: 161720799
Adds concrete tests for Start, Top and Bottom backlayers.
Note: EndBackLayerLayoutTest has not been added in this CL because it is
failing over layout issues. These issues are not related directly to the core
functionality of the BackLayerLayout, but it still has to be fixed. Punting
this to a separate CL.
PiperOrigin-RevId: 161667143
-The exposure and hide actions are animated, and have before/after callbacks.
-Clicks on the content layer when the backlayer is exposed are hijacked to close the back layer.
-The animations do not relayout, by simply sliding the boundaries (bottom/left/right/top).
PiperOrigin-RevId: 160315361
These are the foundation for the back layer functionality. The behavior
does the heavy lifting to measure the adjacent content view.
As of now this only lays out the views correctly in the hidden state, it doesn't support exposing the back layer at all, yet. Full of TODOs, this is just a skeleton.
PiperOrigin-RevId: 156334640