Merge "[Settings] Fix the layout index" into udc-dev
This commit is contained in:
@@ -26,29 +26,35 @@
|
||||
android:layoutDirection="locale"
|
||||
android:textDirection="locale">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/numberLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart">
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox"
|
||||
style="@style/LanguageCheckboxAndLabel"
|
||||
android:paddingStart="24dp"
|
||||
android:layout_toStartOf="@+id/dragHandle"
|
||||
android:layout_alignTop="@+id/miniLabel"
|
||||
android:layout_alignBottom="@+id/miniLabel" />
|
||||
android:layout_marginRight="0dp"
|
||||
android:minWidth="24dp"
|
||||
android:paddingEnd="-8dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/miniLabel"
|
||||
style="@style/LanguageCheckboxAndLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:textColor="?android:attr/colorAccent"
|
||||
android:minWidth="24sp"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_centerVertical="true"/>
|
||||
android:minWidth="24dp"
|
||||
android:gravity="center_vertical|center_horizontal"/>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:listPreferredItemHeight"
|
||||
android:paddingStart="56dp"
|
||||
android:layout_toStartOf="@+id/dragHandle">
|
||||
android:layout_toStartOf="@+id/dragHandle"
|
||||
android:layout_toEndOf="@+id/numberLayout"
|
||||
android:paddingStart="32dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -59,7 +65,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
style="@style/LanguageCheckboxAndLabel" />
|
||||
style="@style/LanguageCheckboxAndLabel"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/l10nWarn"
|
||||
@@ -86,7 +92,6 @@
|
||||
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"
|
||||
|
@@ -319,9 +319,8 @@
|
||||
</style>
|
||||
|
||||
<style name="LanguageCheckboxAndLabel">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginStart">?android:attr/listPreferredItemPaddingStart</item>
|
||||
<item name="android:textAppearance">?android:attr/textAppearanceListItem</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
|
@@ -63,13 +63,7 @@ class LocaleDragCell extends RelativeLayout {
|
||||
|
||||
public void setShowCheckbox(boolean showCheckbox) {
|
||||
// "Opposite" visibility for label / checkbox
|
||||
if (showCheckbox) {
|
||||
mCheckbox.setVisibility(VISIBLE);
|
||||
mLabel.setVisibility(INVISIBLE);
|
||||
} else {
|
||||
mCheckbox.setVisibility(INVISIBLE);
|
||||
mLabel.setVisibility(VISIBLE);
|
||||
}
|
||||
mCheckbox.setVisibility(showCheckbox ? VISIBLE : GONE);
|
||||
invalidate();
|
||||
requestLayout();
|
||||
}
|
||||
@@ -91,9 +85,7 @@ class LocaleDragCell extends RelativeLayout {
|
||||
|
||||
public void setLabelAndDescription(String labelText, String description) {
|
||||
mLabel.setText(labelText);
|
||||
mCheckbox.setText(labelText);
|
||||
mLabel.setContentDescription(description);
|
||||
mCheckbox.setContentDescription(description);
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@@ -114,6 +106,10 @@ class LocaleDragCell extends RelativeLayout {
|
||||
return mDragHandle;
|
||||
}
|
||||
|
||||
public TextView getLabelView() {
|
||||
return mLabel;
|
||||
}
|
||||
|
||||
public CheckBox getCheckbox() {
|
||||
return mCheckbox;
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ public class LocaleLinearLayoutManager extends LinearLayoutManager {
|
||||
// any language can handle it. And we want the position to be part of it.
|
||||
// So we use something like "2, French (France)"
|
||||
final String description =
|
||||
(position + 1) + ", " + dragCell.getCheckbox().getContentDescription();
|
||||
(position + 1) + ", " + dragCell.getLabelView().getContentDescription();
|
||||
info.setContentDescription(description);
|
||||
|
||||
if (mAdapter.isRemoveMode()) { // We don't move things around in remove mode
|
||||
|
Reference in New Issue
Block a user