blob: adb1d56813fdb523234a3b21594935b9b309921f [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Global theme options for CarUi -->
<declare-styleable name="CarUi">
<!-- When set to true, the window decor will contain an OEM-customizable layout -->
<attr name="carUiBaseLayout" format="boolean"/>
<!-- When set to true, a CarUi Toolbar will be provided in the window decor -->
<attr name="carUiToolbar" format="boolean"/>
</declare-styleable>
<declare-styleable name="CarUiToolbar">
<!-- Title of the toolbar, only displayed in certain conditions -->
<attr name="title" format="string"/>
<!-- Logo drawable for the toolbar. Appears when there's no back/close button shown -->
<attr name="logo" format="reference"/>
<!-- Hint for the search bar in the toolbar -->
<attr name="searchHint" format="string"/>
<!-- Whether or not to show the MenuItems while searching. Default false. -->
<attr name="showMenuItemsWhileSearching" format="boolean"/>
<!-- Initial state of the toolbar. See the Toolbar.State enum for more information -->
<attr name="car_ui_state" format="enum">
<enum name="home" value="0"/>
<enum name="subpage" value="1"/>
<enum name="search" value="2"/>
</attr>
<!-- Whether or not the toolbar should have a background. Default true. -->
<attr name="showBackground" format="boolean"/>
<!-- Mode of the navigation button See the Toolbar.NavButtonMode enum for more information -->
<attr name="car_ui_navButtonMode" format="enum">
<enum name="back" value="0"/>
<enum name="close" value="1"/>
<enum name="down" value="2"/>
</attr>
<!-- XML resource of MenuItems. See Toolbar.setMenuItems(int) for more information. -->
<attr name="menuItems" format="reference"/>
<!-- Whether or not to show tabs in the SUBPAGE state. Default false -->
<attr name="showTabsInSubpage" format="boolean"/>
</declare-styleable>
<declare-styleable name="CarUiToolbarMenuItem">
<!-- Id of MenuItem, used to differentiate them -->
<attr name="id" format="reference"/>
<!-- Show/hide the MenuItem -->
<attr name="visible" format="boolean"/>
<!-- Set this to true to make a search MenuItem. This will override every other property except id, visible, and onclick. -->
<attr name="search" format="boolean"/>
<!-- Set this to true to make a settings MenuItem. This will override every other property except id, visible, and onclick. -->
<attr name="settings" format="boolean"/>
<!-- Title -->
<attr name="title"/>
<!-- Icon -->
<attr name="icon" format="reference"/>
<!-- True to tint the icon to a consistent color. Default true, all the other booleans default to false -->
<attr name="tinted" format="boolean"/>
<!-- Show both the icon and title at the same time -->
<attr name="showIconAndTitle" format="boolean"/>
<!-- True if this MenuItem should be a switch -->
<attr name="checkable" format="boolean"/>
<!-- Whether the switch should be checked or not. Setting this implies checkable=true -->
<attr name="checked" format="boolean"/>
<!-- True if this MenuItem should be activatable, in which case it will visually toggle states when clicked -->
<attr name="activatable" format="boolean"/>
<!-- Whether the MenuItem starts activated. Setting this implies activatable=true -->
<attr name="activated" format="boolean"/>
<!-- How to display the MenuItem. "always" means always show it on the toolbar, "never" means never show it on the toolbar and instead show it in the overflow menu -->
<attr name="displayBehavior" format="enum">
<enum name="always" value="0"/>
<enum name="never" value="1"/>
</attr>
<!-- Ux restrictions required to interact with this MenuItem -->
<attr name="uxRestrictions">
<!-- Values are copied from android.car.drivingstate.CarUxRestrictions. Note:
UX_RESTRICTIONS_BASELINE is not allowed here because it's useless and confusing. -->
<flag name="UX_RESTRICTIONS_NO_DIALPAD" value="1"/>
<flag name="UX_RESTRICTIONS_NO_FILTERING" value="2"/>
<flag name="UX_RESTRICTIONS_LIMIT_STRING_LENGTH" value="4"/>
<flag name="UX_RESTRICTIONS_NO_KEYBOARD" value="8"/>
<flag name="UX_RESTRICTIONS_NO_VIDEO" value="16"/>
<flag name="UX_RESTRICTIONS_LIMIT_CONTENT" value="32"/>
<flag name="UX_RESTRICTIONS_NO_SETUP" value="64"/>
<flag name="UX_RESTRICTIONS_NO_TEXT_MESSAGE" value="128"/>
<flag name="UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION" value="256"/>
<flag name="UX_RESTRICTIONS_FULLY_RESTRICTED" value="511"/>
</attr>
<!-- The name of a method that takes a MenuItem as an argument in you'r toolbar's Activity. Will be called when the MenuItem is clicked -->
<attr name="onClick" format="string"/>
</declare-styleable>
<!-- Theme attribute to specifying a default style for all CarUiToolbars -->
<attr name="CarUiToolbarStyle" format="reference"/>
<declare-styleable name="CarUiRecyclerView">
<!-- Whether to enable the dividers or not. Linear and grid layout uses
car_ui_recyclerview_divider.xml and car_ui_divider.xml drawables
respectively for styling dividers. -->
<attr name="enableDivider" format="boolean" />
<!-- Whether to enable rotary scrolling. Disabled by default. With rotary scrolling enabled,
rotating the rotary controller will scroll rather than moving the focus when moving the
focus would cause a lot of scrolling. Rotary scrolling should be enabled when the recycler
view contains content which the user may want to see but can't interact with, either alone
or along with interactive (focusable) content. -->
<attr name="rotaryScrollEnabled" format="boolean" />
<!-- Number of columns in a grid layout. -->
<attr name="numOfColumns" format="integer" />
<!-- car ui recycler view layout. -->
<attr name="layoutStyle" format="enum">
<!-- linear layout -->
<enum name="linear" value="0" />
<!-- grid layout -->
<enum name="grid" value="1" />
</attr>
<!-- car ui recycler view size. -->
<attr name="carUiSize" format="enum">
<enum name="small" value="0" />
<enum name="medium" value="1" />
<enum name="large" value="2" />
</attr>
<!-- car ui recyclerview orientation -->
<attr name="android:orientation" />
<!-- car ui recyclerview layout reversed -->
<attr name="reverseLayout" format="boolean" />
</declare-styleable>
<declare-styleable name="CarUiPreference">
<!-- Toggle for showing chevron -->
<attr name="showChevron" format="boolean" />
<!-- Display this preference as ux restricted. -->
<attr name="car_ui_ux_restricted" format="boolean" />
</declare-styleable>
<declare-styleable name="CarUiTwoActionPreference">
<!-- Determines if the secondary action is initially shown -->
<attr name="actionShown" format="boolean"/>
<!-- Determines if the secondary action is initially enabled -->
<attr name="actionEnabled" format="boolean"/>
</declare-styleable>
<declare-styleable name="CarUiTwoActionBasePreference">
<!-- All of these are disallowed -->
<attr name="layout" format="reference"/>
<attr name="android:layout" format="reference"/>
<attr name="widgetLayout" format="reference"/>
<attr name="android:widgetLayout" format="reference"/>
</declare-styleable>
<declare-styleable name="CarUiTwoActionTextPreference">
<attr name="secondaryActionStyle" format="enum">
<enum name="bordered" value="0"/>
<enum name="borderless" value="1"/>
</attr>
<attr name="secondaryActionText" format="string"/>
</declare-styleable>
<declare-styleable name="CarUiTwoActionIconPreference">
<attr name="secondaryActionIcon" format="reference"/>
</declare-styleable>
<!-- Adding AndroidX attr here, because it doesn't compile on google3 -->
<attr name="preferenceStyle" format="reference"/>
<!-- Theme attribute to specify a default style for all CarUiPreferences -->
<attr name="carUiPreferenceStyle" format="reference" />
<!-- Theme attribute to specify a default style for all CarUiRecyclerViews -->
<attr name="carUiRecyclerViewStyle" format="reference" />
<attr name="state_ux_restricted" format="boolean" />
</resources>