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