31 Commits

Author SHA1 Message Date
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