Merge "Fixes Copyright date & incorrect a11y announcement" into sc-dev

This commit is contained in:
Jeff DeCew
2021-02-27 16:37:30 +00:00
committed by Android (Google) Code Review
5 changed files with 34 additions and 2 deletions

View File

@@ -9439,11 +9439,16 @@ public class Notification implements Parcelable
}
private void bindCallerVerification(RemoteViews contentView, StandardTemplateParams p) {
String iconContentDescription = null;
boolean showDivider = true;
if (mVerificationIcon != null) {
contentView.setImageViewIcon(R.id.verification_icon, mVerificationIcon);
contentView.setDrawableTint(R.id.verification_icon, false /* targetBackground */,
mBuilder.getSecondaryTextColor(p), PorterDuff.Mode.SRC_ATOP);
contentView.setViewVisibility(R.id.verification_icon, View.VISIBLE);
iconContentDescription = mBuilder.mContext.getString(
R.string.notification_verified_content_description);
showDivider = false; // the icon replaces the divider
} else {
contentView.setViewVisibility(R.id.verification_icon, View.GONE);
}
@@ -9451,8 +9456,17 @@ public class Notification implements Parcelable
contentView.setTextViewText(R.id.verification_text, mVerificationText);
mBuilder.setTextViewColorSecondary(contentView, R.id.verification_text, p);
contentView.setViewVisibility(R.id.verification_text, View.VISIBLE);
iconContentDescription = null; // let the app's text take precedence
} else {
contentView.setViewVisibility(R.id.verification_text, View.GONE);
showDivider = false; // no divider if no text
}
contentView.setContentDescription(R.id.verification_icon, iconContentDescription);
if (showDivider) {
contentView.setViewVisibility(R.id.verification_divider, View.VISIBLE);
mBuilder.setTextViewColorSecondary(contentView, R.id.verification_divider, p);
} else {
contentView.setViewVisibility(R.id.verification_divider, View.GONE);
}
}

View File

@@ -99,13 +99,26 @@
android:visibility="gone"
/>
<TextView
android:id="@+id/verification_divider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Info"
android:layout_marginStart="@dimen/notification_conversation_header_separating_margin"
android:layout_marginEnd="@dimen/notification_conversation_header_separating_margin"
android:text="@string/notification_header_divider_symbol"
android:layout_gravity="center"
android:paddingTop="1sp"
android:singleLine="true"
android:visibility="gone"
/>
<ImageView
android:id="@+id/verification_icon"
android:layout_width="@dimen/notification_verification_icon_size"
android:layout_height="@dimen/notification_verification_icon_size"
android:layout_gravity="center"
android:layout_marginStart="4dp"
android:contentDescription="@string/notification_alerted_content_description"
android:paddingTop="2dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_notifications_alerted"

View File

@@ -5011,6 +5011,9 @@
<!-- Content description of the alerting icon in the notification. [CHAR_LIMIT=NONE] -->
<string name="notification_alerted_content_description">Alerted</string>
<!-- Default content description of the verification icon in the call notification. [CHAR_LIMIT=NONE] -->
<string name="notification_verified_content_description">Verified</string>
<!-- Content description of the expand button icon in the notification when collaped.-->
<string name="expand_button_content_description_collapsed">Expand</string>

View File

@@ -3110,8 +3110,10 @@
<java-symbol type="dimen" name="call_notification_collapsible_indent"/>
<java-symbol type="drawable" name="ic_call_answer" />
<java-symbol type="drawable" name="ic_call_decline" />
<java-symbol type="id" name="verification_divider" />
<java-symbol type="id" name="verification_icon" />
<java-symbol type="id" name="verification_text" />
<java-symbol type="string" name="notification_verified_content_description" />
<!-- Notification handler / dashboard package -->
<java-symbol type="string" name="config_notificationHandlerPackage" />

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 The Android Open Source Project
* Copyright (C) 2021 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.