সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
আপনি আংশিকভাবে একটি নীচের শীট দেখাতে পারেন এবং তারপরে ব্যবহারকারীকে এটিকে পূর্ণ স্ক্রীন করতে বা খারিজ করতে দিতে পারেন৷
এটি করার জন্য, আপনার ModalBottomSheetskipPartiallyExpanded সেট করে false এর সাথে SheetState এর একটি উদাহরণ পাস করুন।
উদাহরণ
এই উদাহরণটি দেখায় কিভাবে আপনি ModalBottomSheet এর sheetState প্রপার্টি ব্যবহার করতে পারেন শুধুমাত্র প্রথমে আংশিকভাবে শীট প্রদর্শন করতে:
@ComposablefunPartialBottomSheet(){varshowBottomSheetbyremember{mutableStateOf(false)}valsheetState=rememberModalBottomSheetState(skipPartiallyExpanded=false,)Column(modifier=Modifier.fillMaxWidth(),horizontalAlignment=Alignment.CenterHorizontally,){Button(onClick={showBottomSheet=true}){Text("Display partial bottom sheet")}if(showBottomSheet){ModalBottomSheet(modifier=Modifier.fillMaxHeight(),sheetState=sheetState,onDismissRequest={showBottomSheet=false}){Text("Swipe up to open sheet. Swipe down to dismiss.",modifier=Modifier.padding(16.dp))}}}}
showBottomSheet অ্যাপটি নীচের শীট প্রদর্শন করে কিনা তা নিয়ন্ত্রণ করে।
sheetState হল SheetState এর একটি উদাহরণ যেখানে skipPartiallyExpanded মিথ্যা।
ModalBottomSheet একটি সংশোধক নেয় যা নিশ্চিত করে যে এটি সম্পূর্ণরূপে প্রসারিত হলে স্ক্রীনটি পূরণ করে।
ModalBottomSheet তার sheetState প্যারামিটারের মান হিসাবে sheetState নেয়।
ফলস্বরূপ, শীটটি শুধুমাত্র আংশিকভাবে প্রদর্শিত হয় যখন প্রথম খোলা হয়। ব্যবহারকারী তারপর এটিকে পূর্ণ স্ক্রীন করতে বা খারিজ করতে এটিকে টেনে বা সোয়াইপ করতে পারেন।
onDismissRequest lambda নিয়ন্ত্রণ করে যখন ব্যবহারকারী নীচের শীটটি খারিজ করার চেষ্টা করে তখন কী ঘটে। এই ক্ষেত্রে, এটি শুধুমাত্র শীট অপসারণ করে।
ফলাফল
ব্যবহারকারী যখন প্রথম বোতাম টিপে, শীটটি আংশিকভাবে প্রদর্শিত হয়:
চিত্র 1. আংশিকভাবে প্রদর্শিত নীচের শীট।
ব্যবহারকারী শীটে সোয়াইপ করলে, এটি স্ক্রীনটি পূরণ করে:
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-30 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-08-30 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["You can partially show a [bottom sheet](/develop/ui/compose/components/bottom-sheets) and then let the user either make it\nfull screen or dismiss it.\n\nTo do so, pass your [`ModalBottomSheet`](/reference/kotlin/androidx/compose/material3/package-summary#ModalBottomSheet(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.material3.SheetState,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,kotlin.Function0,kotlin.Function0,androidx.compose.material3.ModalBottomSheetProperties,kotlin.Function1)) an instance of [`SheetState`](/reference/kotlin/androidx/compose/material3/SheetState)\nwith `skipPartiallyExpanded` set to `false`.\n| **Note:** `ModalBottomSheet` is experimental. File any issues on the [issue\n| tracker](https://issuetracker.google.com/issues/new?component=856989&template=1425922).\n\nExample\n\nThis example demonstrates how you can use the `sheetState` property of\n`ModalBottomSheet` to display the sheet only partially at first:\n\n\n```kotlin\n@Composable\nfun PartialBottomSheet() {\n var showBottomSheet by remember { mutableStateOf(false) }\n val sheetState = rememberModalBottomSheetState(\n skipPartiallyExpanded = false,\n )\n\n Column(\n modifier = Modifier.fillMaxWidth(),\n horizontalAlignment = Alignment.CenterHorizontally,\n ) {\n Button(\n onClick = { showBottomSheet = true }\n ) {\n Text(\"Display partial bottom sheet\")\n }\n\n if (showBottomSheet) {\n ModalBottomSheet(\n modifier = Modifier.fillMaxHeight(),\n sheetState = sheetState,\n onDismissRequest = { showBottomSheet = false }\n ) {\n Text(\n \"Swipe up to open sheet. Swipe down to dismiss.\",\n modifier = Modifier.padding(16.dp)\n )\n }\n }\n }\n}https://github.com/android/snippets/blob/f95ab59fad80aeaf5d6a90bab8a01a126f20f44e/compose/snippets/src/main/java/com/example/compose/snippets/components/BottomSheet.kt#L41-L71\n```\n\n\u003cbr /\u003e\n\nKey points about the code\n\nIn this example, note the following:\n\n- `showBottomSheet` controls whether the app displays the bottom sheet.\n- `sheetState` is an instance of [`SheetState`](/reference/kotlin/androidx/compose/material3/SheetState) where `skipPartiallyExpanded` is false.\n- [`ModalBottomSheet`](/reference/kotlin/androidx/compose/material3/package-summary#ModalBottomSheet(kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.material3.SheetState,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,kotlin.Function0,kotlin.Function0,androidx.compose.material3.ModalBottomSheetProperties,kotlin.Function1)) takes a modifier that ensures it fills the screen when fully expanded.\n- `ModalBottomSheet` takes `sheetState` as the value for its `sheetState` parameter.\n - As a result, the sheet only partially displays when first opened. The user can then drag or swipe it to make it full screen or dismiss it.\n- The `onDismissRequest` lambda controls what happens when the user tries to dismiss the bottom sheet. In this case, it only removes the sheet.\n\nResults\n\nWhen the user first presses the button, the sheet displays partially:\n**Figure 1.** Partially displayed bottom sheet.\n\nIf the user swipes up on the sheet, it fills the screen:\n**Figure 2.** Full-screen bottom sheet. **Note:** If you set `skipPartiallyExpanded` to true, the sheet opens immediately to full screen.\n\nAdditional resources\n\n- [Bottom sheets](/develop/ui/compose/components/bottom-sheets)"]]