[TIMOB-26825] Android: Add AppBarLayout support
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, engTriage, titlebar, toolbar |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2019-02-14T20:01:46.000+0000 |
Updated | 2020-08-17T23:25:24.000+0000 |
Description
*Summary:*
Android supports an [AppBarLayout](https://developer.android.com/reference/android/support/design/widget/AppBarLayout) feature which allows the top toolbar/titlebar to hidden when scrolling up and to be stretched to reveal more content when scrolling down. This is part of Google's material design and examples of this can be seen below.
https://material.io/design/components/app-bars-top.html#behavior
*Implementation Notes:*
This is not a trivial feature to implement. It involves putting our
Toolbar
within an AppBarLayout
(that part is simple enough), but the AppBarLayout
must be a direct descendent of a CoordinatorLayout
in order for the nested scrolling to hide/show/stretch the AppBarLayout
. So, this means modifying Titanium's TiCompositeLayout
to either inherit from CompositeLayout
or replicate its features... and this is the troublesome part.
Or perhaps our implementation of this feature should be our Titanium view container for the whole thing (CompositeLayout
with a built-in AppBarLayout
and Toolbar
) and the developer would then add a ScrollView
, TableView
, or ListView
as a child to this container. This way we wouldn't have to muck with our TiCompositeLayout
code at all since any change in that class is high-risk and affects everything else.
*Hyperloop:*
There is currently an example on how to do this via hyperloop below. This can be used until Titanium has official support.
https://github.com/m1ga/hyperloop.collapsingToolbarLayout
No comments