189 Commits

Author SHA1 Message Date
rightnao
dfb9e81eeb [Motion] Motion tweaks
PiperOrigin-RevId: 493105642
2022-12-06 15:22:34 -05:00
pekingme
2019bf90be [Tokens] Upgraded to version v0.147.
PiperOrigin-RevId: 492551875
2022-12-02 18:34:12 -05:00
pekingme
17e3581642 [Tokens] Upgraded to v0.145
PiperOrigin-RevId: 492291163
2022-12-02 15:11:37 +00:00
pekingme
8ee6c00f73 [Tokens] Upgraded to v0.142
Added lStar CSLs for new neutral palettes in v31 and above.

PiperOrigin-RevId: 491693724
2022-11-30 17:31:11 -05:00
pekingme
12ef329276 [Tokens] Upgraded to v0.141
PiperOrigin-RevId: 490324728
2022-11-23 15:13:20 -05:00
pekingme
b2b546b205 [Tokens] Internal updates.
PiperOrigin-RevId: 490295053
2022-11-23 15:11:19 -05:00
rightnao
1cdb371c30 [BottomSheet] Update motion attributes for bottom sheet dialog animation
PiperOrigin-RevId: 487605720
2022-11-18 16:54:23 -05:00
rightnao
e474cf4796 [BottomSheet] Token integration
PiperOrigin-RevId: 482901648
2022-10-25 05:22:05 -07:00
afohrman
1d3e374387 [Adaptive Sheets][Side Sheets] Moved behavior_draggable attribute to the resources package.
PiperOrigin-RevId: 482590917
2022-10-21 16:28:01 +00:00
rightnao
6cf56a5ebe [BottomSheet] Update elevation to match specs
PiperOrigin-RevId: 482255576
2022-10-21 16:25:14 +00:00
conradchen
f99e39df8c Automated g4 rollback of changelist 479423629
PiperOrigin-RevId: 479636961
2022-10-11 14:01:31 +00:00
rightnao
617e5822f9 [BottomSheet] Update elevation to match specs
PiperOrigin-RevId: 479423629
2022-10-11 14:00:59 +00:00
conradchen
080403173c [BottomSheet] Sync custom actions with drag handle views
Custom actions need to be set directly on the focused child views to make talkback announce the existence of those actions correctly, despite that when you open custom action menu you can actually see they are being inherited from the parent view.

Makes BottomSheetBehavior be aware of the existence of accessibility delegate views, and update the custom actions on it when needed.

PiperOrigin-RevId: 478804858
2022-10-04 20:46:34 +00:00
conradchen
6631abbdb5 [BottomSheet] Only remove round corners in M3 styles when it's fullscreen
PiperOrigin-RevId: 473065385
2022-09-12 12:26:02 -04:00
rightnao
7c56473a58 [Translations] Update string translations
PiperOrigin-RevId: 472531245
2022-09-08 13:25:10 -04:00
OxygenCobalt
158a413629 [BottomSheetBehavior] Add internal method to disable hiding gestures
Resolves https://github.com/material-components/material-components-android/pull/2880

GIT_ORIGIN_REV_ID=0dac0b3ca0daeeafca7b71d8cdef6709be17c2a4
PiperOrigin-RevId: 471809209
2022-09-02 13:00:30 -07:00
conradchen
6e6c53a4f4 [BottomSheet] Add shouldRemoveExpandedCorners attribute
PiperOrigin-RevId: 470023917
2022-08-25 15:11:36 -07:00
OxygenCobalt
2958d8d51b [BottomSheetBehavior] Add method to calculate slide offset
Resolves https://github.com/material-components/material-components-android/issues/2871
Resolves https://github.com/material-components/material-components-android/pull/2872

GIT_ORIGIN_REV_ID=de874ff649af0a6ad92340b3aad4e033bd84e933
PiperOrigin-RevId: 468521740
2022-08-19 10:57:18 -04:00
rightnao
d845db8979 [BottomSheetBehavior] Add attribute for significant velocity threshold
resolves https://github.com/material-components/material-components-android/issues/2034

PiperOrigin-RevId: 463458591
2022-07-28 17:38:16 -04:00
conradchen
ef8e9aa895 [BottomSheet] Handle half-expanded state when drag handle clicked
PiperOrigin-RevId: 461674745
2022-07-19 18:42:21 +00:00
conradchen
ac7b761294 [BottomSheet] Create a drag handle view which support accessibility control
PiperOrigin-RevId: 457939228
2022-06-29 14:38:43 +00:00
conradchen
1fe1618fca [BottomSheet] Do not find scrolling child that's not visible
Resolves https://github.com/material-components/material-components-android/issues/1834

PiperOrigin-RevId: 452813746
2022-06-03 15:42:29 -04:00
conradchen
132ff888ea [BottomSheet] Update javadoc of setHideable() method
It actually affects both swiping and setting the state programmatically. Removes the description regarding swiping to make it more accurate.

PiperOrigin-RevId: 452684555
2022-06-03 11:55:45 -07:00
conradchen
2d3024ea10 [BottomSheet] Fix BottomSheetDialog edge-to-edge mode
PiperOrigin-RevId: 452302946
2022-06-02 10:05:29 -07:00
conradchen
a9a57af629 Automated g4 rollback of changelist 452075757
PiperOrigin-RevId: 452112331
2022-05-31 13:50:56 -07:00
conradchen
fd8d30d55c [BottomSheet] Fix BottomSheetDialog edge-to-edge mode
Replace the usage of deprecated setSystemUiVisibility() with WindowCompat.setDecorFitsSystemWindows(). The original implementation will override any existing system visibility flags, so this CL also fixes the issue that certain existing system visibility settings like light navigation bar is reset.

Resolves https://github.com/material-components/material-components-android/issues/2582

PiperOrigin-RevId: 452075757
2022-05-31 13:49:38 -07:00
conradchen
53086a0533 [BottomSheet] Add back accidentally removed setLightStatusBar method and annotate it as deprecated
PiperOrigin-RevId: 450696352
2022-05-24 13:23:43 -04:00
conradchen
1a91e683a3 [BottomSheet] Fix bottom sheet dialog status bar color adjustment
This CL fixes two issues regarding bottom sheet dialog status color adjustment in edge-to-edge mode:

1. Uses WindowInsetsControllerCompat to set status bar color to replace the deprecated way of setting flags, which cannot override the light/dark setting set by WindowInsetsControllerCompat.
2. Tracks Window change so the original status bar color can be updated when the dialog is re-shown. (The day/night mode can be changed when the dialog is hidden.)

Resolves https://github.com/material-components/material-components-android/issues/2168

PiperOrigin-RevId: 450463570
2022-05-24 13:16:26 -04:00
rightnao
be1b38c30b [BottomSheet] Exposing bottom sheet hide friction with get/set methods.
PiperOrigin-RevId: 449334214
2022-05-18 11:13:08 -04:00
Bruno Coelho
4d4f3ccd8f [BottomSheetDialogFragment] Added constructor with layout ID and update appCompat version
Resolves https://github.com/material-components/material-components-android/pull/2525

GIT_ORIGIN_REV_ID=3f6c5e53830910fb98a287024731a2dfdc5e5efb
PiperOrigin-RevId: 448320717
2022-05-12 17:22:49 -04:00
pekingme
921868d31b [BottomSheet] Migrated shape appearance to new shape system.
PiperOrigin-RevId: 443484334
2022-04-25 09:27:33 -04:00
conradchen
431e291b01 [Translation] Update string translations
PiperOrigin-RevId: 443191056
2022-04-20 17:19:02 -04:00
pubiqq
3ca41be8f0 [General] Fix typos
Resolves https://github.com/material-components/material-components-android/pull/2654

GIT_ORIGIN_REV_ID=b8f6728979875629f2c813ef90d2f671cf56b4eb
PiperOrigin-RevId: 442852630
2022-04-19 14:48:55 -04:00
conradchen
e644a72aa7 Automated g4 rollback of changelist 435127325
PiperOrigin-RevId: 435152125
2022-03-17 11:40:14 -04:00
conradchen
493243ea1e [BottomSheet] Fix bottom sheets in EXPANDED state when the expanded height is the same as the collapsed height
Resolves https://github.com/material-components/material-components-android/issues/2335

PiperOrigin-RevId: 435127325
2022-03-17 11:39:42 -04:00
conradchen
04c483cf34 [CleanUp][BottomSheet] Simplify state transition logic
Reduces and restructures the calling chain when a state is set to improve readability and robustness.

This CL also introduces the following fixes:

1. Limit the possible input values of setState() and throws IllegalArgumentException if invalid values are provided.
2. Block the state to be set as HIDDEN when hideable is false.
3. Fix the bug that SettleRunnable could be posted multiple times due to isPosted flag being incorrectly set to false when the settling is still going on.
4. Fix the bug that dragging the bottom sheet when settling would result the bottom sheet in an incorrect state (the target state of settling instead of DRAGGING).

PiperOrigin-RevId: 432963533
2022-03-09 21:08:53 +00:00
conradchen
43114c4f7c [BottomSheet] Fix activity leak when setting states on destroying activities
The activity leak can happen in a corner case: setting bottom sheet state when the bottom sheet is dismissed and the host activity is closed. In this situation SettleRunnable will be posted to ViewRootImpl since the bottom sheet is not attached, which leaves references of the dismissed bottom sheet (and thus the destroyed activity) in ViewRootImpl and causes activity leak.

Fixes this by using weak reference in SettleRunnable instead of the strong reference, which is the standard practice of the BottomSheetBehavior class.

Resolves https://github.com/material-components/material-components-android/issues/1417

PiperOrigin-RevId: 430709002
2022-02-25 03:53:30 -08:00
conradchen
19af0ac9d9 [BottomSheet] Update edge-to-edge paddings when bottom sheet is laid out
Since adding bottom sheet behavior callbacks won't trigger any callbacks to be called, the bottom sheet paddings won't be updated right away. This causes the issue that top paddings are not correctly applied when the bottom sheet is initially expanded. Besides that, due to some unknown reason, bottom sheet's getTop() method will only return a non-zero value that is the offset to the container top when calling from bottom sheet behavior callbacks. It seems related to how ViewCompat.offsetTopAndBottom() is working. Not 100% sure.

Therefore this CL add a internal callback to BottomSheetCallback class so when bottom sheet is being laid out (and getting offset), we can update paddings right away.

Resolves https://github.com/material-components/material-components-android/issues/2165

PiperOrigin-RevId: 429071367
2022-02-18 15:41:23 +00:00
pekingme
1304522beb [BottomSheet] Fixed IME bottom padding is ignored in edge-to-edge case. Reverted to use deprecated getSystemWindowInsetBottom() for bottom inset to align with behaviors in 1.5.0.
Resolves: https://github.com/material-components/material-components-android/issues/2543
PiperOrigin-RevId: 428856163
2022-02-15 21:28:33 +00:00
conradchen
13dbc9f906 [BottomSheet] Support background tint without shape appearance set
Resolves https://github.com/material-components/material-components-android/issues/2200

PiperOrigin-RevId: 428781539
2022-02-15 19:26:40 +00:00
pekingme
6bf92e1c07 Automated g4 rollback of changelist 426304311
PiperOrigin-RevId: 428054428
2022-02-11 20:27:52 -08:00
pekingme
6454b8709a [BottomSheet] Fixed IME bottom padding is ignored in edge-to-edge case.
The regression on BottomSheet was introduced in 1.6.0-alpha01. Before this version, the bottom padding in edge-to-edge mode is calculated by getSystemWindowInsetBottom().

https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsetBottom()

This is deprecated in newer APIs. According to deprecation message, the replacement is to use getInsets(int) with Type#systemBars(). But this is not completely true, because it doesn't contain IME insets.

https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()

Resolves: https://github.com/material-components/material-components-android/issues/2543
PiperOrigin-RevId: 426304311
2022-02-03 21:52:22 -08:00
Material Design Team
cfc00aa5a3 Update android core class definitions across material
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
serniebanders
2e73d1a1cf [BottomSheetBehavior] Remove paddingTopSystemWindowInsets from flags checked to apply windowInsetListener
PiperOrigin-RevId: 413474393
2021-12-01 19:08:17 -05:00
Dan Nizri
e59fa50343
Revert "[BottomSheetDialogFragment] Added constructor that takes a layout ID" 2021-12-01 18:40:58 -05:00
Jose Figueroa
8c50ee2c12
Merge pull request #2237 from 4brunu/feature/bottomsheetdialogfragment-layoutid-in-constructor
[BottomSheetDialogFragment] Added constructor that takes a layout ID
2021-12-01 16:55:15 -05:00
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
serniebanders
185a0f9c92 [BottomSheetBehavior] Add margin flags to BottomSheetBehavior for system inset bars.
Updates bottom sheet styles to default to left and right margins, top and bottom padding.

Resolves: https://github.com/material-components/material-components-android/issues/2221
PiperOrigin-RevId: 410580245
2021-11-29 16:46:09 +00:00
Bruno Coelho
0b63bb76e8 Update AppCompat to 1.4.0 stable 2021-11-17 21:35:14 +00:00
serniebanders
d5729d5935 Automated g4 rollback of changelist 409212345
PiperOrigin-RevId: 409279906
2021-11-16 12:34:36 -05:00