summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSetup Wizard Team <android-setup-team-eng@google.com>2021-11-25 02:55:33 +0000
committerHank Sheng <hanksheng@google.com>2021-11-25 08:35:08 +0000
commit2f068748b1869ce8043e6f80ab65cd030dd3caae (patch)
treead656798e58915276cacf4e202dab05147e6f132
parent53b7642562f0fb5336f922808405b34cbb59aba1 (diff)
downloadsetupcompat-2f068748b1869ce8043e6f80ab65cd030dd3caae.tar.gz
Import updated Android SetupCompat Library 412175166
Copied from google3/third_party/java_src/android_libs/setupcompat Test: mm Included changes: - 412175166 Ripple color forgot to set focus state. - 409328644 Change sdk check for isAtLeastT PiperOrigin-RevId: 412175166 Bug: 207099076 Change-Id: I444f115605d871ee5beb34f99496255a595c3096
-rw-r--r--main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java6
-rw-r--r--main/java/com/google/android/setupcompat/util/BuildCompatUtils.java6
2 files changed, 7 insertions, 5 deletions
diff --git a/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java b/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java
index 093de3e..ef2aa6b 100644
--- a/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java
+++ b/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java
@@ -298,12 +298,14 @@ public class FooterButtonStyleUtils {
}
int[] pressedState = {android.R.attr.state_pressed};
+ int[] focusState = {android.R.attr.state_focused};
+ int argbColor = convertRgbToArgb(textColor, rippleAlpha);
// Set text color for ripple.
ColorStateList colorStateList =
new ColorStateList(
- new int[][] {pressedState, StateSet.NOTHING},
- new int[] {convertRgbToArgb(textColor, rippleAlpha), Color.TRANSPARENT});
+ new int[][] {pressedState, focusState, StateSet.NOTHING},
+ new int[] {argbColor, argbColor, Color.TRANSPARENT});
rippleDrawable.setColor(colorStateList);
}
}
diff --git a/main/java/com/google/android/setupcompat/util/BuildCompatUtils.java b/main/java/com/google/android/setupcompat/util/BuildCompatUtils.java
index 7fac760..540047f 100644
--- a/main/java/com/google/android/setupcompat/util/BuildCompatUtils.java
+++ b/main/java/com/google/android/setupcompat/util/BuildCompatUtils.java
@@ -61,9 +61,9 @@ public final class BuildCompatUtils {
*
* <ul>
* <li>For current Android release: while new API is not finalized yet (CODENAME = "T", SDK_INT
- * = 31|32)
+ * = 33)
* <li>For current Android release: when new API is finalized (CODENAME = "REL", SDK_INT = 32)
- * <li>For next Android release (CODENAME = "U", SDK_INT = 33+)
+ * <li>For next Android release (CODENAME = "U", SDK_INT = 34+)
* </ul>
*
* <p>Note that Build.VERSION_CODES.S cannot be used here until final SDK is available in all
@@ -76,7 +76,7 @@ public final class BuildCompatUtils {
if (!isAtLeastS()) {
return false;
}
- return (Build.VERSION.CODENAME.equals("REL") && Build.VERSION.SDK_INT >= 32)
+ return (Build.VERSION.CODENAME.equals("REL") && Build.VERSION.SDK_INT >= 33)
|| (Build.VERSION.CODENAME.length() == 1
&& Build.VERSION.CODENAME.charAt(0) >= 'T'
&& Build.VERSION.CODENAME.charAt(0) <= 'Z');