Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index 3b3f0bd..6163447 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -71,6 +71,7 @@
import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewRootImpl;
+import android.view.ViewTreeObserver;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;
@@ -256,7 +257,7 @@
/**
* @return ActivityOptions with remote animations that controls how the window of the opening
- * targets are displayed.
+ * targets are displayed.
*/
public ActivityOptionsWrapper getActivityLaunchOptions(View v) {
boolean fromRecents = isLaunchingFromRecents(v, null /* targets */);
@@ -285,7 +286,7 @@
* may not always be correct as we may resolve the opening app to a task when the animation
* starts.
*
- * @param v the view to launch from
+ * @param v the view to launch from
* @param targets apps that are opening/closing
* @return true if the app is launching from recents, false if it most likely is not
*/
@@ -298,9 +299,9 @@
/**
* Composes the animations for a launch from the recents list.
*
- * @param anim the animator set to add to
- * @param v the launching view
- * @param appTargets the apps that are opening/closing
+ * @param anim the animator set to add to
+ * @param v the launching view
+ * @param appTargets the apps that are opening/closing
* @param launcherClosing true if the launcher app is closing
*/
protected void composeRecentsLaunchAnimator(@NonNull AnimatorSet anim, @NonNull View v,
@@ -327,9 +328,9 @@
/**
* Compose the animations for a launch from the app icon.
*
- * @param anim the animation to add to
- * @param v the launching view with the icon
- * @param appTargets the list of opening/closing apps
+ * @param anim the animation to add to
+ * @param v the launching view with the icon
+ * @param appTargets the list of opening/closing apps
* @param launcherClosing true if launcher is closing
*/
private void composeIconLaunchAnimator(@NonNull AnimatorSet anim, @NonNull View v,
@@ -367,7 +368,8 @@
public void onAnimationStart(Animator animation) {
mLauncher.addOnResumeCallback(() ->
ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
- mLauncher.getStateManager().getState().getDepth(mLauncher)).start());
+ mLauncher.getStateManager().getState().getDepth(
+ mLauncher)).start());
}
});
}
@@ -444,7 +446,7 @@
*
* @param isAppOpening True when this is called when an app is opening.
* False when this is called when an app is closing.
- * @param startDelay Start delay duration.
+ * @param startDelay Start delay duration.
*/
private Pair<AnimatorSet, Runnable> getLauncherContentAnimator(boolean isAppOpening,
int startDelay) {
@@ -452,12 +454,12 @@
Runnable endListener;
float[] alphas = isAppOpening
- ? new float[] {1, 0}
- : new float[] {0, 1};
+ ? new float[]{1, 0}
+ : new float[]{0, 1};
float[] scales = isAppOpening
- ? new float[] {1, mContentScale}
- : new float[] {mContentScale, 1};
+ ? new float[]{1, mContentScale}
+ : new float[]{mContentScale, 1};
if (mLauncher.isInState(ALL_APPS)) {
// All Apps in portrait mode is full screen, so we only animate AllAppsContainerView.
@@ -549,7 +551,7 @@
/**
* Compose recents view alpha and translation Y animation when launcher opens/closes apps.
*
- * @param anim the animator set to add to
+ * @param anim the animator set to add to
* @param alphas the alphas to animate to over time
* @param scales the scale values to animator to over time
* @return listener to run when the animation ends
@@ -702,7 +704,7 @@
float scaledCropWidth = windowCropWidth * scale;
float scaledCropHeight = windowCropHeight * scale;
- float offsetX = (scaledCropWidth - iconWidth) / 2;
+ float offsetX = (scaledCropWidth - iconWidth) / 2;
float offsetY = (scaledCropHeight - iconHeight) / 2;
// Calculate the window position to match the icon position.
@@ -1084,7 +1086,7 @@
/**
* @return Runner that plays when user goes to Launcher
- * ie. pressing home, swiping up from nav bar.
+ * ie. pressing home, swiping up from nav bar.
*/
RemoteAnimationFactory createWallpaperOpenRunner(boolean fromUnlock) {
return new WallpaperOpenLauncherAnimationRunner(mHandler, fromUnlock);
@@ -1216,7 +1218,24 @@
anim.addListener(new AnimationSuccessListener() {
@Override
public void onAnimationStart(Animator animation) {
- InteractionJankMonitorWrapper.begin(mDragLayer, cuj);
+ mDragLayer.getViewTreeObserver().addOnDrawListener(
+ new ViewTreeObserver.OnDrawListener() {
+ boolean mHandled = false;
+
+ @Override
+ public void onDraw() {
+ if (mHandled) {
+ return;
+ }
+ mHandled = true;
+
+ InteractionJankMonitorWrapper.begin(mDragLayer, cuj);
+
+ mDragLayer.post(() ->
+ mDragLayer.getViewTreeObserver().removeOnDrawListener(
+ this));
+ }
+ });
super.onAnimationStart(animation);
}
diff --git a/quickstep/src/com/android/quickstep/TaskAnimationManager.java b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
index 9731bf1..223c46d 100644
--- a/quickstep/src/com/android/quickstep/TaskAnimationManager.java
+++ b/quickstep/src/com/android/quickstep/TaskAnimationManager.java
@@ -146,7 +146,9 @@
if (recentsView != null) {
RemoteAnimationTargetCompat[] apps = new RemoteAnimationTargetCompat[1];
apps[0] = appearedTaskTarget;
- recentsView.launchSideTaskInLiveTileMode(appearedTaskTarget.taskId, apps);
+ recentsView.launchSideTaskInLiveTileMode(appearedTaskTarget.taskId, apps,
+ new RemoteAnimationTargetCompat[0] /* wallpaper */,
+ new RemoteAnimationTargetCompat[0] /* nonApps */);
return;
}
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 09387ff..710a9ab 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -142,6 +142,7 @@
import com.android.quickstep.RecentsAnimationTargets;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.RecentsModel.TaskVisualsChangeListener;
+import com.android.quickstep.RemoteAnimationTargets;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskOverlayFactory;
import com.android.quickstep.TaskThumbnailCache;
@@ -844,11 +845,13 @@
public void launchSideTaskInLiveTileModeForRestartedApp(int taskId) {
if (mRunningTaskId != -1 && mRunningTaskId == taskId &&
getLiveTileParams().getTargetSet().findTask(taskId) != null) {
- launchSideTaskInLiveTileMode(taskId, getLiveTileParams().getTargetSet().apps);
+ RemoteAnimationTargets targets = getLiveTileParams().getTargetSet();
+ launchSideTaskInLiveTileMode(taskId, targets.apps, targets.wallpapers, targets.nonApps);
}
}
- public void launchSideTaskInLiveTileMode(int taskId, RemoteAnimationTargetCompat[] apps) {
+ public void launchSideTaskInLiveTileMode(int taskId, RemoteAnimationTargetCompat[] apps,
+ RemoteAnimationTargetCompat[] wallpaper, RemoteAnimationTargetCompat[] nonApps) {
AnimatorSet anim = new AnimatorSet();
TaskView taskView = getTaskView(taskId);
if (taskView == null || !isTaskViewVisible(taskView)) {
@@ -877,11 +880,8 @@
}
});
} else {
- TaskViewUtils.composeRecentsLaunchAnimator(
- anim, taskView, apps,
- mLiveTileParams.getTargetSet().wallpapers,
- mLiveTileParams.getTargetSet().nonApps, true /* launcherClosing */,
- mActivity.getStateManager(), this,
+ TaskViewUtils.composeRecentsLaunchAnimator(anim, taskView, apps, wallpaper, nonApps,
+ true /* launcherClosing */, mActivity.getStateManager(), this,
getDepthController());
}
anim.start();
diff --git a/res/color/drop_target_text.xml b/res/color/drop_target_text.xml
new file mode 100644
index 0000000..18d78e7
--- /dev/null
+++ b/res/color/drop_target_text.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ 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.
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="?workspaceAccentColor" android:state_selected="false" />
+ <item android:color="?dropTargetHoverTextColor" android:state_selected="true" />
+</selector>
\ No newline at end of file
diff --git a/res/drawable/drop_target_frame.xml b/res/drawable/drop_target_frame.xml
index fa6dafd..666a96e 100644
--- a/res/drawable/drop_target_frame.xml
+++ b/res/drawable/drop_target_frame.xml
@@ -18,5 +18,5 @@
android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<corners android:radius="28dp" />
- <stroke android:width="2dp" android:color="?android:attr/colorAccent" />
+ <stroke android:width="2dp" android:color="?attr/workspaceAccentColor" />
</shape>
\ No newline at end of file
diff --git a/res/drawable/drop_target_frame_hover.xml b/res/drawable/drop_target_frame_hover.xml
index 7d0e919..ddf3a4d 100644
--- a/res/drawable/drop_target_frame_hover.xml
+++ b/res/drawable/drop_target_frame_hover.xml
@@ -16,6 +16,6 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
- <solid android:color="?android:attr/colorAccent" />
+ <solid android:color="?attr/workspaceAccentColor" />
<corners android:radius="28dp" />
</shape>
\ No newline at end of file
diff --git a/res/drawable/widget_resize_frame.xml b/res/drawable/widget_resize_frame.xml
index d157f5d..9426de4 100644
--- a/res/drawable/widget_resize_frame.xml
+++ b/res/drawable/widget_resize_frame.xml
@@ -18,5 +18,5 @@
android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<corners android:radius="@android:dimen/system_app_widget_background_radius" />
- <stroke android:width="2dp" android:color="?android:attr/colorAccent" />
+ <stroke android:width="2dp" android:color="?attr/workspaceAccentColor" />
</shape>
\ No newline at end of file
diff --git a/res/layout/app_widget_resize_frame.xml b/res/layout/app_widget_resize_frame.xml
index 249e42c..ff07a91 100644
--- a/res/layout/app_widget_resize_frame.xml
+++ b/res/layout/app_widget_resize_frame.xml
@@ -41,7 +41,7 @@
android:layout_gravity="left|center_vertical"
android:layout_marginLeft="@dimen/widget_handle_margin"
android:src="@drawable/ic_widget_resize_handle"
- android:tint="?android:attr/colorAccent" />
+ android:tint="?attr/workspaceAccentColor" />
<!-- Top -->
<ImageView
@@ -51,7 +51,7 @@
android:layout_gravity="top|center_horizontal"
android:layout_marginTop="@dimen/widget_handle_margin"
android:src="@drawable/ic_widget_resize_handle"
- android:tint="?android:attr/colorAccent" />
+ android:tint="?attr/workspaceAccentColor" />
<!-- Right -->
<ImageView
@@ -61,7 +61,7 @@
android:layout_gravity="right|center_vertical"
android:layout_marginRight="@dimen/widget_handle_margin"
android:src="@drawable/ic_widget_resize_handle"
- android:tint="?android:attr/colorAccent" />
+ android:tint="?attr/workspaceAccentColor" />
<!-- Bottom -->
<ImageView
@@ -71,7 +71,7 @@
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/widget_handle_margin"
android:src="@drawable/ic_widget_resize_handle"
- android:tint="?android:attr/colorAccent" />
+ android:tint="?attr/workspaceAccentColor" />
<ImageButton
android:id="@+id/widget_reconfigure_button"
diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml
index 71eaa9e..fb37e85 100644
--- a/res/values-v31/colors.xml
+++ b/res/values-v31/colors.xml
@@ -41,4 +41,7 @@
<color name="wallpaper_popup_scrim">@android:color/system_neutral1_900</color>
<color name="folder_dot_color">@android:color/system_accent2_50</color>
+
+ <color name="workspace_accent_color_light">@android:color/system_accent2_700</color>
+ <color name="workspace_accent_color_dark">@android:color/system_accent1_50</color>
</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 1fadc88..ed1db30 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -46,7 +46,8 @@
<attr name="folderHintColor" format="color" />
<attr name="isFolderDarkText" format="boolean" />
<attr name="workProfileOverlayTextColor" format="color" />
- <attr name="gridColor" format="color" />
+ <attr name="workspaceAccentColor" format="color" />
+ <attr name="dropTargetHoverTextColor" format="color" />
<!-- BubbleTextView specific attributes. -->
<declare-styleable name="BubbleTextView">
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 01f5364..76e821d 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -73,4 +73,7 @@
<color name="wallpaper_popup_scrim">?android:attr/colorAccent</color>
<color name="wallpaper_scrim_color">#0D878787</color>
+
+ <color name="workspace_accent_color_light">#ff254e47</color>
+ <color name="workspace_accent_color_dark">#ff9cfff2</color>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 871214f..dc99893 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -57,7 +57,8 @@
<item name="workProfileOverlayTextColor">#FF212121</item>
<item name="eduHalfSheetBGColor">?android:attr/colorAccent</item>
<item name="disabledIconAlpha">.54</item>
- <item name="gridColor">?android:attr/colorAccent</item>
+ <item name="workspaceAccentColor">@color/workspace_accent_color_light</item>
+ <item name="dropTargetHoverTextColor">@color/workspace_text_color_light</item>
<item name="overviewScrimColor">@color/overview_scrim</item>
<item name="android:windowTranslucentStatus">false</item>
@@ -71,6 +72,8 @@
<style name="LauncherTheme.DarkMainColor" parent="@style/LauncherTheme">
<item name="disabledIconAlpha">.254</item>
+ <item name="workspaceAccentColor">@color/workspace_accent_color_dark</item>
+ <item name="dropTargetHoverTextColor">@color/workspace_text_color_dark</item>
</style>
@@ -250,7 +253,7 @@
<style name="DropTargetButtonBase" parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:drawablePadding">8dp</item>
<item name="android:padding">16dp</item>
- <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textColor">@color/drop_target_text</item>
<item name="android:textSize">@dimen/drop_target_text_size</item>
<item name="android:singleLine">true</item>
<item name="android:ellipsize">end</item>
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index d1cb5b8..23dd3bb 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -48,20 +48,6 @@
public abstract class ButtonDropTarget extends TextView
implements DropTarget, DragController.DragListener, OnClickListener {
- private static final Property<ButtonDropTarget, Integer> TEXT_COLOR =
- new Property<ButtonDropTarget, Integer>(Integer.TYPE, "textColor") {
-
- @Override
- public Integer get(ButtonDropTarget target) {
- return target.getTextColor();
- }
-
- @Override
- public void set(ButtonDropTarget target, Integer value) {
- target.setTextColor(value);
- }
- };
-
private static final int[] sTempCords = new int[2];
private static final int DRAG_VIEW_DROP_DURATION = 285;
private static final float DRAG_VIEW_HOVER_OVER_OPACITY = 0.65f;
@@ -84,15 +70,12 @@
private final int mDrawableSize;
protected CharSequence mText;
- protected ColorStateList mOriginalTextColor;
protected Drawable mDrawable;
private boolean mTextVisible = true;
private PopupWindow mToolTip;
private int mToolTipLocation;
- private AnimatorSet mCurrentColorAnim;
-
public ButtonDropTarget(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
@@ -110,7 +93,6 @@
protected void onFinishInflate() {
super.onFinishInflate();
mText = getText();
- mOriginalTextColor = getTextColors();
setContentDescription(mText);
}
@@ -125,6 +107,7 @@
// drawableLeft and drawableStart.
mDrawable = getContext().getDrawable(resId).mutate();
mDrawable.setBounds(0, 0, mDrawableSize, mDrawableSize);
+ mDrawable.setTintList(getTextColors());
setCompoundDrawablesRelative(mDrawable, null, null, null);
}
@@ -191,12 +174,6 @@
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
mActive = !options.isKeyboardDrag && supportsDrop(dragObject.dragInfo);
- mDrawable.setColorFilter(null);
- if (mCurrentColorAnim != null) {
- mCurrentColorAnim.cancel();
- mCurrentColorAnim = null;
- }
- setTextColor(mOriginalTextColor);
setVisibility(mActive ? View.VISIBLE : View.GONE);
mAccessibleDrag = options.isAccessibleDrag;
@@ -317,10 +294,6 @@
mLauncher.getAccessibilityDelegate().handleAccessibleDrop(this, null, null);
}
- public int getTextColor() {
- return getTextColors().getDefaultColor();
- }
-
public void setTextVisible(boolean isVisible) {
CharSequence newText = isVisible ? mText : "";
if (mTextVisible != isVisible || !TextUtils.equals(newText, getText())) {
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 3823437..00278e4 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -263,7 +263,7 @@
mBackground.setCallback(this);
mBackground.setAlpha(0);
- mGridColor = Themes.getAttrColor(getContext(), R.attr.gridColor);
+ mGridColor = Themes.getAttrColor(getContext(), R.attr.workspaceAccentColor);
mGridVisualizationPadding =
res.getDimensionPixelSize(R.dimen.grid_visualization_cell_spacing);
mGridVisualizationRoundingRadius =
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 66f5c87..aab6cb2 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -102,6 +102,10 @@
public static final BooleanFlag ENABLE_DEVICE_SEARCH = new DeviceFlag(
"ENABLE_DEVICE_SEARCH", true, "Allows on device search in all apps");
+ public static final BooleanFlag ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING = new DeviceFlag(
+ "ENABLE_DEVICE_SEARCH_PERFORMANCE_LOGGING", true,
+ "Allows on device search in all apps logging");
+
public static final BooleanFlag IME_STICKY_SNACKBAR_EDU = getDebugFlag(
"IME_STICKY_SNACKBAR_EDU", true, "Show sticky IME edu in AllApps");
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index 25a0141..e704957 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -196,7 +196,7 @@
icon.mFolderName.setText(folderInfo.title);
icon.mFolderName.setCompoundDrawablePadding(0);
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) icon.mFolderName.getLayoutParams();
- lp.topMargin = grid.cellYPaddingPx + grid.iconSizePx + grid.iconDrawablePaddingPx;
+ lp.topMargin = grid.iconSizePx + grid.iconDrawablePaddingPx;
icon.setTag(folderInfo);
icon.setOnClickListener(ItemClickHandler.INSTANCE);