P2P App Sharing: Gray out disabled SystemShortcut
The Share App system shortcut is disabled for apps that are deemed unshareable. This updates the UX to gray out the shortcut instead of hiding it. When the user clicks on the grayed out shortcut, a Toast message is displayed. This update also enables the shareability check.
In order to properly gray out the shortcut, this also fixes a bug with BubbleTextView in which ColorStateLists weren't applied correctly.
Bug: 202556634
Bug: 204495363
Test: Manual (observed UX on Wembley device in regular and dark themes)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: Ieb04baf8c9cb9d325119cb97fceb96f2fc5a62ff
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 7811047..3992e31 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -148,6 +148,8 @@
@ViewDebug.ExportedProperty(category = "launcher")
private int mTextColor;
@ViewDebug.ExportedProperty(category = "launcher")
+ private ColorStateList mTextColorStateList;
+ @ViewDebug.ExportedProperty(category = "launcher")
private float mTextAlpha = 1;
@ViewDebug.ExportedProperty(category = "launcher")
@@ -617,12 +619,14 @@
@Override
public void setTextColor(int color) {
mTextColor = color;
+ mTextColorStateList = null;
super.setTextColor(getModifiedColor());
}
@Override
public void setTextColor(ColorStateList colors) {
mTextColor = colors.getDefaultColor();
+ mTextColorStateList = colors;
if (Float.compare(mTextAlpha, 1) == 0) {
super.setTextColor(colors);
} else {
@@ -644,7 +648,11 @@
private void setTextAlpha(float alpha) {
mTextAlpha = alpha;
- super.setTextColor(getModifiedColor());
+ if (mTextColorStateList != null) {
+ setTextColor(mTextColorStateList);
+ } else {
+ super.setTextColor(getModifiedColor());
+ }
}
private int getModifiedColor() {