हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
टूलबार
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
डायलर, com.android.car.ui.toolbar.Toolbar
पैकेज नाम वाले चेसिस टूलबार का इस्तेमाल करता है.
टूलबार को पसंद के मुताबिक बनाने के लिए, सबसे पहले लेआउट फ़ाइल को ओवरले करना होगा. यह लेआउट फ़ाइल, लेगसी टूलबार के लिए car_ui_toolbar.xml
और car_ui_toolbar_two_row.xml
होती है. साथ ही, बेस लेआउट वर्शन के लिए car_ui_base_layout_toolbar.xml
होती है. लेआउट के हर वर्शन में, इनमें से हर व्यू के लिए, उनके आईडी दिए जाने चाहिए:
id |
व्यू टाइप |
ब्यौरा |
car_ui_toolbar_background /td>
| android.view.View |
बुनियादी लेआउट के लिए अब इस्तेमाल नहीं किया जाता. हालांकि, ऊंचाई तय करने के लिए, टूलबार की पिछली स्टाइल के साथ इसका इस्तेमाल किया जाता है. |
car_ui_toolbar_tabs |
com.android.car.ui.toolbar.TabLayout |
टैब की जगह. |
car_ui_toolbar_nav_icon |
android.widget.ImageView |
'वापस जाएं', 'बंद करें', और 'नीचे जाएं' बटन. |
car_ui_toolbar_logo |
android.widget.ImageView |
जब car_ui_toolbar_logo_ fills_nav_icon_space true हो, तब लोगो. |
car_ui_toolbar_nav_icon_container |
android.view.ViewGroup |
car_ui_toolbar_logo और car_ui_toolbar_nav_icon को रखने के लिए कंटेनर. |
car_ui_toolbar_menu_items_container |
android.view.ViewGroup |
MenuItems को शामिल करने के लिए ViewGroup. |
car_ui_toolbar_title |
android.widget.TextView |
टूलबार का टाइटल. |
car_ui_toolbar_title_logo_container |
android.view.ViewGroup |
car_ui_toolbar_title_logo के लिए कंटेनर. ImageView के बजाय कंटेनर दिखेगा (या छिपा रहेगा). |
car_ui_toolbar_title_logo |
android.widget.ImageView |
जब car_ui_toolbar_logo_ fills_nav_icon_space false हो, तब लोगो |
car_ui_toolbar_search_view_container |
android.widget.FrameLayout |
वह कंटेनर जिसमें खोज व्यू को बड़ा किया जाना है. इससे, खोज बार के बिना स्क्रीन पर इंफ़्लेशन की अवधि कम हो जाती है. |
car_ui_toolbar_progress_bar |
android.widget.ProgressBar |
प्रोग्रेस बार. |
इसके बाद, आपको car_ui_toolbar_search_view.xml
को भी पसंद के मुताबिक बनाना होगा. इसमें खोज बार होता है, जिसमें ये व्यू होने चाहिए:
id |
व्यू टाइप |
ब्यौरा |
car_ui_toolbar_search_bar |
android.widget.EditText |
वह EditText जहां उपयोगकर्ता खोजने के लिए टेक्स्ट टाइप करता है. |
car_ui_toolbar_search_icon |
android.widget.ImageView |
एक आइकॉन, जो आम तौर पर खोज आइकॉन दिखाता है, लेकिन ऐप्लिकेशन इसे बदल सकते हैं. |
car_ui_toolbar_search_close |
android.view.View |
ऐसा व्यू जिस पर क्लिक करने से खोज बॉक्स खाली हो जाएगा |
लेआउट के अलावा, टूलबार को पसंद के मुताबिक बनाने के लिए, इन बूलियन एट्रिब्यूट का इस्तेमाल किया जा सकता है:
एट्रिब्यूट |
ब्यौरा |
car_ui_toolbar_tabs_on_second_row |
इससे यह तय होता है कि टैब दिखाए जाने पर टाइटल छिपाना है या नहीं. |
car_ui_toolbar_nav_icon_reserve_space |
इससे यह तय होता है कि नेविगेशन आइकॉन छिपे होने पर, टाइटल को बाईं ओर ले जाकर नेविगेशन आइकॉन की जगह पर रखा जाए या नहीं. |
car_ui_toolbar_logo_fills_nav_icon_space |
अगर कोई नेविगेशन बटन मौजूद नहीं है, तो लोगो को नेविगेशन बटन के उसी स्पेस में दिखाएं. |
car_ui_toolbar_show_logo |
टूलबार में लोगो को हमेशा के लिए बंद करने के लिए, इसे false पर सेट करें. |
ये व्यू, ToolbarControllerImpl
तरीके के setState
के आधार पर दिखाए, छिपाए या बदले जाते हैं. यह जानने के लिए कि कौनसा व्यू कब दिखता है,
उस तरीके को देखें.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (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-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# Toolbar\n\nDialer uses the chassis toolbar with a package name of\n`com.android.car.ui.toolbar.Toolbar`.\n\nThe first step to customizing the toolbar is to overlay the layout file, which is\n`car_ui_toolbar.xml` and `car_ui_toolbar_two_row.xml` for the legacy toolbar,\nand `car_ui_base_layout_toolbar.xml` for the base layout version. In each version of the\nlayout, each of the following views must be provided with the respective ids:\n\n| id | View type | Description |\n|----------------------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| `car_ui_toolbar_background`/td\\\u003e | `android.view.View` | Deprecated for base layouts, but used with the previous toolbar style to determine height. |\n| `car_ui_toolbar_tabs` | `com.android.car.ui.toolbar.TabLayout` | Location of tabs. |\n| `car_ui_toolbar_nav_icon` | `android.widget.ImageView` | The Back, Close, Down button. |\n| `car_ui_toolbar_logo` | `android.widget.ImageView` | The logo, when car_ui_toolbar_logo_ fills_nav_icon_space is `true`. |\n| `car_ui_toolbar_nav_icon_container` | `android.view.ViewGroup` | A container to hold `car_ui_toolbar_logo` and `car_ui_toolbar_nav_icon`. |\n| `car_ui_toolbar_menu_items_container` | `android.view.ViewGroup` | A ViewGroup to contain MenuItems. |\n| `car_ui_toolbar_title` | `android.widget.TextView` | The title of the toolbar. |\n| `car_ui_toolbar_title_logo_container` | `android.view.ViewGroup` | A container for the `car_ui_toolbar_title_logo`. The container will be displayed (or hidden) instead of the ImageView. |\n| `car_ui_toolbar_title_logo` | `android.widget.ImageView` | The logo, when car_ui_toolbar_logo_ fills_nav_icon_space is `false` |\n| `car_ui_toolbar_search_view_container` | `android.widget.FrameLayout` | A container into which the search view is to be inflated. This reduces inflation durations on screens without Search bars. |\n| `car_ui_toolbar_progress_bar` | `android.widget.ProgressBar` | A progress bar. |\n\nNext, you must also customize `car_ui_toolbar_search_view.xml`, which contains the\nSearch bar, which must have the following views:\n\n| id | View type | Description |\n|-------------------------------|----------------------------|--------------------------------------------------------------------------------|\n| `car_ui_toolbar_search_bar` | `android.widget.EditText` | The EditText where the user types text to search. |\n| `car_ui_toolbar_search_icon` | `android.widget.ImageView` | An icon, that normally shows a search icon but can be changed by applications. |\n| `car_ui_toolbar_search_close` | `android.view.View` | A view that when clicked will clear the search box |\n\nIn addition to the layout, you can use these Boolean attributes to customize the toolbar:\n\n| Attribute | Description |\n|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `car_ui_toolbar_tabs_on_second_row` | Determines whether or not to hide the title when tabs are displayed. |\n| `car_ui_toolbar_nav_icon_reserve_space` | Determines if the title should be moved to the left to occupy the space of the Navigation icon when the Navigation icon is hidden. |\n| `car_ui_toolbar_logo_fills_nav_icon_space` | Display the logo in the same space as the Navigation button when no Navigation button is present. |\n| `car_ui_toolbar_show_logo` | To permanently disable the display of a logo in the toolbar, set this to `false`. |\n\nThese views are displayed, hidden, or changed based on the `setState` of the\n`ToolbarControllerImpl` method. For specifics about which view is displayed and when,\nsee that method."]]