Merge "Import translations. DO NOT MERGE ANYWHERE" into udc-dev
diff --git a/go/quickstep/res/values-ky/strings.xml b/go/quickstep/res/values-ky/strings.xml
index 55e70c8..dcc1e4e 100644
--- a/go/quickstep/res/values-ky/strings.xml
+++ b/go/quickstep/res/values-ky/strings.xml
@@ -11,9 +11,9 @@
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"Экрандагы текстти которуу же угуу"</string>
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Экрандагы текст, веб-даректер жана скриншоттор сыяктуу маалымат Google менен бөлүшүлүшү мүмкүн.\n\nБөлүшүлгөн маалыматты өзгөртүү үчүн"<b>"Параметрлер > Колдонмолор > Демейки колдонмолор > Санариптик жардамчы колдонмосуна өтүңүз"</b>"."</string>
<string name="assistant_not_selected_title" msgid="5017072974603345228">"Бул функцияны колдонуу үчүн жардамчыны тандаңыз"</string>
- <string name="assistant_not_selected_text" msgid="3244613673884359276">"Экраныңыздагы текстти угуу же которуу үчүн Жөндөөлөрдөн санариптик жардамчы колдонмосун тандаңыз"</string>
+ <string name="assistant_not_selected_text" msgid="3244613673884359276">"Экраныңыздагы текстти угуу же которуу үчүн Параметрлерден санариптик жардамчы колдонмосун тандаңыз"</string>
<string name="assistant_not_supported_title" msgid="1675788067597484142">"Бул функцияны колдонуу үчүн жардамчыңызды өзгөртүңүз"</string>
- <string name="assistant_not_supported_text" msgid="1708031078549268884">"Экраныңыздагы текстти угуу же которуу үчүн Жөндөөлөрдөн санариптик жардамчы колдонмосун өзгөртүңүз"</string>
+ <string name="assistant_not_supported_text" msgid="1708031078549268884">"Экраныңыздагы текстти угуу же которуу үчүн Параметрлерден санариптик жардамчы колдонмосун өзгөртүңүз"</string>
<string name="tooltip_listen" msgid="7634466447860989102">"Бул экрандагы текстти угуу үчүн бул жерди басыңыз"</string>
<string name="tooltip_translate" msgid="4184845868901542567">"Бул экрандагы текстти которуу үчүн бул жерди басыңыз"</string>
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"Бул колдонмону бөлүшүүгө болбойт"</string>
diff --git a/quickstep/res/values-cs/strings.xml b/quickstep/res/values-cs/strings.xml
index c27585a..786e162 100644
--- a/quickstep/res/values-cs/strings.xml
+++ b/quickstep/res/values-cs/strings.xml
@@ -88,7 +88,7 @@
<string name="action_share" msgid="2648470652637092375">"Sdílet"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Snímek obrazovky"</string>
<string name="action_split" msgid="2098009717623550676">"Rozdělit"</string>
- <string name="toast_split_select_app" msgid="8464310533320556058">"Klepnutím na jinou aplikaci rozdělíte obrazovku"</string>
+ <string name="toast_split_select_app" msgid="8464310533320556058">"Obrazovku rozdělíte klepnutím na jinou aplikaci"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Vyberte podporovanou aplikaci"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikace nebo organizace zakazuje tuto akci"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Přeskočit výukový program k navigaci?"</string>
diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml
index 43fe5b1..06078e3 100644
--- a/quickstep/res/values-es/strings.xml
+++ b/quickstep/res/values-es/strings.xml
@@ -88,7 +88,7 @@
<string name="action_share" msgid="2648470652637092375">"Compartir"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Hacer captura"</string>
<string name="action_split" msgid="2098009717623550676">"Dividir"</string>
- <string name="toast_split_select_app" msgid="8464310533320556058">"Toca otra app para usar la pantalla dividida"</string>
+ <string name="toast_split_select_app" msgid="8464310533320556058">"Toca otra aplicación para usar la pantalla dividida"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Elige otra app para usar la pantalla dividida"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"No puedes hacerlo porque la aplicación o tu organización no lo permiten"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"¿Saltar tutorial de navegación?"</string>
diff --git a/quickstep/res/values-eu/strings.xml b/quickstep/res/values-eu/strings.xml
index 9f6e8e1..fa624e7 100644
--- a/quickstep/res/values-eu/strings.xml
+++ b/quickstep/res/values-eu/strings.xml
@@ -116,7 +116,7 @@
<string name="taskbar_a11y_hidden_title" msgid="9154903639589659284">"Zereginen barra itxita dago"</string>
<string name="taskbar_phone_a11y_title" msgid="4933360237131229395">"Nabigazio-barra"</string>
<string name="always_show_taskbar" msgid="3608801276107751229">"Erakutsi beti zereginen barra"</string>
- <string name="change_navigation_mode" msgid="9088393078736808968">"Aldatu nabigatzeko modua"</string>
+ <string name="change_navigation_mode" msgid="9088393078736808968">"Aldatu nabigazio modua"</string>
<string name="taskbar_divider_a11y_title" msgid="6608690309720242080">"Zereginen barraren zatitzailea"</string>
<string name="move_drop_target_top_or_left" msgid="2988702185049595807">"Eraman gora, ezkerretara"</string>
<string name="move_drop_target_bottom_or_right" msgid="5431393418797620162">"Eraman behera, eskuinetara"</string>
diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml
index db880b3..0d4e375 100644
--- a/quickstep/res/values-in/strings.xml
+++ b/quickstep/res/values-in/strings.xml
@@ -88,7 +88,7 @@
<string name="action_share" msgid="2648470652637092375">"Bagikan"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Screenshot"</string>
<string name="action_split" msgid="2098009717623550676">"Pisahkan"</string>
- <string name="toast_split_select_app" msgid="8464310533320556058">"Ketuk apl lain untuk menggunakan layar terpisah"</string>
+ <string name="toast_split_select_app" msgid="8464310533320556058">"Ketuk aplikasi lain untuk memakai layar terpisah"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Pilih aplikasi lain untuk memakai layar terpisah"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Tindakan ini tidak diizinkan oleh aplikasi atau organisasi Anda"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Lewati tutorial gestur?"</string>
diff --git a/quickstep/res/values-ml/strings.xml b/quickstep/res/values-ml/strings.xml
index ab77317..3d87fb6 100644
--- a/quickstep/res/values-ml/strings.xml
+++ b/quickstep/res/values-ml/strings.xml
@@ -88,7 +88,7 @@
<string name="action_share" msgid="2648470652637092375">"പങ്കിടുക"</string>
<string name="action_screenshot" msgid="8171125848358142917">"സ്ക്രീൻഷോട്ട്"</string>
<string name="action_split" msgid="2098009717623550676">"വിഭജിക്കുക"</string>
- <string name="toast_split_select_app" msgid="8464310533320556058">"സ്പ്ലിറ്റ് സ്ക്രീനിനായി മറ്റൊരു ആപ്പ് ടാപ്പുചെയ്യൂ"</string>
+ <string name="toast_split_select_app" msgid="8464310533320556058">"സ്പ്ലിറ്റ് സ്ക്രീനിന് മറ്റൊരു ആപ്പിൽ ടാപ്പ് ചെയ്യൂ"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"സ്ക്രീൻ വിഭജന മോഡിന് മറ്റൊരു ആപ്പ് തിരഞ്ഞെടുക്കൂ"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ഈ നടപടി എടുക്കുന്നത് ആപ്പോ നിങ്ങളുടെ സ്ഥാപനമോ അനുവദിക്കുന്നില്ല"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"നാവിഗേഷൻ ട്യൂട്ടോറിയൽ ഒഴിവാക്കണോ?"</string>
diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml
index 5a04d97..72729bf 100644
--- a/quickstep/res/values-or/strings.xml
+++ b/quickstep/res/values-or/strings.xml
@@ -21,7 +21,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="recent_task_option_pin" msgid="7929860679018978258">"ପିନ୍"</string>
<string name="recent_task_option_freeform" msgid="48863056265284071">"ଫ୍ରିଫର୍ମ"</string>
- <string name="recents_empty_message" msgid="7040467240571714191">"କୌଣସି ସାମ୍ପ୍ରତିକ ଆଇଟମ୍ ନାହିଁ"</string>
+ <string name="recents_empty_message" msgid="7040467240571714191">"ବର୍ତ୍ତମାନର କୌଣସି ଆଇଟମ ନାହିଁ"</string>
<string name="accessibility_app_usage_settings" msgid="6312864233673544149">"ଆପ ବ୍ୟବହାର ସେଟିଂସ"</string>
<string name="recents_clear_all" msgid="5328176793634888831">"ସବୁ ଖାଲି କରନ୍ତୁ"</string>
<string name="accessibility_recent_apps" msgid="4058661986695117371">"ବର୍ତ୍ତମାନର ଆପ୍"</string>
diff --git a/quickstep/res/values-pa/strings.xml b/quickstep/res/values-pa/strings.xml
index 939f699..3da7e42 100644
--- a/quickstep/res/values-pa/strings.xml
+++ b/quickstep/res/values-pa/strings.xml
@@ -97,7 +97,7 @@
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ਛੱਡੋ"</string>
<string name="accessibility_rotate_button" msgid="4771825231336502943">"ਸਕ੍ਰੀਨ ਘੁਮਾਓ"</string>
<string name="taskbar_edu_a11y_title" msgid="5417986057866415355">"ਟਾਸਕਬਾਰ ਸਿੱਖਿਆ"</string>
- <string name="taskbar_edu_splitscreen" msgid="5605512479258053350">"ਇੱਕ ਵਾਰ ਵਿੱਚ 2 ਐਪਾਂ ਵਰਤਣ ਲਈ, ਐਪ ਨੂੰ ਪਾਸੇ ਵੱਲ ਘਸੀਟੋ"</string>
+ <string name="taskbar_edu_splitscreen" msgid="5605512479258053350">"ਇੱਕੋ ਸਮੇਂ \'ਤੇ 2 ਐਪਾਂ ਵਰਤਣ ਲਈ, ਐਪ ਨੂੰ ਪਾਸੇ ਵੱਲ ਘਸੀਟੋ"</string>
<string name="taskbar_edu_stashing" msgid="5645461372669217294">"ਟਾਸਕਬਾਰ ਦਿਖਾਉਣ ਲਈ ਥੋੜ੍ਹਾ ਉੱਪਰ ਵੱਲ ਸਵਾਈਪ ਕਰੋ"</string>
<string name="taskbar_edu_suggestions" msgid="8215044496435527982">"ਤੁਹਾਡੇ ਨਿਯਮਬੱਧ ਕੰਮ ਦੇ ਆਧਾਰ \'ਤੇ ਐਪ ਸੁਝਾਅ ਪ੍ਰਾਪਤ ਕਰੋ"</string>
<string name="taskbar_edu_settings_persistent" msgid="1387372982791296151">"ਟਾਸਕਬਾਰ ਨੂੰ ਸਵੈ-ਲੁਕਾਉਣ ਲਈ ਸੈਟਿੰਗਾਂ ਵਿੱਚ ਇਸ਼ਾਰਾ ਨੈਵੀਗੇਸ਼ਨ ਨੂੰ ਚਾਲੂ ਕਰੋ"</string>
diff --git a/quickstep/res/values-sk/strings.xml b/quickstep/res/values-sk/strings.xml
index 1577f4a..b3f1c29 100644
--- a/quickstep/res/values-sk/strings.xml
+++ b/quickstep/res/values-sk/strings.xml
@@ -88,7 +88,7 @@
<string name="action_share" msgid="2648470652637092375">"Zdieľať"</string>
<string name="action_screenshot" msgid="8171125848358142917">"Snímka obrazovky"</string>
<string name="action_split" msgid="2098009717623550676">"Rozdeliť"</string>
- <string name="toast_split_select_app" msgid="8464310533320556058">"Rozdelenú obrazovku spustíte klep. na inú aplik."</string>
+ <string name="toast_split_select_app" msgid="8464310533320556058">"Obrazovku rozdelíte klepnutím na inú aplikáciu"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"Na použitie rozd. obrazovky vyberte inú aplikáciu"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"Aplikácia alebo vaša organizácia túto akciu nepovoľuje"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"Chcete preskočiť návod na navigáciu?"</string>
diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml
index 9fe46ef..9cdd2fa 100644
--- a/quickstep/res/values-te/strings.xml
+++ b/quickstep/res/values-te/strings.xml
@@ -88,7 +88,7 @@
<string name="action_share" msgid="2648470652637092375">"షేర్ చేయండి"</string>
<string name="action_screenshot" msgid="8171125848358142917">"స్క్రీన్షాట్"</string>
<string name="action_split" msgid="2098009717623550676">"స్ప్లిట్ చేయండి"</string>
- <string name="toast_split_select_app" msgid="8464310533320556058">"మరొక యాప్ను ట్యాప్ చేసి, స్ప్లిట్ స్క్రీన్ వాడండి"</string>
+ <string name="toast_split_select_app" msgid="8464310533320556058">"స్ప్లిట్ స్క్రీన్ కోసం మరొక యాప్ను ట్యాప్ చేయండి"</string>
<string name="toast_split_app_unsupported" msgid="2360229567007828914">"స్ప్లిట్ స్క్రీన్ ఉపయోగానికి మరొక యాప్ ఎంచుకోండి"</string>
<string name="blocked_by_policy" msgid="2071401072261365546">"ఈ చర్యను యాప్ గానీ, మీ సంస్థ గానీ అనుమతించవు"</string>
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"నావిగేషన్ ట్యుటోరియల్ను స్కిప్ చేయాలా?"</string>
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index 682fccd..977163b 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -1448,6 +1448,7 @@
*/
private Animator getFallbackClosingWindowAnimators(RemoteAnimationTarget[] appTargets) {
final int rotationChange = getRotationChange(appTargets);
+ SurfaceTransactionApplier surfaceApplier = new SurfaceTransactionApplier(mDragLayer);
Matrix matrix = new Matrix();
Point tmpPos = new Point();
Rect tmpRect = new Rect();
@@ -1503,7 +1504,7 @@
.setAlpha(1f);
}
}
- transaction.getTransaction().apply();
+ surfaceApplier.scheduleApply(transaction);
}
});
@@ -1591,8 +1592,7 @@
boolean playFallBackAnimation = (launcherView == null
&& launcherIsForceInvisibleOrOpening)
|| mLauncher.getWorkspace().isOverlayShown()
- || hasMultipleTargetsWithMode(appTargets, MODE_CLOSING)
- || mLauncher.isDestroyed();
+ || hasMultipleTargetsWithMode(appTargets, MODE_CLOSING);
boolean playWorkspaceReveal = true;
boolean skipAllAppsScale = false;
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt
index 667c6f5..7397159 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt
@@ -43,7 +43,8 @@
private var shadowBlur = 0f
private var keyShadowDistance = 0f
- private var arrowPositionX: Float = 0f
+ var arrowPositionX: Float = 0f
+ private set
private var showingArrow: Boolean = false
private var arrowDrawable: ShapeDrawable
diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
index 07de3b8..0e1e0e1 100644
--- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java
@@ -15,6 +15,7 @@
*/
package com.android.launcher3.taskbar.bubbles;
+import android.animation.ValueAnimator;
import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Rect;
@@ -41,14 +42,14 @@
* - stashed as a handle
* - unstashed but collapsed, in this state the bar is showing but the bubbles are stacked within it
* - unstashed and expanded, in this state the bar is showing and the bubbles are shown in a row
- * with one of the bubbles being selected. Additionally, WMShell will display the expanded bubble
- * view above the bar.
+ * with one of the bubbles being selected. Additionally, WMShell will display the expanded bubble
+ * view above the bar.
* <p>
* The bubble bar has some behavior related to taskbar:
* - When taskbar is unstashed, bubble bar will also become unstashed (but in its "collapsed"
- * state)
+ * state)
* - When taskbar is stashed, bubble bar will also become stashed (unless bubble bar is in its
- * "expanded" state)
+ * "expanded" state)
* - When bubble bar is in its "expanded" state, taskbar becomes stashed
* <p>
* If there are no bubbles, the bubble bar and bubble stashed handle are not shown. Additionally
@@ -64,6 +65,7 @@
// TODO: (b/273594744) calculate the amount of space we have and base the max on that
// if it's smaller than 5.
private static final int MAX_BUBBLES = 5;
+ private static final int ARROW_POSITION_ANIMATION_DURATION_MS = 200;
private final TaskbarActivityContext mActivityContext;
private final BubbleBarBackground mBubbleBarBackground;
@@ -209,14 +211,18 @@
/**
* Sets which bubble view should be shown as selected.
*/
- // TODO: (b/273592694) animate it
public void setSelectedBubble(BubbleView view) {
mSelectedBubbleView = view;
- updateArrowForSelected();
- invalidate();
+ updateArrowForSelected(/* shouldAnimate= */ true);
}
- private void updateArrowForSelected() {
+ /**
+ * Update the arrow position to match the selected bubble.
+ *
+ * @param shouldAnimate whether or not to animate the arrow. If the bar was just expanded, this
+ * should be set to {@code false}. Otherwise set this to {@code true}.
+ */
+ private void updateArrowForSelected(boolean shouldAnimate) {
if (mSelectedBubbleView == null) {
Log.w(TAG, "trying to update selection arrow without a selected view!");
return;
@@ -224,7 +230,21 @@
final int index = indexOfChild(mSelectedBubbleView);
// Find the center of the bubble when it's expanded, set the arrow position to it.
final float tx = getPaddingStart() + index * (mIconSize + mIconSpacing) + mIconSize / 2f;
- mBubbleBarBackground.setArrowPosition(tx);
+
+ if (shouldAnimate) {
+ final float currentArrowPosition = mBubbleBarBackground.getArrowPositionX();
+ ValueAnimator animator = ValueAnimator.ofFloat(currentArrowPosition, tx);
+ animator.setDuration(ARROW_POSITION_ANIMATION_DURATION_MS);
+ animator.addUpdateListener(animation -> {
+ float x = (float) animation.getAnimatedValue();
+ mBubbleBarBackground.setArrowPosition(x);
+ invalidate();
+ });
+ animator.start();
+ } else {
+ mBubbleBarBackground.setArrowPosition(tx);
+ invalidate();
+ }
}
@Override
@@ -248,7 +268,7 @@
public void setExpanded(boolean isBarExpanded) {
if (mIsBarExpanded != isBarExpanded) {
mIsBarExpanded = isBarExpanded;
- updateArrowForSelected();
+ updateArrowForSelected(/* shouldAnimate= */ false);
setOrUnsetClickListener();
if (!isBarExpanded && mReorderRunnable != null) {
mReorderRunnable.run();
diff --git a/quickstep/src/com/android/quickstep/util/TransformParams.java b/quickstep/src/com/android/quickstep/util/TransformParams.java
index aa9a45b..0f20e43 100644
--- a/quickstep/src/com/android/quickstep/util/TransformParams.java
+++ b/quickstep/src/com/android/quickstep/util/TransformParams.java
@@ -17,11 +17,9 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import android.util.FloatProperty;
import android.view.RemoteAnimationTarget;
-import android.view.SurfaceControl;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.Interpolators;
@@ -61,7 +59,6 @@
private float mCornerRadius;
private RemoteAnimationTargets mTargetSet;
private SurfaceTransactionApplier mSyncTransactionApplier;
- private SurfaceControl mRecentsSurface;
private BuilderProxy mHomeBuilderProxy = BuilderProxy.ALWAYS_VISIBLE;
private BuilderProxy mBaseBuilderProxy = BuilderProxy.ALWAYS_VISIBLE;
@@ -141,8 +138,9 @@
public SurfaceTransaction createSurfaceParams(BuilderProxy proxy) {
RemoteAnimationTargets targets = mTargetSet;
SurfaceTransaction transaction = new SurfaceTransaction();
- mRecentsSurface = getRecentsSurface(targets);
-
+ if (targets == null) {
+ return transaction;
+ }
for (int i = 0; i < targets.unfilteredApps.length; i++) {
RemoteAnimationTarget app = targets.unfilteredApps[i];
SurfaceProperties builder = transaction.forSurface(app.leash);
@@ -176,20 +174,6 @@
return transaction;
}
- private static SurfaceControl getRecentsSurface(RemoteAnimationTargets targets) {
- for (int i = 0; i < targets.unfilteredApps.length; i++) {
- RemoteAnimationTarget app = targets.unfilteredApps[i];
- if (app.mode == targets.targetMode) {
- if (app.windowConfiguration.getActivityType() == ACTIVITY_TYPE_RECENTS) {
- return app.leash;
- }
- } else {
- return app.leash;
- }
- }
- return null;
- }
-
// Pubic getters so outside packages can read the values.
public float getProgress() {
@@ -204,10 +188,6 @@
return mCornerRadius;
}
- public SurfaceControl getRecentsSurface() {
- return mRecentsSurface;
- }
-
public RemoteAnimationTargets getTargetSet() {
return mTargetSet;
}
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index ce8d901..8136534 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -199,6 +199,9 @@
<attr name="demoModeLayoutId" format="reference" />
<attr name="isScalable" format="boolean" />
<attr name="devicePaddingId" format="reference" />
+ <!-- File that contains the specs for the workspace.
+ Needs FeatureFlags.ENABLE_RESPONSIVE_WORKSPACE enabled -->
+ <attr name="workspaceSpecsId" format="reference" />
<!-- By default all categories are enabled -->
<attr name="deviceCategory" format="integer">
<!-- Enable on phone only -->
diff --git a/res/xml/widget_sections.xml b/res/xml/widget_sections.xml
index 6165bf7..742991f 100644
--- a/res/xml/widget_sections.xml
+++ b/res/xml/widget_sections.xml
@@ -26,6 +26,6 @@
launcher:category="1"
launcher:sectionDrawable="@drawable/ic_note_taking_widget_category"
launcher:sectionTitle="@string/widget_category_note_taking">
- <widget launcher:provider="com.android.settings/com.android.settings.notetask.shortcut.CreateNoteTaskShortcutActivity" />
+ <widget launcher:provider="com.android.systemui/.notetask.shortcut.CreateNoteTaskShortcutActivity" />
</section>
</widget-sections>
\ No newline at end of file
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 8675226..0231090 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -101,6 +101,7 @@
public final float aspectRatio;
public final boolean isScalableGrid;
+ public final boolean isResponsiveGrid;
private final int mTypeIndex;
/**
@@ -293,6 +294,10 @@
this.rotationHint = windowBounds.rotationHint;
mInsets.set(windowBounds.insets);
+ // TODO(b/241386436):
+ // for testing that the flag works only, shouldn't change any launcher behaviour
+ isResponsiveGrid = inv.workspaceSpecsId != INVALID_RESOURCE_HANDLE;
+
isScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode;
// Determine device posture.
mInfo = info;
@@ -1577,6 +1582,7 @@
writer.println(prefix + "\taspectRatio:" + aspectRatio);
+ writer.println(prefix + "\tisResponsiveGrid:" + isResponsiveGrid);
writer.println(prefix + "\tisScalableGrid:" + isScalableGrid);
writer.println(prefix + "\tinv.numRows: " + inv.numRows);
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 3aa582d..376f54d 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -48,6 +48,7 @@
import androidx.annotation.XmlRes;
import androidx.core.content.res.ResourcesCompat;
+import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.model.DeviceGridState;
import com.android.launcher3.provider.RestoreDbTask;
@@ -105,7 +106,7 @@
static final int INDEX_TWO_PANEL_PORTRAIT = 2;
static final int INDEX_TWO_PANEL_LANDSCAPE = 3;
- /** These resources are used to override the device profile */
+ /** These resources are used to override the device profile */
private static final String RES_GRID_NUM_ROWS = "grid_num_rows";
private static final String RES_GRID_NUM_COLUMNS = "grid_num_columns";
private static final String RES_GRID_ICON_SIZE_DP = "grid_icon_size_dp";
@@ -177,6 +178,8 @@
protected boolean isScalable;
@XmlRes
public int devicePaddingId = INVALID_RESOURCE_HANDLE;
+ @XmlRes
+ public int workspaceSpecsId = INVALID_RESOURCE_HANDLE;
public String dbFile;
public int defaultLayoutId;
@@ -350,6 +353,7 @@
isScalable = closestProfile.isScalable;
devicePaddingId = closestProfile.devicePaddingId;
+ workspaceSpecsId = closestProfile.mWorkspaceSpecsId;
this.deviceType = deviceType;
inlineNavButtonsEndSpacing = closestProfile.inlineNavButtonsEndSpacing;
@@ -795,6 +799,7 @@
private final boolean isScalable;
private final int devicePaddingId;
+ private final int mWorkspaceSpecsId;
public GridOption(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(
@@ -836,7 +841,7 @@
inlineNavButtonsEndSpacing =
a.getResourceId(R.styleable.GridDisplayOption_inlineNavButtonsEndSpacing,
- R.dimen.taskbar_button_margin_default);
+ R.dimen.taskbar_button_margin_default);
numFolderRows = a.getInt(
R.styleable.GridDisplayOption_numFolderRows, numRows);
@@ -856,6 +861,13 @@
deviceCategory = a.getInt(R.styleable.GridDisplayOption_deviceCategory,
DEVICE_CATEGORY_ALL);
+ if (FeatureFlags.ENABLE_RESPONSIVE_WORKSPACE.get()) {
+ mWorkspaceSpecsId = a.getResourceId(
+ R.styleable.GridDisplayOption_workspaceSpecsId, INVALID_RESOURCE_HANDLE);
+ } else {
+ mWorkspaceSpecsId = INVALID_RESOURCE_HANDLE;
+ }
+
int inlineForRotation = a.getInt(R.styleable.GridDisplayOption_inlineQsb,
DONT_INLINE_QSB);
inlineQsb[INDEX_DEFAULT] =
diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java
index 8250a99..8dc1204 100644
--- a/src/com/android/launcher3/config/FeatureFlags.java
+++ b/src/com/android/launcher3/config/FeatureFlags.java
@@ -416,6 +416,10 @@
// TODO(Block 32): Empty block
+ public static final BooleanFlag ENABLE_RESPONSIVE_WORKSPACE = getDebugFlag(241386436,
+ "ENABLE_RESPONSIVE_WORKSPACE", DISABLED,
+ "Enables new workspace grid calculations method.");
+
public static class BooleanFlag {
private final boolean mCurrentValue;
diff --git a/tests/src/com/android/launcher3/AbstractDeviceProfileTest.kt b/tests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
index 0fe8bee..01f494b 100644
--- a/tests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
+++ b/tests/src/com/android/launcher3/AbstractDeviceProfileTest.kt
@@ -50,7 +50,7 @@
private lateinit var originalWindowManagerProxy: WindowManagerProxy
@Before
- fun setUp() {
+ open fun setUp() {
val appContext: Context = ApplicationProvider.getApplicationContext()
originalWindowManagerProxy = WindowManagerProxy.INSTANCE.get(appContext)
originalDisplayController = DisplayController.INSTANCE.get(appContext)
@@ -59,7 +59,7 @@
}
@After
- fun tearDown() {
+ open fun tearDown() {
WindowManagerProxy.INSTANCE.initializeForTesting(originalWindowManagerProxy)
DisplayController.INSTANCE.initializeForTesting(originalDisplayController)
}
diff --git a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
index 13db6c7..a81413e 100644
--- a/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
+++ b/tests/src/com/android/launcher3/nonquickstep/DeviceProfileDumpTest.kt
@@ -58,6 +58,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 126.0px (48.0dp)\n" +
"\taspectRatio:2.2222223\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 5\n" +
@@ -193,6 +194,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 63.0px (24.0dp)\n" +
"\taspectRatio:2.2222223\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 5\n" +
@@ -328,6 +330,7 @@
"\tmInsets.right: 126.0px (48.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:2.2222223\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 5\n" +
@@ -463,6 +466,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 63.0px (24.0dp)\n" +
"\taspectRatio:2.2222223\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 5\n" +
@@ -599,6 +603,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.6\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:true\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 6\n" +
@@ -735,6 +740,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.6\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:true\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 6\n" +
@@ -871,6 +877,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.6\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:true\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 6\n" +
@@ -1007,6 +1014,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.6\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:true\n" +
"\tinv.numRows: 5\n" +
"\tinv.numColumns: 6\n" +
@@ -1148,6 +1156,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.2\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 4\n" +
"\tinv.numColumns: 4\n" +
@@ -1288,6 +1297,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.2\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 4\n" +
"\tinv.numColumns: 4\n" +
@@ -1428,6 +1438,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.2\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 4\n" +
"\tinv.numColumns: 4\n" +
@@ -1564,6 +1575,7 @@
"\tmInsets.right: 0.0px (0.0dp)\n" +
"\tmInsets.bottom: 0.0px (0.0dp)\n" +
"\taspectRatio:1.2\n" +
+ "\tisResponsiveGrid:false\n" +
"\tisScalableGrid:false\n" +
"\tinv.numRows: 4\n" +
"\tinv.numColumns: 4\n" +