Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Insets-UI] Deprecate insets UI #1693

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/insets.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ For a more complex example, see the [`EdgeToEdgeLazyColumn`](https://github.com/

## Inset-aware layouts (`insets-ui`)

!!! warning
**This library is deprecated, with [official support](https://android-review.git.corp.google.com/c/platform/frameworks/support/+/2667875) in androidx.compose.material.** The original documentation is below.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Unfortunately, most of Compose Material's layouts do not support the use of content padding, which means that the following code probably doesn't produce the effect you want:

``` kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.accompanist.insets.ui

import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -45,6 +47,13 @@ import androidx.compose.ui.unit.dp
*
* @sample com.google.accompanist.sample.insets.BottomNavigation_Insets
*/
@Deprecated(
"""
accompanist/insets-ui has been deprecated.
This functionality has been upstreamed to Material.
For more migration information, please visit https://google.github.io/accompanist/insets/#migration
"""
)
@Composable
public fun BottomNavigation(
modifier: Modifier = Modifier,
Expand All @@ -61,6 +70,13 @@ public fun BottomNavigation(
}
}

@Deprecated(
"""
accompanist/insets-ui has been deprecated.
This functionality has been upstreamed to Material.
For more migration information, please visit https://google.github.io/accompanist/insets/#migration
"""
)
@Composable
public fun BottomNavigationSurface(
modifier: Modifier = Modifier,
Expand All @@ -79,6 +95,13 @@ public fun BottomNavigationSurface(
}
}

@Deprecated(
"""
accompanist/insets-ui has been deprecated.
This functionality has been upstreamed to Material.
For more migration information, please visit https://google.github.io/accompanist/insets/#migration
"""
)
@Composable
public fun BottomNavigationContent(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ public val LocalScaffoldPadding: ProvidableCompositionLocal<PaddingValues> =
* you're using VerticalScroller, apply this modifier to the child of the scroller, and not on
* the scroller itself.
*/
@Deprecated(
"""
accompanist/insets-ui has been deprecated.
This functionality has been upstreamed to Material.
For more migration information, please visit https://google.github.io/accompanist/insets/#migration
"""
)
@Composable
public fun Scaffold(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.accompanist.insets.ui

import androidx.compose.foundation.layout.PaddingValues
Expand All @@ -40,6 +42,13 @@ import androidx.compose.ui.unit.dp
*
* @sample com.google.accompanist.sample.insets.TopAppBar_Insets
*/
@Deprecated(
"""
accompanist/insets-ui has been deprecated.
This functionality has been upstreamed to Material.
For more migration information, please visit https://google.github.io/accompanist/insets/#migration
"""
)
@Composable
public fun TopAppBar(
title: @Composable () -> Unit,
Expand All @@ -66,6 +75,13 @@ public fun TopAppBar(
}
}

@Deprecated(
"""
accompanist/insets-ui has been deprecated.
This functionality has been upstreamed to Material.
For more migration information, please visit https://google.github.io/accompanist/insets/#migration
"""
)
@Composable
public fun TopAppBarSurface(
modifier: Modifier = Modifier,
Expand All @@ -83,6 +99,13 @@ public fun TopAppBarSurface(
)
}

@Deprecated(
"""
accompanist/insets-ui has been deprecated.
This functionality has been upstreamed to Material.
For more migration information, please visit https://google.github.io/accompanist/insets/#migration
"""
)
@Composable
public fun TopAppBarContent(
title: @Composable () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.accompanist.insets

import android.os.Build
Expand Down