Merge changes I60d2b23a,I7cb15a46 into main
* changes: [Accessibility] Color Contrast address talkback bugs [Accessibility] Color Contrast address UX bugs
This commit is contained in:
@@ -21,17 +21,17 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/color_contrast_preview_background"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
android:paddingLeft="24dp"
|
android:paddingLeft="24dp"
|
||||||
android:paddingRight="24dp"
|
android:paddingRight="24dp"
|
||||||
android:paddingBottom="24dp"
|
android:paddingBottom="24dp">
|
||||||
android:background="@drawable/color_contrast_preview_background">
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/preview_background"
|
android:id="@+id/preview_background"
|
||||||
android:background="?androidprv:attr/materialColorSurface"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:background="?androidprv:attr/materialColorSurface"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/bottom_appbar_background"
|
app:layout_constraintBottom_toTopOf="@+id/bottom_appbar_background"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -41,21 +41,20 @@
|
|||||||
android:id="@+id/preview"
|
android:id="@+id/preview"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/color_contrast_preview"
|
||||||
|
android:textColor="?androidprv:attr/textColorPrimary"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
android:textColor="?androidprv:attr/textColorPrimary"
|
|
||||||
android:text="@string/color_contrast_preview" />
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/email_background"
|
android:id="@+id/email_background"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginLeft="12dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
android:layout_marginRight="12dp"
|
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:background="@drawable/color_contrast_preview_dialog_background"
|
android:background="@drawable/color_contrast_preview_dialog_background"
|
||||||
@@ -66,88 +65,137 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_group"
|
android:id="@+id/ic_group"
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="14dp"
|
||||||
android:layout_marginTop="14dp"
|
android:layout_marginTop="14dp"
|
||||||
android:layout_marginLeft="14dp"
|
android:background="@drawable/color_contrast_preview_icon_group_background"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:src="@drawable/ic_group_24dp"
|
android:src="@drawable/ic_group_24dp"
|
||||||
android:background="@drawable/color_contrast_preview_icon_group_background"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/email_background"
|
app:layout_constraintStart_toStartOf="@+id/email_background"
|
||||||
app:layout_constraintTop_toTopOf="@+id/email_background" />
|
app:layout_constraintTop_toTopOf="@+id/email_background" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/email_header"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="17dp"
|
||||||
|
app:layout_constrainedWidth="true"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/ic_star"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/ic_group"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/email_background">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sender_name"
|
android:id="@+id/sender_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="8dp"
|
android:ellipsize="end"
|
||||||
android:layout_marginTop="17dp"
|
android:maxLines="1"
|
||||||
|
android:paddingEnd="10dp"
|
||||||
|
android:text="@string/color_contrast_preview_sender_name"
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurface"
|
android:textColor="?androidprv:attr/materialColorOnSurface"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintStart_toEndOf="@+id/ic_group"
|
app:layout_constraintEnd_toStartOf="@+id/email_tag"
|
||||||
app:layout_constraintTop_toTopOf="@+id/email_background"
|
app:layout_constraintHorizontal_bias="0"
|
||||||
android:text="@string/color_contrast_preview_sender_name" />
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintWidth_default="percent"
|
||||||
|
app:layout_constraintWidth_max="wrap"
|
||||||
|
app:layout_constraintWidth_percent="0.5" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/email_tag"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/color_contrast_preview_tag_background"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:paddingHorizontal="4dp"
|
||||||
|
android:text="@string/color_contrast_preview_email_badge"
|
||||||
|
android:textColor="?androidprv:attr/materialColorOnSurface"
|
||||||
|
android:textSize="11sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/sender_name"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/sender_name"
|
||||||
|
app:layout_constraintWidth_default="percent"
|
||||||
|
app:layout_constraintWidth_max="wrap"
|
||||||
|
app:layout_constraintWidth_percent="0.5" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/date"
|
android:id="@+id/date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/color_contrast_preview_email_send_date"
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"
|
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"
|
||||||
android:textSize="11sp"
|
android:textSize="11sp"
|
||||||
app:layout_constraintStart_toStartOf="@+id/sender_name"
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/sender_name"
|
app:layout_constraintEnd_toEndOf="@+id/email_background"
|
||||||
android:text="@string/color_contrast_preview_email_send_date" />
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/email_header"
|
||||||
<TextView
|
app:layout_constraintTop_toBottomOf="@+id/email_header" />
|
||||||
android:id="@+id/email_tag"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:paddingHorizontal="4dp"
|
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurface"
|
|
||||||
android:background="@drawable/color_contrast_preview_tag_background"
|
|
||||||
android:textSize="11sp"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/sender_name"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/sender_name"
|
|
||||||
android:text="@string/color_contrast_preview_email_badge" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_star"
|
android:id="@+id/ic_star"
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="14dp"
|
android:layout_marginTop="14dp"
|
||||||
android:layout_marginRight="14dp"
|
android:layout_marginEnd="14dp"
|
||||||
|
android:background="@drawable/color_contrast_preview_icon_star_background"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:src="@drawable/ic_star_24dp"
|
android:src="@drawable/ic_star_24dp"
|
||||||
android:background="@drawable/color_contrast_preview_icon_star_background"
|
|
||||||
app:layout_constraintEnd_toEndOf="@+id/email_background"
|
app:layout_constraintEnd_toEndOf="@+id/email_background"
|
||||||
app:layout_constraintTop_toTopOf="@+id/email_background" />
|
app:layout_constraintTop_toTopOf="@+id/email_background" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/email_main_background"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginHorizontal="14dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/email_background"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/email_background"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/email_background"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/date" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/email_title"
|
android:id="@+id/email_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="14dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginTop="62dp"
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/color_contrast_preview_email_title"
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurface"
|
android:textColor="?androidprv:attr/materialColorOnSurface"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
app:layout_constraintStart_toStartOf="@+id/email_background"
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintTop_toTopOf="@+id/email_background"
|
app:layout_constraintEnd_toEndOf="@+id/email_main_background"
|
||||||
android:text="@string/color_contrast_preview_email_title" />
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/email_main_background"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/email_main_background" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/email_body"
|
android:id="@+id/email_body"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:text="@string/color_contrast_preview_email_body"
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"
|
android:textColor="?androidprv:attr/materialColorOnSurfaceVariant"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:paddingBottom="8dp"
|
app:layout_constrainedWidth="true"
|
||||||
android:maxLines="2"
|
app:layout_constraintEnd_toEndOf="@+id/email_main_background"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
app:layout_constraintStart_toStartOf="@+id/email_title"
|
app:layout_constraintStart_toStartOf="@+id/email_title"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/email_title"
|
app:layout_constraintTop_toBottomOf="@+id/email_title" />
|
||||||
android:text="@string/color_contrast_preview_email_body" />
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/attachment_background"
|
android:id="@+id/attachment_background"
|
||||||
@@ -161,13 +209,13 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_article_filled"
|
android:id="@+id/ic_article_filled"
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_article_filled_24dp"
|
android:contentDescription="@null"
|
||||||
|
android:paddingVertical="6dp"
|
||||||
android:paddingStart="8dp"
|
android:paddingStart="8dp"
|
||||||
android:paddingEnd="6dp"
|
android:paddingEnd="6dp"
|
||||||
android:paddingVertical="6dp"
|
android:src="@drawable/ic_article_filled_24dp"
|
||||||
app:layout_constraintStart_toStartOf="@+id/email_title"
|
app:layout_constraintStart_toStartOf="@+id/email_title"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/email_body" />
|
app:layout_constraintTop_toBottomOf="@+id/email_body" />
|
||||||
|
|
||||||
@@ -175,25 +223,31 @@
|
|||||||
android:id="@+id/email_attachment"
|
android:id="@+id/email_attachment"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingEnd="10dp"
|
android:paddingEnd="10dp"
|
||||||
|
android:text="@string/color_contrast_preview_email_attachment_name"
|
||||||
android:textColor="?androidprv:attr/materialColorOnTertiaryContainer"
|
android:textColor="?androidprv:attr/materialColorOnTertiaryContainer"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintStart_toEndOf="@+id/ic_article_filled"
|
app:layout_constrainedWidth="true"
|
||||||
app:layout_constraintTop_toTopOf="@+id/attachment_background"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/attachment_background"
|
app:layout_constraintBottom_toBottomOf="@+id/attachment_background"
|
||||||
android:text="@string/color_contrast_preview_email_attachment_name" />
|
app:layout_constraintEnd_toStartOf="@+id/ic_edit"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/ic_article_filled"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/attachment_background" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_edit"
|
android:id="@+id/ic_edit"
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginBottom="-8dp"
|
||||||
|
android:background="@drawable/color_contrast_preview_icon_edit_background"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:padding="27dp"
|
android:padding="27dp"
|
||||||
android:src="@drawable/ic_edit_24dp"
|
android:src="@drawable/ic_edit_24dp"
|
||||||
android:background="@drawable/color_contrast_preview_icon_edit_background"
|
app:layout_constraintBottom_toBottomOf="@+id/email_background"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/email_background"
|
app:layout_constraintEnd_toEndOf="@+id/email_background" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ic_star" />
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/bottom_appbar_background"
|
android:id="@+id/bottom_appbar_background"
|
||||||
@@ -206,9 +260,9 @@
|
|||||||
app:layout_constraintTop_toTopOf="@+id/ic_inbox" />
|
app:layout_constraintTop_toTopOf="@+id/ic_inbox" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:src="@drawable/color_contrast_preview_icon_inbox_background"
|
android:src="@drawable/color_contrast_preview_icon_inbox_background"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/ic_inbox"
|
app:layout_constraintBottom_toBottomOf="@+id/ic_inbox"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/ic_inbox"
|
app:layout_constraintEnd_toEndOf="@+id/ic_inbox"
|
||||||
@@ -217,38 +271,38 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_inbox"
|
android:id="@+id/ic_inbox"
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="42dp"
|
android:layout_marginTop="42dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
android:src="@drawable/ic_inbox_24dp"
|
android:src="@drawable/ic_inbox_24dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/ic_article"
|
app:layout_constraintEnd_toStartOf="@+id/ic_article"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ic_article_filled" />
|
app:layout_constraintTop_toBottomOf="@+id/ic_article_filled" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_article"
|
android:id="@+id/ic_article"
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
android:src="@drawable/ic_article_24dp"
|
android:src="@drawable/ic_article_24dp"
|
||||||
app:layout_constraintStart_toEndOf="@+id/ic_inbox"
|
app:layout_constraintBottom_toBottomOf="@id/ic_inbox"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/ic_chat_bubble"
|
app:layout_constraintEnd_toStartOf="@+id/ic_chat_bubble"
|
||||||
app:layout_constraintTop_toTopOf="@id/ic_inbox"
|
app:layout_constraintStart_toEndOf="@+id/ic_inbox"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/ic_inbox" />
|
app:layout_constraintTop_toTopOf="@id/ic_inbox" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_chat_bubble"
|
android:id="@+id/ic_chat_bubble"
|
||||||
android:contentDescription="@null"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@null"
|
||||||
android:padding="24dp"
|
android:padding="24dp"
|
||||||
android:src="@drawable/ic_chat_bubble_24dp"
|
android:src="@drawable/ic_chat_bubble_24dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/ic_inbox"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/ic_article"
|
app:layout_constraintStart_toEndOf="@+id/ic_article"
|
||||||
app:layout_constraintTop_toTopOf="@id/ic_inbox"
|
app:layout_constraintTop_toTopOf="@id/ic_inbox" />
|
||||||
app:layout_constraintBottom_toBottomOf="@id/ic_inbox" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
android:contentDescription="@string/color_contrast_preview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingVertical="@dimen/settingslib_illustration_padding"
|
android:paddingVertical="@dimen/settingslib_illustration_padding"
|
||||||
@@ -44,12 +45,12 @@
|
|||||||
android:layout_weight="1"/>
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/contrast_button_default"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/contrast_button_default"
|
|
||||||
android:layout_width="@dimen/contrast_button_total_size"
|
android:layout_width="@dimen/contrast_button_total_size"
|
||||||
android:layout_height="@dimen/contrast_button_total_size"
|
android:layout_height="@dimen/contrast_button_total_size"
|
||||||
android:background="@drawable/accessibility_contrast_button_background">
|
android:background="@drawable/accessibility_contrast_button_background">
|
||||||
@@ -58,7 +59,7 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:contentDescription="@string/contrast_default"
|
android:contentDescription="@null"
|
||||||
android:src="@drawable/ic_contrast_standard"/>
|
android:src="@drawable/ic_contrast_standard"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
@@ -67,6 +68,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/contrast_button_text_spacing"
|
android:layout_marginTop="@dimen/contrast_button_text_spacing"
|
||||||
android:gravity="center_horizontal|top"
|
android:gravity="center_horizontal|top"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
android:textSize="@dimen/contrast_button_text_size"
|
android:textSize="@dimen/contrast_button_text_size"
|
||||||
android:text="@string/contrast_default"
|
android:text="@string/contrast_default"
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurface"/>
|
android:textColor="?androidprv:attr/materialColorOnSurface"/>
|
||||||
@@ -77,12 +80,12 @@
|
|||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/contrast_button_medium"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/contrast_button_medium"
|
|
||||||
android:layout_width="@dimen/contrast_button_total_size"
|
android:layout_width="@dimen/contrast_button_total_size"
|
||||||
android:layout_height="@dimen/contrast_button_total_size"
|
android:layout_height="@dimen/contrast_button_total_size"
|
||||||
android:background="@drawable/accessibility_contrast_button_background">
|
android:background="@drawable/accessibility_contrast_button_background">
|
||||||
@@ -91,7 +94,7 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:contentDescription="@string/contrast_medium"
|
android:contentDescription="@null"
|
||||||
android:src="@drawable/ic_contrast_medium"/>
|
android:src="@drawable/ic_contrast_medium"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
@@ -100,6 +103,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/contrast_button_text_spacing"
|
android:layout_marginTop="@dimen/contrast_button_text_spacing"
|
||||||
android:gravity="center_horizontal|top"
|
android:gravity="center_horizontal|top"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
android:textSize="@dimen/contrast_button_text_size"
|
android:textSize="@dimen/contrast_button_text_size"
|
||||||
android:text="@string/contrast_medium"
|
android:text="@string/contrast_medium"
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurface"/>
|
android:textColor="?androidprv:attr/materialColorOnSurface"/>
|
||||||
@@ -110,12 +115,12 @@
|
|||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/contrast_button_high"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/contrast_button_high"
|
|
||||||
android:layout_width="@dimen/contrast_button_total_size"
|
android:layout_width="@dimen/contrast_button_total_size"
|
||||||
android:layout_height="@dimen/contrast_button_total_size"
|
android:layout_height="@dimen/contrast_button_total_size"
|
||||||
android:background="@drawable/accessibility_contrast_button_background">
|
android:background="@drawable/accessibility_contrast_button_background">
|
||||||
@@ -124,7 +129,7 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:contentDescription="@string/contrast_high"
|
android:contentDescription="@null"
|
||||||
android:src="@drawable/ic_contrast_high"/>
|
android:src="@drawable/ic_contrast_high"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
@@ -133,6 +138,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/contrast_button_text_spacing"
|
android:layout_marginTop="@dimen/contrast_button_text_spacing"
|
||||||
android:gravity="center_horizontal|top"
|
android:gravity="center_horizontal|top"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
android:textSize="@dimen/contrast_button_text_size"
|
android:textSize="@dimen/contrast_button_text_size"
|
||||||
android:text="@string/contrast_high"
|
android:text="@string/contrast_high"
|
||||||
android:textColor="?androidprv:attr/materialColorOnSurface"/>
|
android:textColor="?androidprv:attr/materialColorOnSurface"/>
|
||||||
|
@@ -4692,9 +4692,11 @@
|
|||||||
<!-- Preview screen email title on the contrast page. [CHAR LIMIT=30] -->
|
<!-- Preview screen email title on the contrast page. [CHAR LIMIT=30] -->
|
||||||
<string name="color_contrast_preview_email_title">Business trip report</string>
|
<string name="color_contrast_preview_email_title">Business trip report</string>
|
||||||
<!-- Preview screen email body on the contrast page. [CHAR LIMIT=NONE] -->
|
<!-- Preview screen email body on the contrast page. [CHAR LIMIT=NONE] -->
|
||||||
<string name="color_contrast_preview_email_body">For further assistance, please reach out to \nmyself or Helen. This report will be</string>
|
<string name="color_contrast_preview_email_body">For further assistance, please reach out to myself or Helen. This report will be</string>
|
||||||
<!-- Preview screen email attachment name on the contrast page. [CHAR LIMIT=30] -->
|
<!-- Preview screen email attachment name on the contrast page. [CHAR LIMIT=30] -->
|
||||||
<string name="color_contrast_preview_email_attachment_name">Client Expenses</string>
|
<string name="color_contrast_preview_email_attachment_name">Client Expenses</string>
|
||||||
|
<!-- Title for color_contrast page footer. [CHAR LIMIT=30] -->
|
||||||
|
<string name="color_contrast_about_title">About color contrast</string>
|
||||||
<!-- Title for the accessibility text options page. [CHAR LIMIT=50] -->
|
<!-- Title for the accessibility text options page. [CHAR LIMIT=50] -->
|
||||||
<string name="accessibility_turn_screen_darker_title">Turn screen darker</string>
|
<string name="accessibility_turn_screen_darker_title">Turn screen darker</string>
|
||||||
<!-- Title for the accessibility preference category of interaction control services and settings. [CHAR LIMIT=50] -->
|
<!-- Title for the accessibility preference category of interaction control services and settings. [CHAR LIMIT=50] -->
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
android:key="color_contrast_selector"
|
android:key="color_contrast_selector"
|
||||||
android:selectable="false"
|
android:selectable="false"
|
||||||
android:layout="@layout/accessibility_color_contrast_selector"
|
android:layout="@layout/accessibility_color_contrast_selector"
|
||||||
settings:controller="com.android.settings.accessibility.ContrastSelectorPreferenceController"/>
|
settings:controller="com.android.settings.accessibility.ContrastSelectorPreferenceController" />
|
||||||
|
|
||||||
<SwitchPreferenceCompat
|
<SwitchPreferenceCompat
|
||||||
android:key="toggle_high_text_contrast_preference"
|
android:key="toggle_high_text_contrast_preference"
|
||||||
@@ -39,8 +39,10 @@
|
|||||||
"com.android.settings.accessibility.HighTextContrastPreferenceController" />
|
"com.android.settings.accessibility.HighTextContrastPreferenceController" />
|
||||||
|
|
||||||
<com.android.settings.accessibility.AccessibilityFooterPreference
|
<com.android.settings.accessibility.AccessibilityFooterPreference
|
||||||
|
android:key="color_contrast_footer"
|
||||||
android:title="@string/color_contrast_note"
|
android:title="@string/color_contrast_note"
|
||||||
android:selectable="false"
|
android:selectable="false"
|
||||||
settings:searchable="false"/>
|
settings:searchable="false"
|
||||||
|
settings:controller="com.android.settings.accessibility.ColorContrastFooterPreferenceController" />
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2024 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.settings.accessibility;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.android.settings.R;
|
||||||
|
|
||||||
|
/** Preference controller for footer in color contrast page. */
|
||||||
|
public class ColorContrastFooterPreferenceController extends
|
||||||
|
AccessibilityFooterPreferenceController {
|
||||||
|
public ColorContrastFooterPreferenceController(@NonNull Context context,
|
||||||
|
@NonNull String key) {
|
||||||
|
super(context, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getIntroductionTitle() {
|
||||||
|
return mContext.getString(R.string.color_contrast_about_title);
|
||||||
|
}
|
||||||
|
}
|
@@ -26,7 +26,7 @@ import android.app.UiModeManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -53,7 +53,7 @@ public class ContrastSelectorPreferenceController extends BasePreferenceControll
|
|||||||
|
|
||||||
private final Executor mMainExecutor;
|
private final Executor mMainExecutor;
|
||||||
private final UiModeManager mUiModeManager;
|
private final UiModeManager mUiModeManager;
|
||||||
private Map<Integer, FrameLayout> mContrastButtons = new HashMap<>();
|
private Map<Integer, LinearLayout> mContrastButtons = new HashMap<>();
|
||||||
|
|
||||||
public ContrastSelectorPreferenceController(@NonNull Context context,
|
public ContrastSelectorPreferenceController(@NonNull Context context,
|
||||||
@NonNull String preferenceKey) {
|
@NonNull String preferenceKey) {
|
||||||
|
@@ -27,7 +27,7 @@ import static org.mockito.Mockito.when;
|
|||||||
|
|
||||||
import android.app.UiModeManager;
|
import android.app.UiModeManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
@@ -57,7 +57,7 @@ public class ContrastSelectorPreferenceControllerTest {
|
|||||||
@Mock
|
@Mock
|
||||||
private PreferenceScreen mScreen;
|
private PreferenceScreen mScreen;
|
||||||
@Mock
|
@Mock
|
||||||
private FrameLayout mFrameLayout;
|
private LinearLayout mLinearLayout;
|
||||||
@Mock
|
@Mock
|
||||||
private LayoutPreference mLayoutPreference;
|
private LayoutPreference mLayoutPreference;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
@@ -72,7 +72,7 @@ public class ContrastSelectorPreferenceControllerTest {
|
|||||||
when(mContext.getSystemService(UiModeManager.class)).thenReturn(mUiService);
|
when(mContext.getSystemService(UiModeManager.class)).thenReturn(mUiService);
|
||||||
mController = new ContrastSelectorPreferenceController(mContext, PREFERENCE_KEY);
|
mController = new ContrastSelectorPreferenceController(mContext, PREFERENCE_KEY);
|
||||||
when(mScreen.findPreference(PREFERENCE_KEY)).thenReturn(mLayoutPreference);
|
when(mScreen.findPreference(PREFERENCE_KEY)).thenReturn(mLayoutPreference);
|
||||||
when(mLayoutPreference.findViewById(anyInt())).thenReturn(mFrameLayout);
|
when(mLayoutPreference.findViewById(anyInt())).thenReturn(mLinearLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -102,7 +102,7 @@ public class ContrastSelectorPreferenceControllerTest {
|
|||||||
public void displayPreference_shouldAddClickListener() {
|
public void displayPreference_shouldAddClickListener() {
|
||||||
mController.displayPreference(mScreen);
|
mController.displayPreference(mScreen);
|
||||||
|
|
||||||
verify(mFrameLayout, times(3)).setOnClickListener(any());
|
verify(mLinearLayout, times(3)).setOnClickListener(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -110,6 +110,6 @@ public class ContrastSelectorPreferenceControllerTest {
|
|||||||
mController.displayPreference(mScreen);
|
mController.displayPreference(mScreen);
|
||||||
mController.onContrastChanged(1);
|
mController.onContrastChanged(1);
|
||||||
|
|
||||||
verify(mFrameLayout, times(2)).setSelected(true);
|
verify(mLinearLayout, times(2)).setSelected(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user