44 Commits

Author SHA1 Message Date
hunterstich
c2051db2a9 [Internal] Avoid calling deprecated edge-to-edge APIs on 35+
Resolves https://github.com/material-components/material-components-android/issues/4626
Resolves https://github.com/material-components/material-components-android/issues/4507
Resolves https://github.com/material-components/material-components-android/issues/4732
Resolves https://github.com/material-components/material-components-android/issues/4607
Resolves https://github.com/material-components/material-components-android/pull/4883

PiperOrigin-RevId: 800945380
2025-08-29 11:48:28 -07:00
rightnao
d211909848 [BottomSheetDialog] Fix crash when protections are set before setContentView is called
PiperOrigin-RevId: 766278504
2025-06-02 20:27:28 +00:00
rightnao
e7f9f639d2 [BottomSheetDialog] Add support for androidx.core ProtectionLayout API and update dependency to 1.16
PiperOrigin-RevId: 764887825
2025-05-30 13:35:12 +00:00
Material Design Team
aaa40dbc4e Automated g4 rollback of changelist 754982643
PiperOrigin-RevId: 755433180
2025-05-07 19:31:37 +00:00
hunterstich
603f1ef9d5 [BottomSheet] Deprecated enableEdgeToEdge for bottom sheet dialogs on API 35+.
enableEdgeToEdge no longer takes effect on API 35 and above where edge-to-edge is now enforced. Use paddingLeft|Right|BottomSystemWindowInsets to automatically inset dialog content.

Resolves https://github.com/material-components/material-components-android/issues/4749
Resolves https://github.com/material-components/material-components-android/issues/4732
Resolves https://github.com/material-components/material-components-android/issues/4367

PiperOrigin-RevId: 754982643
2025-05-07 19:26:30 +00:00
Material Design Team
a0b4dfa876 [BottomSheet] Fix keyboard animation on Android 14
PiperOrigin-RevId: 752302187
2025-04-28 15:18:37 +00:00
pubiqq
bc2fdeadaf [Internal] Prefer platform methods to compat ones
Resolves https://github.com/material-components/material-components-android/pull/4532

GIT_ORIGIN_REV_ID=180dec736f2521579e483317a4d537629d8f247b
PiperOrigin-RevId: 715494344
2025-01-15 18:06:07 +00:00
pubiqq
767f25aa49 [Docs] Fix javadoc links
Resolves https://github.com/material-components/material-components-android/pull/4333

GIT_ORIGIN_REV_ID=61739e430bcda13086b83015e4054d7e318cd0d5
PiperOrigin-RevId: 700775734
2024-12-02 20:07:07 +00:00
pubiqq
23aca03255 [Internal] Remove pre-Lollipop checks
Resolves https://github.com/material-components/material-components-android/pull/4266

GIT_ORIGIN_REV_ID=1de7808e66dd6666c893217c76c7499afe2df6a3
PiperOrigin-RevId: 669688797
2024-09-03 13:31:29 +00:00
pubiqq
a89e38c0cf [BottomSheet] Recycle the TypedArray after usage
Resolves https://github.com/material-components/material-components-android/pull/4032

GIT_ORIGIN_REV_ID=f9ac4cf68c6ef7cd41d0bbdca2c7d09b0f99f5d9
PiperOrigin-RevId: 633632973
2024-05-15 16:57:50 +00:00
pubiqq
0663019f45 [Color] Add ColorStateListDrawable support
Resolves https://github.com/material-components/material-components-android/pull/3538

GIT_ORIGIN_REV_ID=1bf9e320dc148e1bc959e7577372d3a393f35574
PiperOrigin-RevId: 563258432
2023-09-07 12:37:54 +00:00
rightnao
e3b255b3a0 [Docs] Crosslink github docs in javadocs
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
dsn5ft
d6fad952c6 [Predictive Back][Bottom Sheet] Update Bottom Sheet to support predictive back
- Enable predictive back by default for Bottom Sheet dialogs
- Update Catalog demo to enable predictive back for persistent/standard bottom sheet

PiperOrigin-RevId: 518896205
2023-03-23 18:15:27 +00: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
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
Material Design Team
a487c89185 Internal change
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
dsn5ft
9ae56ceedd [Javadocs] Remove all broken attr links from Javadocs
PiperOrigin-RevId: 404246710
2021-10-20 19:06:18 +00:00
Material Design Team
030e5bd65b [BottomSheet] read the edgeToEdgeEnabled value earlier in the lifecycle
The DialogFragment will set the content view during the INITIALIZED state of the Lifecycle.  This happens prior to onCreate and currently results in the edgeToEdgeEnabled value always being false at the time the OnApplyWindowInsertListener is conditionally set.

PiperOrigin-RevId: 366294759
2021-04-01 16:46:49 -04:00
cketcham
28c3254d2a [BottomSheet] Allow opting out of edge to edge on the top
PiperOrigin-RevId: 359525223
2021-03-03 12:40:48 -05:00
cketcham
33f5aefb35 [BottomSheet] Only add OnApplyWindowInsetsListener if edgeToEdgeEnabled is true
PiperOrigin-RevId: 359407836
2021-03-03 12:40:08 -05:00
cketcham
c574e9ea23 [BottomSheet] Add flag to opt in to edge to edge behavior rather than only relying on the navigationBarColor
PiperOrigin-RevId: 347387288
2020-12-14 15:08:19 -05:00
cketcham
b1812b9a6b Internal Change
PiperOrigin-RevId: 347042445
2020-12-11 14:47:53 -05:00
cketcham
3037cf046c Automated g4 rollback of changelist 343006492
PiperOrigin-RevId: 347038837
2020-12-11 14:45:45 -05:00
cketcham
b163458a3a [BottomSheet] Updates the way BottomSheet handles insets
This updates ThemeOverlay styles to prevent drawing a transparent nav bar and updates BottomSheetBehavior and BottomSheetDialog to handle insets correctly so content isn't drawn behind the status bar or navigation bar.

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

PiperOrigin-RevId: 343006492
2020-11-18 10:40:16 -05:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
hunterstich
dce680b91a Fix BottomSheet java doc lint errors
PiperOrigin-RevId: 300605854
2020-03-13 11:13:06 -04:00
ethanhsuhsu
6c1b620565 [BottomSheetDialog] Removed existing content during each setContentView
Resolves https://github.com/material-components/material-components-android/pull/873
Resolves https://github.com/material-components/material-components-android/issues/869

GIT_ORIGIN_REV_ID=7528e645a033c00dee0eac03237eb6d87aa9d002
PiperOrigin-RevId: 288762766
2020-01-08 14:10:39 -08:00
Material Design Team
fd13d16292 Support registering multiple BottomSheetCallbacks
PiperOrigin-RevId: 271650665
2019-10-01 03:59:15 -04:00
cketcham
2e0fd6d8af Add @NonNull and @Nullable annotations
PiperOrigin-RevId: 264850918
2019-08-26 11:38:56 -04:00
cketcham
edbc7a58d2 Fix nullability of getBehavior() method
The behavior isn't available until the view has been inflated. This inflates the view if the behavior is requested before that happens.

PiperOrigin-RevId: 262551174
2019-08-16 15:38:40 -04:00
Felipe Roriz
37bb299f6e Automated g4 rollback of changelist 261796473
PiperOrigin-RevId: 261908197
2019-08-06 15:28:37 -04:00
Felipe Roriz
2c46004075 Automated g4 rollback of changelist 261764987
PiperOrigin-RevId: 261796473
2019-08-06 15:20:14 -04:00
Felipe Roriz
bede31c6b5 [BottomSheet] Updated BottomSheetDialog and Fragment dismiss animation
Resolves https://github.com/material-components/material-components-android/pull/415

GIT_ORIGIN_REV_ID=7aa46483d15c00c102b9b5c4463bf3bd331e4d15
PiperOrigin-RevId: 261764987
2019-08-06 15:18:43 -04:00
isabellekim
a628bf516b Revert the library to compile with Java 7: revert lambdas, add necessary casts, and make some variables final.
Continue compile shrine demo, catalog, and tests with Java 8.

PiperOrigin-RevId: 257874888
2019-07-15 19:19:23 -04:00
cketcham
bff75f2d3e Update to lamdas
PiperOrigin-RevId: 252846439
2019-06-18 13:21:02 -04:00
Material Design Team
3c5f9f6cb0 Migrate CoordinatorLayout android support libraries to androidx
PiperOrigin-RevId: 248819271
2019-05-21 12:03:28 -04:00
melaniegoetz
0f9b84e51f Allow public access of Behavior
PiperOrigin-RevId: 229651276
2019-01-18 14:23:51 -05:00
cketcham
dc72aaeed4 Migrate Gradle build and sources to androidx
PiperOrigin-RevId: 225551505
2018-12-21 11:07:45 -05:00
Alex Saveau
85f23d0f8d Only set BottomSheetDialog state to collapsed in onStart() if state is hidden
PiperOrigin-RevId: 194583962
2018-04-30 12:04:09 -04:00
dniz
9ca33544ac Update package name to com.google.android.material
PiperOrigin-RevId: 193236235
2018-04-30 11:24:23 -04:00