সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
পৃষ্ঠা নির্দেশক ব্যবহার করে, আপনি আপনার ব্যবহারকারীদের আপনার অ্যাপের বিষয়বস্তুর মধ্যে তাদের বর্তমান অবস্থান বুঝতে সাহায্য করতে পারেন, যা অগ্রগতির একটি দৃশ্যমান ইঙ্গিত প্রদান করে। এই নেভিগেশনাল ইঙ্গিতগুলি উপযোগী হয় যখন আপনি ক্রমানুসারে বিষয়বস্তু উপস্থাপন করেন, যেমন ক্যারোজেল বাস্তবায়ন, চিত্র গ্যালারী এবং স্লাইডশো, বা তালিকায় পৃষ্ঠা সংখ্যা।
সংস্করণ সামঞ্জস্য
এই বাস্তবায়নের জন্য আপনার প্রজেক্ট minSDK এপিআই লেভেল 21 বা তার উপরে সেট করা প্রয়োজন।
নির্ভরতা
একটি কাস্টম পৃষ্ঠা নির্দেশক সহ একটি অনুভূমিক পেজার তৈরি করুন
নিম্নলিখিত কোডটি একটি অনুভূমিক পেজার তৈরি করে যার একটি পৃষ্ঠা নির্দেশক রয়েছে, ব্যবহারকারীকে কতগুলি পৃষ্ঠা রয়েছে এবং কোন পৃষ্ঠাটি দৃশ্যমান তার জন্য চাক্ষুষ সংকেত দেয়:
কোডটি একটি HorizontalPager প্রয়োগ করে, যা আপনাকে বিষয়বস্তুর বিভিন্ন পৃষ্ঠার মধ্যে অনুভূমিকভাবে সোয়াইপ করতে দেয়। এই ক্ষেত্রে, প্রতিটি পৃষ্ঠা পৃষ্ঠা নম্বর প্রদর্শন করে।
rememberPagerState() ফাংশন পেজারকে আরম্ভ করে এবং পৃষ্ঠার সংখ্যা 4 এ সেট করে। এই ফাংশনটি একটি স্টেট অবজেক্ট তৈরি করে যা বর্তমান পৃষ্ঠাটিকে ট্র্যাক করে এবং আপনাকে পেজার নিয়ন্ত্রণ করতে দেয়।
pagerState.currentPage বৈশিষ্ট্যটি কোন পৃষ্ঠা নির্দেশক হাইলাইট করা উচিত তা নির্ধারণ করতে ব্যবহৃত হয়।
পৃষ্ঠা নির্দেশক একটি Row বাস্তবায়ন দ্বারা আচ্ছাদিত একটি পেজারে প্রদর্শিত হয়।
পেজারে প্রতিটি পৃষ্ঠার জন্য একটি 16 ডিপি বৃত্ত আঁকা হয়। বর্তমান পৃষ্ঠার সূচকটি DarkGray হিসাবে প্রদর্শিত হয়, যখন বাকি সূচক বৃত্তগুলি LightGray ।
HorizontalPager মধ্যে Text প্রতিটি পৃষ্ঠায় "পৃষ্ঠা: [পৃষ্ঠা নম্বর]" পাঠ্য প্রদর্শন করে।
ফলাফল
চিত্র 1. পেজার বিষয়বস্তুর অধীনে একটি বৃত্ত নির্দেশক দেখাচ্ছে।
এই নির্দেশিকা ধারণকারী সংগ্রহ
এই নির্দেশিকাটি এই কিউরেট করা কুইক গাইড সংগ্রহের অংশ যা বৃহত্তর অ্যান্ড্রয়েড উন্নয়ন লক্ষ্যগুলি কভার করে:
একটি তালিকা বা গ্রিড প্রদর্শন করুন
তালিকা এবং গ্রিডগুলি আপনার অ্যাপটিকে একটি দৃশ্যত আনন্দদায়ক আকারে সংগ্রহগুলি প্রদর্শন করার অনুমতি দেয় যা ব্যবহারকারীদের জন্য ব্যবহার করা সহজ৷
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-02-06 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-02-06 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["\u003cbr /\u003e\n\nUsing page indicators, you can help your users understand their current position\nwithin your app's content, providing a visual indication of progress. These\nnavigational cues are useful when you present content sequentially, such as\ncarousel implementations, image galleries and slideshows, or pagination in\nlists.\n\nVersion compatibility\n\nThis implementation requires that your project minSDK be set to API level 21 or\nhigher.\n\nDependencies\n\nCreate a horizontal pager with a custom page indicator\n\nThe following code creates a horizontal pager that has a page indicator, giving\nthe user visual cues for how many pages there are and which page is\nvisible:\n\n\n```kotlin\nval pagerState = rememberPagerState(pageCount = {\n 4\n})\nHorizontalPager(\n state = pagerState,\n modifier = Modifier.fillMaxSize()\n) { page -\u003e\n // Our page content\n Text(\n text = \"Page: $page\",\n )\n}\nRow(\n Modifier\n .wrapContentHeight()\n .fillMaxWidth()\n .align(Alignment.BottomCenter)\n .padding(bottom = 8.dp),\n horizontalArrangement = Arrangement.Center\n) {\n repeat(pagerState.pageCount) { iteration -\u003e\n val color = if (pagerState.currentPage == iteration) Color.DarkGray else Color.LightGray\n Box(\n modifier = Modifier\n .padding(2.dp)\n .clip(CircleShape)\n .background(color)\n .size(16.dp)\n )\n }\n}https://github.com/android/snippets/blob/30ed522851a9273c94afcd3a4c30bf674346ad18/compose/snippets/src/main/java/com/example/compose/snippets/layouts/PagerSnippets.kt#L381-L411\n```\n\n\u003cbr /\u003e\n\nKey points about the code\n\n- The code implements a [`HorizontalPager`](/reference/kotlin/androidx/compose/foundation/pager/package-summary#HorizontalPager(androidx.compose.foundation.pager.PagerState,androidx.compose.ui.Modifier,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.pager.PageSize,kotlin.Int,androidx.compose.ui.unit.Dp,androidx.compose.ui.Alignment.Vertical,androidx.compose.foundation.gestures.TargetedFlingBehavior,kotlin.Boolean,kotlin.Boolean,kotlin.Function1,androidx.compose.ui.input.nestedscroll.NestedScrollConnection,androidx.compose.foundation.gestures.snapping.SnapPosition,kotlin.Function2)), which lets you swipe horizontally between different pages of content. In this case, each page displays the page number.\n- The `rememberPagerState()` function initializes the pager and sets the number of pages to 4. This function creates a state object that tracks the current page, and lets you control the pager.\n- The [`pagerState.currentPage`](/reference/kotlin/androidx/compose/foundation/pager/PagerState#currentPage()) property is used to determine which page indicator should be highlighted.\n- The page indictator appears in a pager overlaid by a [`Row`](/reference/kotlin/androidx/compose/foundation/layout/package-summary#Row(androidx.compose.ui.Modifier,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.ui.Alignment.Vertical,kotlin.Function1)) implementation.\n- A 16 dp circle is drawn for each page in the pager. The indicator for the current page is displayed as `DarkGray`, while the rest of the indicator circles are `LightGray`.\n- The [`Text`](/reference/kotlin/androidx/compose/material/package-summary#Text(androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.text.font.FontStyle,androidx.compose.ui.text.font.FontWeight,androidx.compose.ui.text.font.FontFamily,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.text.style.TextAlign,androidx.compose.ui.unit.TextUnit,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.Int,kotlin.collections.Map,kotlin.Function1,androidx.compose.ui.text.TextStyle)) composable within the `HorizontalPager` displays the text \"Page: \\[page number\\]\" on each page.\n\nResults **Figure 1.** Pager showing a circle indicator under the content.\n\nCollections that contain this guide\n\nThis guide is part of these curated Quick Guide collections that cover\nbroader Android development goals: \n\nDisplay a list or grid \nLists and grids allow your app to display collections in a visually pleasing form that's easy for users to consume. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-a-list-or-grid) \n\nDisplay interactive components \nLearn how composable functions can enable you to easily create beautiful UI components based on the Material Design design system. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-interactive-components) \n\nHave questions or feedback \nGo to our frequently asked questions page and learn about quick guides or reach out and let us know your thoughts. \n[Go to FAQ](/quick-guides/faq) [Leave feedback](https://issuetracker.google.com/issues/new?component=1573691&template=1993320)"]]