Questions tagged [android-jetpack-compose-scaffold]
38 questions
35
votes
1 answer
What is Scaffold? Jetpack compose
I want to know what is Scaffold in jetpack compose with a BottomAppBar example can anyone help me
Scaffold
user14938758
32
votes
2 answers
What is the purpose of the PaddingValues parameter in a Scaffold
@Composable
fun LayoutsCodelab() {
Scaffold(
topBar = {
TopAppBar(
title = {
Text(text = "LayoutsCodelab")
}
)
}
) { innerPadding ->
…

Curious Learner
- 1,182
- 1
- 4
- 17
27
votes
5 answers
How to set the Scaffold Drawer Width in JetpackCompose?
We can have Navigation Drawer in JetpackCompose by using Scaffold as below
Scaffold(
drawerContent = { Text(text ="Drawer") }
) {}
I want to make the width of the drawer smaller. How can I do so?

Elye
- 53,639
- 54
- 212
- 474
26
votes
1 answer
Jetpack Compose Scaffold + Modal Bottom Sheet
I'm trying to design a layout using Compose that consists of:
TopAppBar
Body (content)
BottomAppBar
A Bottom Sheet that represents a menu when clicked (Modal Bottom…

Arrowsome
- 2,649
- 3
- 10
- 35
16
votes
7 answers
TopAppBar flashing when navigating with Compose Navigation
I have 2 screens which both have their own Scaffold and TopAppBar. When I navigate between them using the Jetpack Navigation Compose library, the app bar flashes. Why does it happen and how can I get rid of this?
Code:
Navigation:
@Composable
fun…

Florian Walther
- 6,237
- 5
- 46
- 104
10
votes
1 answer
Android Jetpack Compose (Composable) Get String resources from Coroutine
I have a Flow that wraps a sealed class, which is used for calling messages to the UI. For example to show a Snackbar. I can observe the Flow from a Composable using LaunchedEffect. But the problem is that I want to retrieve the string resources…

slaviboy
- 1,407
- 17
- 27
9
votes
2 answers
Animating the visibility of a BottomBar leads to "jumping" ui in Jetpack Compose
I'm writing an android-app using jetpack compose.
This app has a bottom bar which i would like to hide sometimes using an animation.
However, this proved challenging: as soon as i was dealing with a scrollable screen, there was some "jumping" of my…

m.reiter
- 1,796
- 2
- 11
- 31
7
votes
4 answers
java.lang.NoSuchFieldError: No field Companion of type Landroidx/compose/foundation/layout/BoxScope$Companion;
I'm using Jetpack Compose for the first time but I'm getting this error. I haven't figured out where the problem really is but I'm using single-activity architecture. If more information is needed, kindly inform me.
According to the error, the…

Andrew Chelix
- 1,012
- 11
- 16
6
votes
3 answers
Jetpack Compose Navigation: PopUpTo Screen from Screens that have same route except argument
navigation compose version 2.4.0-alpha06
I have a Navigation Drawer using Scaffold and part of the items are dynamically generated by ViewModel.
Example items are
Home
A
B
C
...
Settings
where A, B, C, ... all share same Screen called Category,…

Saehun Sean Oh
- 2,103
- 1
- 21
- 41
6
votes
2 answers
Jetpack compose bottom app bar dark color
I'm trying to set the navigation bar to the same color as the bottom app bar, but I don't understand where the color for the app bar comes from with the dark theme. It looks like it should be MaterialTheme.colors.primarySurface but I use…

Mackan
- 1,305
- 2
- 17
- 30
5
votes
1 answer
How can I implement Bottom sheet with BottomBar in jetpack compose
So what I am trying to achieve is:
A home composable that hosts a BottomNav Bar (Scaffold is used here )
Bottom Nav Bar is attached with 3 other composables
Each of the 3 composables has its own lazy column
Every item in the 3 lazy columns have a…

Anudeep Ananth
- 955
- 1
- 8
- 30
5
votes
1 answer
Jetpack Compose - stop focused elements from stealing back presses?
I've got some elements that have focus in a bottom sheet. I want to collapse the bottom sheet when the system back button is pressed, which is easy enough:
BackHandler(enabled = bottomSheetState.isExpanded) {
scope.launch {
…

Carter Hudson
- 1,176
- 1
- 11
- 23
4
votes
4 answers
Jetpack Compose collapse Bottom Sheet on outside click
I currently display a Bottom Sheet through a BottomSheetScaffold and want to collapse it when the user clicks outside the Bottom Sheet. Is there a way to detect the click outside of the Bottom Sheet?
This is the screen with my…

JonasLevin
- 1,592
- 1
- 20
- 50
4
votes
1 answer
Jetpack Compose TopBar and BottomBar Default Elevation content doesn't fill its container
How do I fix the topbar and bottombar doesn't fill up its container.
The topbar and bottombar uses the default Elevation respectively
You can see the Top bar doesn't fill max width and it got shadows, while the bottom bar have the text its own…

Arthur
- 318
- 1
- 4
- 11
3
votes
1 answer
How to change icon if selected and unselected in android jetpack compose for NavigationBar like selector we use in xml for selected state?
I want to use outlined and filled icons based on selected state in NavigationBar just like google maps app, using jetpack compose. In case of xml we use selector so what do we use for compose ?
Here is my code…

Vidyesh Churi
- 1,899
- 1
- 24
- 33