Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Use Markdown for this comment
Set severity, which reflects how much the issue affects the use of the product
Assign issue to yourself
Pending code changes (auto-populated)
[ID: 84651]
Story points rate the relative effort of work in a Fibonacci-like format: 0, 0.5, 1, 2, 3, 5, 8, 13, 20, 40, 100. Each team will estimate work on a slightly different scale, which means the values in this field are likely only meaningful to the team that owns the Buganizer component in which the issue resides.
See Atlassian's Agile Coach for more information on how to use story points for estimation: https://www.atlassian.com/agile/project-management/estimation [ID: 746686]
Story points rate the relative effort of work in a Fibonacci-like format: 0, 0.5, 1, 2, 3, 5, 8, 13, 20, 40, 100. Each team will estimate work on a slightly different scale, which means the values in this field are likely only meaningful to the team that owns the Buganizer component in which the issue resides. See Atlassian's Agile Coach for more information on how to use story points for estimation: https://www.atlassian.com/agile/project-management/estimation [ID: 920908]
[ID: 966373]
[ID: 966375]
[ID: 966382]
Set the version(s) of the product affected by this issue (comma-separated list)
Set the version(s) of the product in which the issue should be fixed (comma-separated list)
Set the version(s) of the product in which the issue fix was verified (comma-separated list)
Set if this issue occurs in production
[ID: 85206]
Set Reporter
Set Type
Set priority, which reflects how soon the issue should be fixed
Set Status
Set Assignee
Set Verifier
Remove item
View or edit staffing
View issue level access limits(Press Alt + Right arrow for more information)
Description
Jetpack Compose BOM version: 2024.12.01
Compose Compiler Version: 1.5.15
Material Library Version (M2, M3 or Both?): Material 3
Material Compose component used: BottomSheetScaffold
Android Studio Build:
Kotlin version: 2.0.21
Steps to Reproduce or Code Sample to Reproduce:
Stack trace (if applicable): There are no error logs.
Full code:
package com.teosoft.bottomsheetpoc
import android.content.res.Configuration import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.compose.animation.core.animateIntAsState import androidx.compose.foundation.background import androidx.compose.foundation.gestures.detectVerticalDragGestures import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.BottomSheetScaffold import androidx.compose.material3.BottomSheetScaffoldState import androidx.compose.material3.Button import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Scaffold import androidx.compose.material3.SheetState import androidx.compose.material3.Text import androidx.compose.material3.rememberBottomSheetScaffoldState import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Density import androidx.compose.ui.unit.dp import com.teosoft.bottomsheetpoc.ui.theme.BottomSheetPOCTheme import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch
class MainActivity : ComponentActivity() { @OptIn(ExperimentalMaterial3Api::class) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge() setContent { BottomSheetPOCTheme {
}
enum class ExpandedType { HALF, FULL, COLLAPSED }
@OptIn(ExperimentalMaterial3Api::class) @Composable private fun BottomSheet(scope: CoroutineScope, bottomSheetScaffoldState: BottomSheetScaffoldState) { val configuration = LocalConfiguration.current val screenHeight = configuration.screenHeightDp var expandedType by remember { mutableStateOf(ExpandedType.COLLAPSED) } val height by animateIntAsState( when (expandedType) { ExpandedType.HALF -> screenHeight / 2 ExpandedType.FULL -> screenHeight ExpandedType.COLLAPSED -> 120 } )
}
@Composable fun Greeting(name: String, modifier: Modifier = Modifier) { Text( text = "Hello $name!", modifier = modifier ) }
@Preview(showBackground = true) @Composable fun GreetingPreview() { BottomSheetPOCTheme { Greeting("Android") } }