Snap for 9294897 from ab61359a81 to tm-qpr2-release

Change-Id: Ib70aa840dce406ba2abf193cf9a4105f622cb0f6
This commit is contained in:
Android Build Coastguard Worker
2022-11-16 00:29:40 +00:00
5 changed files with 55 additions and 13 deletions
+2
View File
@@ -187,6 +187,8 @@
<string name="allset_title">All set!</string>
<!-- Hint string at the bottom of "All Set" page [CHAR LIMIT=NONE] -->
<string name="allset_hint">Swipe up to go Home</string>
<!-- Hint string at the bottom of "All Set" page for button navigation [CHAR LIMIT=NONE] -->
<string name="allset_button_hint">Tap the home button to go to your home screen</string>
<!-- Description of "All Set" page on phones [CHAR LIMIT=NONE] -->
<string name="allset_description">You\u2019re ready to start using your phone</string>
<!-- Description of "All Set" page on tablets [CHAR LIMIT=NONE] -->
@@ -53,6 +53,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.core.graphics.ColorUtils;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -120,10 +121,9 @@ public class AllSetActivity extends Activity {
mContentView = findViewById(R.id.content_view);
mSwipeUpShift = getResources().getDimension(R.dimen.allset_swipe_up_shift);
boolean isTablet = InvariantDeviceProfile.INSTANCE.get(getApplicationContext())
.getDeviceProfile(this).isTablet;
DeviceProfile dp = InvariantDeviceProfile.INSTANCE.get(this).getDeviceProfile(this);
TextView subtitle = findViewById(R.id.subtitle);
subtitle.setText(isTablet
subtitle.setText(dp.isTablet
? R.string.allset_description_tablet : R.string.allset_description);
TextView tv = findViewById(R.id.navigation_settings);
@@ -137,7 +137,11 @@ public class AllSetActivity extends Activity {
}
});
findViewById(R.id.hint).setAccessibilityDelegate(new SkipButtonAccessibilityDelegate());
TextView hintTextView = findViewById(R.id.hint);
if (!dp.isGestureMode) {
hintTextView.setText(R.string.allset_button_hint);
}
hintTextView.setAccessibilityDelegate(new SkipButtonAccessibilityDelegate());
mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
mVibrator = getSystemService(Vibrator.class);
+1 -1
View File
@@ -333,7 +333,7 @@
<!-- Snackbar -->
<dimen name="snackbar_height">48dp</dimen>
<dimen name="snackbar_content_height">32dp</dimen>
<dimen name="snackbar_content_height">48dp</dimen>
<dimen name="snackbar_padding">8dp</dimen>
<dimen name="snackbar_min_margin_left_right">6dp</dimen>
<dimen name="snackbar_max_margin_left_right">72dp</dimen>
@@ -32,6 +32,7 @@ import android.graphics.drawable.Drawable;
import android.util.FloatProperty;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import com.android.launcher3.BubbleTextView;
@@ -39,6 +40,7 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.model.data.ItemInfo;
/** Coordinates the transition between Search and A-Z in All Apps. */
@@ -225,16 +227,35 @@ public class SearchTransitionController {
numSearchResultsAnimated++;
}
searchResultView.setAlpha(contentAlpha);
// Apply background alpha to decorator if possible.
if (adapterPosition != NO_POSITION) {
searchRecyclerView.getApps().getAdapterItems()
.get(adapterPosition).setDecorationFillAlpha((int) (255 * backgroundAlpha));
}
// Apply background alpha to view's background (e.g. for Search Edu card).
Drawable background = searchResultView.getBackground();
if (background != null) {
if (background != null
&& searchResultView instanceof ViewGroup
&& FeatureFlags.ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES.get()) {
searchResultView.setAlpha(1f);
// Apply content alpha to each child, since the view needs to be fully opaque for
// the background to show properly.
ViewGroup searchResultViewGroup = (ViewGroup) searchResultView;
for (int j = 0; j < searchResultViewGroup.getChildCount(); j++) {
searchResultViewGroup.getChildAt(j).setAlpha(contentAlpha);
}
// Apply background alpha to the background drawable directly.
background.setAlpha((int) (255 * backgroundAlpha));
} else {
searchResultView.setAlpha(contentAlpha);
// Apply background alpha to decorator if possible.
if (adapterPosition != NO_POSITION) {
searchRecyclerView.getApps().getAdapterItems().get(adapterPosition)
.setDecorationFillAlpha((int) (255 * backgroundAlpha));
}
// Apply background alpha to view's background (e.g. for Search Edu card).
if (background != null) {
background.setAlpha((int) (255 * backgroundAlpha));
}
}
float scaleY = 1;
@@ -304,6 +325,13 @@ public class SearchTransitionController {
getSearchRecyclerView().getApps().getAdapterItems().get(adapterPosition)
.setDecorationFillAlpha(255);
}
if (child instanceof ViewGroup
&& FeatureFlags.ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES.get()) {
ViewGroup childGroup = (ViewGroup) child;
for (int i = 0; i < childGroup.getChildCount(); i++) {
childGroup.getChildAt(i).setAlpha(1f);
}
}
if (child.getBackground() != null) {
child.getBackground().setAlpha(255);
}
@@ -264,6 +264,10 @@ public final class FeatureFlags {
public static final BooleanFlag ENABLE_ONE_SEARCH_MOTION = new DeviceFlag(
"ENABLE_ONE_SEARCH_MOTION", true, "Enables animations in OneSearch.");
public static final BooleanFlag ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES = new DeviceFlag(
"ENABLE_SEARCH_RESULT_BACKGROUND_DRAWABLES", false,
"Enable option to replace decorator-based search result backgrounds with drawables");
public static final BooleanFlag ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS = new DeviceFlag(
"ENABLE_SHOW_KEYBOARD_OPTION_IN_ALL_APPS", true,
"Enable option to show keyboard when going to all-apps");
@@ -327,6 +331,10 @@ public final class FeatureFlags {
"LARGE_SCREEN_WIDGET_PICKER", false, "Enable new widget picker that takes "
+ "advantage of large screen format");
public static final BooleanFlag ENABLE_NEW_GESTURE_NAV_TUTORIAL = getDebugFlag(
"ENABLE_NEW_GESTURE_NAV_TUTORIAL", false,
"Enable the redesigned gesture navigation tutorial");
public static final BooleanFlag ENABLE_TOAST_IMPRESSION_LOGGING = getDebugFlag(
"ENABLE_TOAST_IMPRESSION_LOGGING", false, "Enable toast impression logging");