Status Update
Comments
sg...@google.com <sg...@google.com>
bo...@google.com <bo...@google.com> #2
It would also be nice to be able to set different maxLines
for the large and small titles. For example, setting maxLines = 2
for the large title and maxLines = 1
for the small title.
This functionality is something that would also be possible with TwoRowsTopAppBar
being publicly exposed.
sg...@google.com <sg...@google.com>
sg...@google.com <sg...@google.com> #3
@Nick - Having the app bar adjust to its content height is quite tricky here, mainly when there are other constraints that involve the scroll behavior.
What we did at maxLines
will still be applied to the Text
, however, the height set up is going to be done programmatically on the top app bar you chose.
bo...@google.com <bo...@google.com> #4
@sgibly We don't really need the app bar to adjust to its content height. What we are asking for is a way to configure the title based on expanded/collapsed state. TwoRowsTopAppBar
provides a way to handle this, but is a private composable.
Our goal:
- use a slightly larger font size than the current default when in the expanded state
- allow the title to wrap 2 lines when in the expanded state
- confine the tile to a single line when in the collapsed state
As a workaround we have forked ExtraLargeTopAppBar
composable that we use throughout our application:
de...@google.com <de...@google.com> #5
Similar to this request, I would like to request just that the smallTitle
field of TwoRowsTopAppBar
is exposed in LargeTopAppBar
, defaulting to the title
composable. We currently are awkwardly manually handling the transition of large to small and back based on the collapsed fraction of the scroll state, but it seems like the title
/smalltitle
solution is already there and probably superior.
The problem that comes up with both rows of the TwoRowsTopAppBar
being set to a large title
is that on large font sizes/display sizes there is far too much white space for the invisible first app bar.
sg...@google.com <sg...@google.com>
sg...@google.com <sg...@google.com> #6
na...@google.com <na...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.4.0-alpha07
androidx.compose.material3:material3-android:1.4.0-alpha07
androidx.compose.material3:material3-jvmstubs:1.4.0-alpha07
androidx.compose.material3:material3-linuxx64stubs:1.4.0-alpha07
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
Author: Shalom Gibly <
Link:
Update the TwoRowsTopAppBar API
Expand for full commit details
Update the TwoRowsTopAppBar API
- Update the API to the feedback from the API council.
- Remove the `expanded` lambda parameter and have a separate params for
the expanded and collapsed heights.
Test: Updated
Bug: 306697446
Bug: 229134133
Bug: 268068946
Fixes: 394144086
Relnote: "Updates to the TowRowsTopAppBar API. We removed the `expanded`
lambda parameters and added separate parameters for the expanded and
collapsed heights."
Change-Id: Idd6777bc381871b9e77c040762c6bca7355cda8a
Files:
- M
compose/material3/material3/api/current.txt
- M
compose/material3/material3/api/restricted_current.txt
- M
compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/AppBarSamples.kt
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/AppBarTest.kt
- M
compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt
Hash: e414ed68307128f55615f1e482bee2212677098c
Date: Thu Feb 06 13:54:36 2025
Description
Our app is using
LargeTopAppBar
, but would like more control over typography used.More specifically, we would basically like to set the following of
TwoRowsTopAppBar
:Is
TwoRowsTopAppBar
something that could be publicly exposed?