- Settings header is restricted scrolling by this ag/15029686
- To void some pages can't show the contain part while heading unscrolling.
We allow the header can be scrolling in the landscape mode.
Fixes: 207353353
Test: make RunSettingsRoboTests -j
Change-Id: I7de4e7cb8d86516ec039f5fe7d033097dca1c9d8
To have the modules merged to SettingsLibWidget, we changed the package
name in the Manifest to com.android.settingslib.widget
Test: WallpapaerPickerGoogle can successfully built after the merge of
modules
Bug: 240421545
Change-Id: If9eb4cefaa22c71eb8dad32618e84e1102c599df
-Set collapsing toolbar background as transparent.
-Let header and preference contain use the same background.
Bug: 230230017
Test: manual test
Change-Id: I3152d93b2ac34d73c2f877e719ea3c865a7ce58b
- Add this widget which is wrapping the collapsing toolbar.
- This new widget can be directly used by the AppCompatActivity.
Bug: 215463210
Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=com.android.settingslib.collapsingtoolbar
Change-Id: Id5ab5ff10ac691b8ff2997a0635f0047c1fa4f75
Allows for better code reuse across Activity and Fragment
All Activities/Fragments simply delegate to the helper class making them easy to maintain.
Bug: 211847783
Test: robotest
Change-Id: If863484c093069c653c7c6b9bd4ccc77f3eafad5
The original title color seems to be set incorrectly for all OEM
devices except for Pixel. This change stabilizes the color.
Bug: 196106314
Bug: 196614394
Test: manual test
Change-Id: I2b9f7ddec17d1d447cb7348e8f96cabb81e2e229
The change replaces all existing usage of private resources in
SettingsLib with corresponding public resources. The only exception
is android:string/config_headlineFontFamily where there's no proper
replaccement.
The library is currently used by bundled apps (such as SettingsGoogle)
and unbundled apps (such as PermissionController and
CellBroadcastReceiver). Since we still want these bundled apps to
reference config_headlineFontFamily properly while not breaking
unbundled apps due to them referencing private attributes, we added a
new attribute settingslib_config_headlineFontFamily (alongside with
other FontFamily variance for completeness) in
SettingsTheme/res/values-v31/strings.xml which points to
config_headlineFontFamily by default. Then, in separate CLs, we will add
resource overrides to these unbundled apps to replace the value of
settingslib_config_headlineFontFamily to point to a public value. While
this means that the style of the pages from the unbundled apps will be
different from the rest of SettingsLib clients, the change provides a
tactical fix to make sure that these unbundled apps won't crash when
shipped to other devices. We can address the issue at its core by
potentially exposing some private resources in future Android releases.
Bug: 191387775
Bug: 190964071
Bug: 196106314
Test: manual test to confirm this is a no-op CL.
Change-Id: Ie25950d9f54964aa40038a27b302ed017e4e4d15
We introduced the collapsing toolbar on S. To enable this feature needs
to correspondingly adjust the theme that the activity uses. However
these changes might cause some mainline module apps get crashed when
running on R. A customize layout is allowed to use for some cases that
need to roll back to the layout used in R.
Bug: 192395187
Test: visual verified
Change-Id: I9b409842198a2d52a6440cdd9ad68268293681f2
The view with R.id.content_parent is a LinearLayout in the R layout
file, and will cause a ClassCastException on R.
Bug: 182960931
Bug: 183757373
Test: presubmit
Change-Id: I15bf8f14ac1e6b0986b040e25a2b5f57735b62a8
The current dynamic height adjusting workaround might cause that a
flicker problem happens in the collapsing toolbar and it might cause
that the collapsing toolbar has different background colors in some
setting pages. The new Material library has already supported the
dynamic height adjusting for multi-line titles, so we will use the new
mechanism instead.
Fix: 191038325
Fix: 189896657
Test: visual verified
1) Navigate to permission pages
2) Observe the title and check if it has different background color and
is overlapping with the back arrow
Change-Id: Ib928ab628cb7838460264f704bebf5c7a2aa9a47
Since there is a problem with a small line spacing between multiline
title of collapsing toolbar in a few locales, that caused the title is
overlapping with each other. Enlarging the line spacing by using
lineSpacingMultiplier to fix it.
Fix: 183223866
Test: visual verified
1) Change to MY locale
2) Navigate to Settings > Sounds & vibration > Do not disturb > Alarms &
other interruptions
3) Observe the title and check if it is overlapping with each other
Change-Id: Ib35ae0edb6fb168293bdb39a926bad5049eece34
Since SettingsTransitionActivity is reverted, make
CollapsingToolbarBaseActivity extend FragmentActivity directly.
Bug: 191335572
Test: rebuild
Change-Id: I6eda699ec97f11f5a89a4bce7be041960c5d6e32
Providing an API to access to the instance of CoordinatorLayout in
collapsing_toolbar_base_layout, that facilitates the insertion of
components as a direct child of CoordinatorLayout.
Bug: 189423430
Test: rebuild permission controller apk
Change-Id: Iebd7a6cd0cb5bdc38c70343a86736e91f58ce254
The height of top app bar area is dependent on the line count of title.
This mechanism is always triggered when entering either subsetting page
or rotating the screen, regardless the state of collapsing toolbar. That
is saying this mechanism caused a flicker problem or a title in wrong
color. The mechanism will be updated to check the state of collapsing
toolbar to make sure that it is only triggered if the collapsing toolbar
is in expanded state.
This changes also added null checker to app bar since there's no
AppBarLayout existing in the older version of Android.
Fix: 186419089
Fix: 187709056
Fix: 191746368
Test: visual verified
1) Navigate to a subsetting page with multiline title
2) Rotate the screen to landscape mode and collapse the title
3) Rotate the screen to portrait mode and see if the title is in
collapsing state
Change-Id: Ica868245e0b0a799f76b7f953c606c8e543375f6
Fix: 177967930
Test: visual verified
1) Navigate to either sub-setting page
2) Rotate the screen to landscape mode
3) See if the size of title is the same as the one in portrait mode
Change-Id: I91621b6be298ae886432d3b06996be0ccc7b974c
We intended to make subsetting pages disable the scrolling behavior
within the collapsing toolbar area. The collapsing toolbar is still
able to be expanded/collapsed depending on the content of page.
Fix: 191614437
Fix: 189003332
Test: manual test
Cannot scroll/drag with the collapsing toolbar area
Change-Id: Ifa545a1720c64be742f85b34188516eb9c6683df
- Updating the height of title area to fulfill the spec
- Increasing the trigger points of animation for fade mode based
on the line count of title, so the overlapping problem is
prevented from the title scrolling up the title area
- Removing getLineCountWithReflection method since
CollapsingToolbarLayout has already been supporting this method
Fix: 188608451
Fix: 189068911
Test: visual verified
Change-Id: I8dac87458f13d79e1941a4f2b3e961ac4d6a2944
Set transitionGroup to the whole page layout so all the content could be
animated in together.
Fixes: 189417218
Test: rebuild and launch All apps page
Change-Id: Ib584fc9ea272b9c61aec3067440fe95435220735
Some pages are not suitable to apply the page transition, for example,
launching an acitivity that is depending on a value in the config file.
External apps that are not applying the same transition may be launched
in this case, applying the transition may lead to some unexpected
behaviour.
Hence, create a way to ignore the transition. Also refactor some logics.
Fixes: 189299479
Test: rebuild
Change-Id: Iebb47b9e0b0d9a3496f7e5f0c6cf1cd3d8d75031
- Allow subclass to override when the transition should be enabled,
because we may not want to enable it on other form factors, e.g. on
wear.
- Retrieve the Toolbar instance by overriding setActionBar() which
should be called by any activity using Toolbar as its action bar. Even
if there's any activity not using Toolbar as action bar, it won't
behave well with our transition anyway.
- Refactored ActivityOptions Bundle creation logic to simplify the
code. I did the refactoring originally for sharing it with a new
SettingsTransitionFragment, but then realized doing it in fragment
would be very tedious and unreliable. Still the refactoring looks a
good simplification to me.
- Don't override onOptionsItemSelected() in SettingsTransitionActivity
because different form factors might be expecting different behaviors
for the home/up indicator on Toolbar, e.g. we might expand/collapse a
drawer or do something else instead of finishing the current activity
on Tablet.
The original implementation that calls onBackPressed() is also
technically incorrect because pressing up is a different action. The
reason the original implementation did so is probably for enabling
transition upon activity finish, but that should actually be done by
calling finishAfterTransition(), so I've fixed the
CollapsingToolbarBaseActivity to call finishAfterTransition() instead
of finish(). This shouldn't bring any regression to existing users of
SettingsTransitionActivity as well because currently the only user of
it is CollapsingToolbarBaseActivity.
Bug: 177638625
Test: manually on R and S platforms
Change-Id: I3c5955db3753f00604b625bd21bf7e78f237ec15
Use Bundle.putAll() to take both the bundle passed in to the
startActivity(Intent, Bundle) and also the new created ActivityOptions
bundle, so no extra info will be lost.
Test: rebuild and add log to make sure all bundle info are kept
Bug: 187471344
Change-Id: I802e17893b86fd4eacb812b4a7ab20b5167790fe
After enabling the view attribute inspection, Settings always gets
crashed when entering any sub-setting pages. It's due to the undefined
value set in the app:statusBarScrim.
Using app:statusBarScrim="@empty" is trying to clear the
CollapsingToolbarLayout's default statusBarScrim. So the value of the
attribute can be replaced with other value that indicated null. This
change also needs to make sure the collapsing toolbar leaves the same
behavior as the one before changing. Eventually we use
app:statusBarScrim="@null" instead to fix this issue.
Fix: 186055380
Test: manual test
1) Enable developer options
2) Settings > System > Developer options
3) Enable view attribute inspection
4) See if Settings gets crashed
Change-Id: Ic829bb11b67d5cfd4de626f79d4a5c3e0ebd8e67
During the page transition, the back arrow on the action bar is acting
as a shared element. The transition seems to render the shared element
first and then the other parts of the UI. As the background color of the
AppBarLayout is transparent, so during the rendering process, the UI
will flash/blink for a few milliseconds and the content behind the
AppBarLayout will be shown.
Hence, set a background color to the AppBarLayout to fix this issue.
Fixes: 186701900
Test: rebuild and review Display Settings page transition
Change-Id: Id009b47d983adafd8b92af585b5089c68de0afc3
Since collapsing toolbar might load the font asynchronously, it caused
that some settings pages are seeing a flicker on its title. This change
is using TextAppearanceConfig.setShouldLoadFontSynchronously(true)
method to have title font load synchronously, which would remove the
flicker problem.
Bug: 182232144
Test: visual verified
1) Settings > Notifications > Notification history
2) See if there's a flicker on title
Change-Id: I80f5c5862ea6408bfb372d61a11122fb0240e45d
As the framework bug is fixed, re-enable the transition by correcting
the conditions.
Bug: 177480673
Test: rebuild and test on the NotificaitonHistory page
Change-Id: Icb62dad12ba5889f750d0ea2765ae76186fc79e7
Bug: 183496853
Test: visual verified
1) Settings -> Notifications -> Notification history
2) Observe and see if the new animation is applied
Change-Id: Ic4b584b10a27c8e17075b044e659b5dc3e3fec87
SettingsTransitionActivity is an abstract activity being in charge of
the transition feature. Activities extending it will get settings
transition applied.
We make CollapsingToolbarBaseActivity extend this activity. Clients
extending CollapsingToolbarBaseActivity will have both app bar behaviour
and the transition applied.
Also add android:transitionName into the collapsing layout, so the
transition would start from the back arrow on the action bar.
And bump the min_sdk to 29 to relevant dependencies.
Bug: 177480673
Test: rebuild and apply it on NotificationHistoryActivity
Change-Id: I8e070a0f07080d027fec7b944bdcdbb758ae44b7
In apps following the pattern to do all the things in fragments, and
possibly loading different fragments for different form factors, their
activity would need to remain a stub and can't contain phone-only
layout, making CollapsingToolbarBaseActivity unsuitable for them. So
add a CollapsingToolbarBaseFragment for integrating the same
functionality in fragments.
The layout files are also moved to be under the same name, but
different content depending on the platform version, to simplify the
logic loading them.
Bug: 177638625
Test: manual
Change-Id: Ie9e2a147dd4bd2c1ee3924b1afc4c10a6f735e59