Files
app_Settings/res/layout/locale_drag_cell.xml
Mihai Nita 8e7c75986e Add accessibility actions to the drag-and-drop locale list
Dragging is not supported neither by TalkBack or the accessibility
framework at the moment. So we need custom actions to be able
to change the order of the locales.

Also, the remove functionality is difficult to discover and use
with TalkBack only, so we are also adding a "remove" action.

It only removes one locale at the time, but most users don't
really add many locales "by mistake", so there is no real need
to delete a lot of locales at once.

Bug: 28173358
Change-Id: I3566304e3d2de87cf9243d7e87631b12d72fc929
2016-04-21 17:09:51 -07:00

83 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->
<com.android.settings.localepicker.LocaleDragCell
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:listPreferredItemHeight"
android:background="?android:colorBackground"
android:layoutDirection="locale"
android:textDirection="locale">
<CheckBox
android:id="@+id/checkbox"
style="@style/LanguageCheckboxAndLabel"
tools:text="French"
android:paddingStart="16dp"
android:layout_toStartOf="@+id/dragHandle"/>
<TextView
android:id="@+id/label"
style="@style/LanguageCheckboxAndLabel"
tools:text="French"
android:paddingStart="48dp"
android:layout_toStartOf="@+id/dragHandle"/>
<TextView
android:id="@+id/miniLabel"
style="@style/LanguageCheckboxAndLabel"
android:layout_width="wrap_content"
tools:text="22"
android:textColor="?android:attr/colorAccent"
android:minWidth="24sp"
android:gravity="center_vertical|center_horizontal"
android:layout_alignTop="@id/checkbox"
android:layout_alignBottom="@id/checkbox"/>
<TextView
android:id="@+id/l10nWarn"
style="@style/LanguageCheckboxAndLabel"
android:layout_marginTop="-28dp"
android:paddingStart="48dp"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:textColorSecondary"
android:text="@string/locale_not_translated"
android:layout_toStartOf="@+id/dragHandle"
android:layout_below="@id/label"/>
<ImageView
android:id="@+id/dragHandle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:layout_gravity="center_vertical"
android:src="@drawable/drag_handle"
android:importantForAccessibility="no"
android:layout_alignParentEnd="true"
android:layout_alignTop="@id/checkbox"
android:layout_alignBottom="@id/checkbox"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
android:layout_alignParentBottom="true"/>
</com.android.settings.localepicker.LocaleDragCell>