Snap for 7571196 from eb894b577a to sc-v2-release
Change-Id: I8d321b6f05153d53f925ed6422653f52bede4f5a
This commit is contained in:
@@ -36,18 +36,27 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/start_contextual_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
|
||||
android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="start"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/start_nav_buttons"
|
||||
android:id="@+id/end_nav_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
|
||||
android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="start"/>
|
||||
android:layout_gravity="end"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/end_nav_buttons"
|
||||
android:id="@+id/end_contextual_buttons"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<string name="hotsaet_tip_prediction_disabled" msgid="1506426298884658491">"सुझाए गए ऐप्लिकेशन की सुविधा बंद है"</string>
|
||||
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"सुझाया गया ऐप्लिकेशन: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
|
||||
<string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="1711645592102201538">"पक्का करें कि आप स्क्रीन की दाईं या बाईं ओर के बिल्कुल किनारे से स्वाइप कर रहे हों."</string>
|
||||
<string name="back_gesture_feedback_cancelled" msgid="3274382913290074496">"पक्का करें कि आप स्क्रीन के दाएं या बाएं किनारे से, स्क्रीन के बीच तक स्वाइप करें और फिर अपनी उंगली उठा लें."</string>
|
||||
<string name="back_gesture_feedback_cancelled" msgid="3274382913290074496">"स्क्रीन के दाएं या बाएं किनारे से स्क्रीन के बीच तक स्वाइप करें और अपनी उंगली उठा लें."</string>
|
||||
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"आपने स्क्रीन के दाएं किनारे से स्वाइप करके, पिछली स्क्रीन पर वापस जाने का तरीका सीख लिया है. अब, एक ऐप से दूसरे ऐप पर जाने का तरीका सीखें."</string>
|
||||
<string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"आपने पेज पर पीछे ले जाने वाले हाथ के जेस्चर (हाव-भाव) के बारे में जान लिया है."</string>
|
||||
<string name="back_gesture_feedback_swipe_in_nav_bar" msgid="1148198467090405643">"देखे लें कि आप स्क्रीन पर बिल्कुल नीचे तक स्वाइप न कर रहे हों."</string>
|
||||
|
||||
@@ -48,16 +48,16 @@
|
||||
<string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="1711645592102201538">"右端または左端からスワイプしてください。"</string>
|
||||
<string name="back_gesture_feedback_cancelled" msgid="3274382913290074496">"画面の右端または左端から中央に向かってスワイプし、指を離してください。"</string>
|
||||
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"右側からスワイプして前の画面に戻る方法を学習しました。次は、アプリを切り替える方法を覚えましょう。"</string>
|
||||
<string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"「戻る」操作を完了しました。"</string>
|
||||
<string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"「戻る」操作を学習しました。"</string>
|
||||
<string name="back_gesture_feedback_swipe_in_nav_bar" msgid="1148198467090405643">"スワイプする際は画面の下部に近づきすぎないようにしましょう。"</string>
|
||||
<string name="back_gesture_tutorial_confirm_subtitle" msgid="5181305411668713250">"「戻る」操作の感度を変更するには [設定] に移動します"</string>
|
||||
<string name="back_gesture_intro_title" msgid="19551256430224428">"スワイプで戻りましょう"</string>
|
||||
<string name="back_gesture_intro_title" msgid="19551256430224428">"スワイプで戻る"</string>
|
||||
<string name="back_gesture_intro_subtitle" msgid="7912576483031802797">"直前の画面に戻るには、画面の左端または右端から中央に向かってスワイプします。"</string>
|
||||
<string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="1446774096007065298">"画面の下端から上にスワイプしてください。"</string>
|
||||
<string name="home_gesture_feedback_overview_detected" msgid="1557523944897393013">"指を離す前にいったん止めないでください。"</string>
|
||||
<string name="home_gesture_feedback_wrong_swipe_direction" msgid="6993979358080825438">"まっすぐ上にスワイプしてください。"</string>
|
||||
<string name="home_gesture_feedback_complete_with_follow_up" msgid="1427872029729605034">"「ホームに戻る」操作を完了しました。次は、前の画面に戻る方法を覚えましょう。"</string>
|
||||
<string name="home_gesture_feedback_complete_without_follow_up" msgid="8049099486868933882">"「ホームに戻る」操作を完了しました。"</string>
|
||||
<string name="home_gesture_feedback_complete_with_follow_up" msgid="1427872029729605034">"「ホームに戻る」操作を学習しました。次は、前の画面に戻る方法を覚えましょう。"</string>
|
||||
<string name="home_gesture_feedback_complete_without_follow_up" msgid="8049099486868933882">"「ホームに戻る」操作を学習しました。"</string>
|
||||
<string name="home_gesture_intro_title" msgid="836590312858441830">"スワイプでホームに戻る"</string>
|
||||
<string name="home_gesture_intro_subtitle" msgid="2632238748497975326">"画面を下から上にスワイプします。この操作でいつでもホーム画面に戻れます。"</string>
|
||||
<string name="overview_gesture_feedback_swipe_too_far_from_edge" msgid="3032757898111577225">"画面の下端から上にスワイプしてください。"</string>
|
||||
@@ -65,7 +65,7 @@
|
||||
<string name="overview_gesture_feedback_wrong_swipe_direction" msgid="6725820500906747925">"まっすぐ上にスワイプしてから、いったん指を止めてください。"</string>
|
||||
<string name="overview_gesture_feedback_complete_with_follow_up" msgid="3544611727467765026">"主な操作方法を覚えました。操作を OFF にするには、設定に移動してください。"</string>
|
||||
<string name="overview_gesture_feedback_complete_without_follow_up" msgid="3199486203448379152">"「アプリを切り替える」操作を完了しました。"</string>
|
||||
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"スワイプでアプリを切り替え"</string>
|
||||
<string name="overview_gesture_intro_title" msgid="2902054412868489378">"スワイプでアプリを切り替える"</string>
|
||||
<string name="overview_gesture_intro_subtitle" msgid="4968091015637850859">"アプリを切り替えるには、画面を下から上にスワイプして長押しし、指を離します。"</string>
|
||||
<string name="gesture_tutorial_confirm_title" msgid="6201516182040074092">"設定完了"</string>
|
||||
<string name="gesture_tutorial_action_button_label" msgid="6249846312991332122">"完了"</string>
|
||||
@@ -81,7 +81,7 @@
|
||||
<string name="action_screenshot" msgid="8171125848358142917">"スクリーンショット"</string>
|
||||
<string name="blocked_by_policy" msgid="2071401072261365546">"この操作はアプリまたは組織で許可されていません"</string>
|
||||
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"操作チュートリアルをスキップしますか?"</string>
|
||||
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"これは後から <xliff:g id="NAME">%1$s</xliff:g> アプリで確認できます"</string>
|
||||
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"チュートリアルは後から <xliff:g id="NAME">%1$s</xliff:g> アプリで確認できます"</string>
|
||||
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"キャンセル"</string>
|
||||
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"スキップ"</string>
|
||||
</resources>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Таамаглаж буй апп: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
|
||||
<string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="1711645592102201538">"Та баруун зах эсвэл зүүн захын булангаас шударна уу."</string>
|
||||
<string name="back_gesture_feedback_cancelled" msgid="3274382913290074496">"Та баруун эсвэл зүүн булангаас дэлгэцийн дунд хэсэг хүртэл шударч, суллана уу."</string>
|
||||
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Та буцахын тулд баруунаас хэрхэн шудрахыг мэдэж авлаа Дараа нь аппыг хэрхэн сэлгэхийг мэдэж аваарай."</string>
|
||||
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Та буцахын тулд баруунаас хэрхэн шудрахыг мэдэж авлаа. Дараа нь аппууд хооронд хэрхэн сэлгэхийг мэдэж аваарай."</string>
|
||||
<string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"Та буцах зангааг гүйцэтгэлээ."</string>
|
||||
<string name="back_gesture_feedback_swipe_in_nav_bar" msgid="1148198467090405643">"Та дэлгэцийн доод хэсэгтэй хэт ойр бүү шудраарай."</string>
|
||||
<string name="back_gesture_tutorial_confirm_subtitle" msgid="5181305411668713250">"Буцах зангааны мэдрэгшлийг өөрчлөх бол Тохиргоо руу очно уу"</string>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<string name="recent_task_option_freeform" msgid="48863056265284071">"फ्रिफर्म"</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="recents_clear_all" msgid="5328176793634888831">"सबै मेटाउनुहोस्"</string>
|
||||
<string name="accessibility_recent_apps" msgid="4058661986695117371">"हालसालैका एपहरू"</string>
|
||||
<string name="task_contents_description_with_remaining_time" msgid="4479688746574672685">"<xliff:g id="TASK_DESCRIPTION">%1$s</xliff:g>, <xliff:g id="REMAINING_TIME">%2$s</xliff:g>"</string>
|
||||
<string name="shorter_duration_less_than_one_minute" msgid="4722015666335015336">"< १ मिनेट"</string>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<string name="action_screenshot" msgid="8171125848358142917">"ภาพหน้าจอ"</string>
|
||||
<string name="blocked_by_policy" msgid="2071401072261365546">"แอปหรือองค์กรของคุณไม่อนุญาตการดำเนินการนี้"</string>
|
||||
<string name="skip_tutorial_dialog_title" msgid="2725643161260038458">"ข้ามบทแนะนำการนำทางไหม"</string>
|
||||
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"คุณดูบทแนะนำนี้ได้ภายหลังในแอป <xliff:g id="NAME">%1$s</xliff:g>"</string>
|
||||
<string name="skip_tutorial_dialog_subtitle" msgid="544063326241955662">"คุณดูบทแนะนำนี้ได้ภายหลังในแอป \"<xliff:g id="NAME">%1$s</xliff:g>\""</string>
|
||||
<string name="gesture_tutorial_action_button_label_cancel" msgid="3809842569351264108">"ยกเลิก"</string>
|
||||
<string name="gesture_tutorial_action_button_label_skip" msgid="394452764989751960">"ข้าม"</string>
|
||||
</resources>
|
||||
|
||||
@@ -47,11 +47,11 @@
|
||||
<string name="hotseat_prediction_content_description" msgid="4582028296938078419">"Ứng dụng dự đoán: <xliff:g id="TITLE">%1$s</xliff:g>"</string>
|
||||
<string name="back_gesture_feedback_swipe_too_far_from_edge" msgid="1711645592102201538">"Hãy vuốt từ mép ngoài cùng bên phải hoặc ngoài cùng bên trái."</string>
|
||||
<string name="back_gesture_feedback_cancelled" msgid="3274382913290074496">"Hãy vuốt từ mép phải hoặc mép trái tới giữa màn hình rồi thả tay ra."</string>
|
||||
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Bạn đã tìm hiểu cách vuốt từ mép phải để quay lại. Tiếp theo, hãy tìm hiểu cách chuyển đổi ứng dụng."</string>
|
||||
<string name="back_gesture_feedback_complete_with_overview_follow_up" msgid="9176400654037014471">"Bạn đã học được cách vuốt từ mép phải để quay lại. Tiếp theo, hãy tìm hiểu cách chuyển đổi ứng dụng."</string>
|
||||
<string name="back_gesture_feedback_complete_without_follow_up" msgid="6405649621667113830">"Bạn đã thực hiện xong cử chỉ quay lại."</string>
|
||||
<string name="back_gesture_feedback_swipe_in_nav_bar" msgid="1148198467090405643">"Hãy nhớ không được vuốt quá gần phần cuối màn hình."</string>
|
||||
<string name="back_gesture_tutorial_confirm_subtitle" msgid="5181305411668713250">"Để thay đổi độ nhạy của cử chỉ quay lại, hãy vào mục Cài đặt"</string>
|
||||
<string name="back_gesture_intro_title" msgid="19551256430224428">"Hãy vuốt để quay lại"</string>
|
||||
<string name="back_gesture_intro_title" msgid="19551256430224428">"Vuốt để quay lại"</string>
|
||||
<string name="back_gesture_intro_subtitle" msgid="7912576483031802797">"Để quay lại màn hình gần đây nhất, hãy vuốt từ mép trái hoặc mép phải tới chính giữa màn hình."</string>
|
||||
<string name="home_gesture_feedback_swipe_too_far_from_edge" msgid="1446774096007065298">"Hãy vuốt lên từ mép dưới cùng của màn hình."</string>
|
||||
<string name="home_gesture_feedback_overview_detected" msgid="1557523944897393013">"Hãy nhớ không được tạm dừng trước khi nhấc ngón tay."</string>
|
||||
@@ -75,7 +75,7 @@
|
||||
<string name="gesture_tutorial_step" msgid="1279786122817620968">"Hướng dẫn <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
|
||||
<string name="allset_title" msgid="5021126669778966707">"Đã hoàn tất!"</string>
|
||||
<string name="allset_hint" msgid="2384632994739392447">"Vuốt lên để chuyển đến Màn hình chính"</string>
|
||||
<string name="allset_description" msgid="6350320429953234580">"Hiện giờ, bạn đã có thể sử dụng điện thoại"</string>
|
||||
<string name="allset_description" msgid="6350320429953234580">"Vậy là bạn đã sẵn sàng sử dụng điện thoại của mình"</string>
|
||||
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Chế độ cài đặt di chuyển trên hệ thống"</annotation></string>
|
||||
<string name="action_share" msgid="2648470652637092375">"Chia sẻ"</string>
|
||||
<string name="action_screenshot" msgid="8171125848358142917">"Chụp ảnh màn hình"</string>
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
<item name="content_scale" format="float" type="dimen">0.97</item>
|
||||
<dimen name="closing_window_trans_y">115dp</dimen>
|
||||
|
||||
<dimen name="quick_switch_scaling_scroll_threshold">100dp</dimen>
|
||||
|
||||
<dimen name="recents_empty_message_text_size">16sp</dimen>
|
||||
<dimen name="recents_empty_message_text_padding">16dp</dimen>
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVIT
|
||||
import static com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_TRANSITIONS;
|
||||
import static com.android.launcher3.statehandlers.DepthController.DEPTH;
|
||||
import static com.android.launcher3.util.DisplayController.getSingleFrameMs;
|
||||
import static com.android.quickstep.TaskUtils.taskIsATargetWithMode;
|
||||
import static com.android.quickstep.TaskViewUtils.findTaskViewToLaunch;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.getWindowCornerRadius;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.supportsRoundedCornersOnWindows;
|
||||
@@ -1047,7 +1046,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
mLauncherOpenTransition = RemoteAnimationAdapterCompat.buildRemoteTransition(
|
||||
new LauncherAnimationRunner(mHandler, mWallpaperOpenTransitionRunner,
|
||||
false /* startAtFrontOfQueue */));
|
||||
mLauncherOpenTransition.addHomeOpenCheck();
|
||||
mLauncherOpenTransition.addHomeOpenCheck(mLauncher.getComponentName());
|
||||
SystemUiProxy.INSTANCE.getNoCreate().registerRemoteTransition(mLauncherOpenTransition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,9 +100,12 @@ public class DepthController implements StateHandler<LauncherState>,
|
||||
}
|
||||
};
|
||||
|
||||
private final Consumer<Boolean> mCrossWindowBlurListener = (enabled) -> {
|
||||
mCrossWindowBlursEnabled = enabled;
|
||||
dispatchTransactionSurface();
|
||||
private final Consumer<Boolean> mCrossWindowBlurListener = new Consumer<Boolean>() {
|
||||
@Override
|
||||
public void accept(Boolean enabled) {
|
||||
mCrossWindowBlursEnabled = enabled;
|
||||
dispatchTransactionSurface(mDepth);
|
||||
}
|
||||
};
|
||||
|
||||
private final Launcher mLauncher;
|
||||
@@ -189,14 +192,14 @@ public class DepthController implements StateHandler<LauncherState>,
|
||||
if (mSurface != surface) {
|
||||
mSurface = surface;
|
||||
if (surface != null) {
|
||||
dispatchTransactionSurface();
|
||||
dispatchTransactionSurface(mDepth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(LauncherState toState) {
|
||||
if (mIgnoreStateChangesDuringMultiWindowAnimation) {
|
||||
if (mSurface == null || mIgnoreStateChangesDuringMultiWindowAnimation) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,7 +207,7 @@ public class DepthController implements StateHandler<LauncherState>,
|
||||
if (Float.compare(mDepth, toDepth) != 0) {
|
||||
setDepth(toDepth);
|
||||
} else if (toState == LauncherState.OVERVIEW) {
|
||||
dispatchTransactionSurface();
|
||||
dispatchTransactionSurface(mDepth);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,31 +246,36 @@ public class DepthController implements StateHandler<LauncherState>,
|
||||
if (Float.compare(mDepth, depthF) == 0) {
|
||||
return;
|
||||
}
|
||||
mDepth = depthF;
|
||||
dispatchTransactionSurface();
|
||||
if (dispatchTransactionSurface(depthF)) {
|
||||
mDepth = depthF;
|
||||
}
|
||||
}
|
||||
|
||||
private void dispatchTransactionSurface() {
|
||||
private boolean dispatchTransactionSurface(float depth) {
|
||||
boolean supportsBlur = BlurUtils.supportsBlursOnWindows();
|
||||
if (supportsBlur && (mSurface == null || !mSurface.isValid())) {
|
||||
return false;
|
||||
}
|
||||
ensureDependencies();
|
||||
IBinder windowToken = mLauncher.getRootView().getWindowToken();
|
||||
if (windowToken != null) {
|
||||
mWallpaperManager.setWallpaperZoomOut(windowToken, mDepth);
|
||||
mWallpaperManager.setWallpaperZoomOut(windowToken, depth);
|
||||
}
|
||||
|
||||
if (supportsBlur && (mSurface != null && mSurface.isValid())) {
|
||||
if (supportsBlur) {
|
||||
// We cannot mark the window as opaque in overview because there will be an app window
|
||||
// below the launcher layer, and we need to draw it -- without blurs.
|
||||
boolean isOverview = mLauncher.isInState(LauncherState.OVERVIEW);
|
||||
boolean opaque = mLauncher.getScrimView().isFullyOpaque() && !isOverview;
|
||||
|
||||
int blur = opaque || isOverview || !mCrossWindowBlursEnabled
|
||||
|| mBlurDisabledForAppLaunch ? 0 : (int) (mDepth * mMaxBlurRadius);
|
||||
|| mBlurDisabledForAppLaunch ? 0 : (int) (depth * mMaxBlurRadius);
|
||||
new SurfaceControl.Transaction()
|
||||
.setBackgroundBlurRadius(mSurface, blur)
|
||||
.setOpaque(mSurface, opaque)
|
||||
.apply();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -79,8 +79,10 @@ public class NavbarButtonsViewController {
|
||||
|
||||
private final TaskbarActivityContext mContext;
|
||||
private final FrameLayout mNavButtonsView;
|
||||
private final ViewGroup mStartContainer;
|
||||
private final ViewGroup mEndContainer;
|
||||
private final ViewGroup mNavButtonContainer;
|
||||
// Used for IME+A11Y buttons
|
||||
private final ViewGroup mEndContextualContainer;
|
||||
private final ViewGroup mStartContextualContainer;
|
||||
|
||||
// Initialized in init.
|
||||
private TaskbarControllers mControllers;
|
||||
@@ -91,8 +93,9 @@ public class NavbarButtonsViewController {
|
||||
public NavbarButtonsViewController(TaskbarActivityContext context, FrameLayout navButtonsView) {
|
||||
mContext = context;
|
||||
mNavButtonsView = navButtonsView;
|
||||
mStartContainer = mNavButtonsView.findViewById(R.id.start_nav_buttons);
|
||||
mEndContainer = mNavButtonsView.findViewById(R.id.end_nav_buttons);
|
||||
mNavButtonContainer = mNavButtonsView.findViewById(R.id.end_nav_buttons);
|
||||
mEndContextualContainer = mNavButtonsView.findViewById(R.id.end_contextual_buttons);
|
||||
mStartContextualContainer = mNavButtonsView.findViewById(R.id.start_contextual_buttons);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,21 +117,22 @@ public class NavbarButtonsViewController {
|
||||
|
||||
// IME switcher
|
||||
View imeSwitcherButton = addButton(R.drawable.ic_ime_switcher, BUTTON_IME_SWITCH,
|
||||
mEndContainer, mControllers.navButtonController, R.id.ime_switcher);
|
||||
mEndContextualContainer, mControllers.navButtonController, R.id.ime_switcher);
|
||||
mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
|
||||
flags -> ((flags & MASK_IME_SWITCHER_VISIBLE) == MASK_IME_SWITCHER_VISIBLE)
|
||||
&& ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)
|
||||
&& ((flags & FLAG_A11Y_VISIBLE) == 0)));
|
||||
|
||||
mBackButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
|
||||
mStartContainer, mControllers.navButtonController, R.id.back);
|
||||
View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
|
||||
mStartContextualContainer, mControllers.navButtonController, R.id.back);
|
||||
imeDownButton.setRotation(Utilities.isRtl(mContext.getResources()) ? 90 : -90);
|
||||
// Rotate when Ime visible
|
||||
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
|
||||
flags -> (flags & FLAG_IME_VISIBLE) == 0, View.ROTATION, 0,
|
||||
Utilities.isRtl(mContext.getResources()) ? 90 : -90));
|
||||
mPropertyHolders.add(new StatePropertyHolder(imeDownButton,
|
||||
flags -> (flags & FLAG_IME_VISIBLE) != 0));
|
||||
|
||||
if (mContext.isThreeButtonNav()) {
|
||||
initButtons(mStartContainer, mEndContainer, mControllers.navButtonController);
|
||||
initButtons(mNavButtonContainer, mEndContextualContainer,
|
||||
mControllers.navButtonController);
|
||||
|
||||
// Animate taskbar background when IME shows
|
||||
mPropertyHolders.add(new StatePropertyHolder(
|
||||
@@ -142,21 +146,18 @@ public class NavbarButtonsViewController {
|
||||
|
||||
// Rotation button
|
||||
RotationButton rotationButton = new RotationButtonImpl(
|
||||
addButton(mEndContainer, R.id.rotate_suggestion));
|
||||
addButton(mEndContextualContainer, R.id.rotate_suggestion));
|
||||
rotationButton.hide();
|
||||
mControllers.rotationButtonController.setRotationButton(rotationButton);
|
||||
} else {
|
||||
mControllers.rotationButtonController.setRotationButton(new RotationButton() {});
|
||||
// Show when IME is visible
|
||||
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
|
||||
flags -> (flags & FLAG_IME_VISIBLE) != 0));
|
||||
}
|
||||
|
||||
applyState();
|
||||
mPropertyHolders.forEach(StatePropertyHolder::endAnimation);
|
||||
}
|
||||
|
||||
private void initButtons(ViewGroup startContainer, ViewGroup endContainer,
|
||||
private void initButtons(ViewGroup navContainer, ViewGroup endContainer,
|
||||
TaskbarNavButtonController navButtonController) {
|
||||
|
||||
// Hide when keyguard is showing, show when bouncer is showing
|
||||
@@ -164,14 +165,19 @@ public class NavbarButtonsViewController {
|
||||
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 ||
|
||||
(flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0));
|
||||
|
||||
mBackButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
|
||||
mNavButtonContainer, mControllers.navButtonController, R.id.back);
|
||||
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
|
||||
flags -> (flags & FLAG_IME_VISIBLE) == 0));
|
||||
|
||||
// home and recents buttons
|
||||
View homeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, startContainer,
|
||||
View homeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, navContainer,
|
||||
navButtonController, R.id.home);
|
||||
mPropertyHolders.add(new StatePropertyHolder(homeButton,
|
||||
flags -> (flags & FLAG_IME_VISIBLE) == 0 &&
|
||||
(flags & FLAG_KEYGUARD_VISIBLE) == 0));
|
||||
View recentsButton = addButton(R.drawable.ic_sysbar_recent, BUTTON_RECENTS,
|
||||
startContainer, navButtonController, R.id.recent_apps);
|
||||
navContainer, navButtonController, R.id.recent_apps);
|
||||
mPropertyHolders.add(new StatePropertyHolder(recentsButton,
|
||||
flags -> (flags & FLAG_IME_VISIBLE) == 0 &&
|
||||
(flags & FLAG_KEYGUARD_VISIBLE) == 0));
|
||||
|
||||
@@ -194,24 +194,30 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
int count = getChildCount();
|
||||
int spaceNeeded = count * (mItemMarginLeftRight * 2 + mIconTouchSize);
|
||||
int iconStart = (right - left - spaceNeeded) / 2;
|
||||
int startOffset = ApiWrapper.getHotseatStartOffset(getContext());
|
||||
if (startOffset > iconStart) {
|
||||
int diff = startOffset - iconStart;
|
||||
iconStart = isLayoutRtl() ? (iconStart - diff) : iconStart + diff;
|
||||
int navSpaceNeeded = ApiWrapper.getHotseatEndOffset(getContext());
|
||||
boolean layoutRtl = isLayoutRtl();
|
||||
int iconEnd = right - (right - left - spaceNeeded) / 2;
|
||||
boolean needMoreSpaceForNav = layoutRtl ?
|
||||
navSpaceNeeded > (iconEnd - spaceNeeded) :
|
||||
iconEnd > (right - navSpaceNeeded);
|
||||
if (needMoreSpaceForNav) {
|
||||
int offset = layoutRtl ?
|
||||
navSpaceNeeded - (iconEnd - spaceNeeded) :
|
||||
(right - navSpaceNeeded) - iconEnd;
|
||||
iconEnd += offset;
|
||||
}
|
||||
// Layout the children
|
||||
mIconLayoutBounds.left = iconStart;
|
||||
mIconLayoutBounds.right = iconEnd;
|
||||
mIconLayoutBounds.top = (bottom - top - mIconTouchSize) / 2;
|
||||
mIconLayoutBounds.bottom = mIconLayoutBounds.top + mIconTouchSize;
|
||||
for (int i = 0; i < count; i++) {
|
||||
View child = getChildAt(i);
|
||||
iconStart += mItemMarginLeftRight;
|
||||
int iconEnd = iconStart + mIconTouchSize;
|
||||
for (int i = count; i > 0; i--) {
|
||||
View child = getChildAt(i - 1);
|
||||
iconEnd -= mItemMarginLeftRight;
|
||||
int iconStart = iconEnd - mIconTouchSize;
|
||||
child.layout(iconStart, mIconLayoutBounds.top, iconEnd, mIconLayoutBounds.bottom);
|
||||
iconStart = iconEnd + mItemMarginLeftRight;
|
||||
iconEnd = iconStart - mItemMarginLeftRight;
|
||||
}
|
||||
mIconLayoutBounds.right = iconStart;
|
||||
mIconLayoutBounds.left = iconEnd;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,9 +44,9 @@ public class ApiWrapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum space that should be left empty at the start of hotseat
|
||||
* Returns the minimum space that should be left empty at the end of hotseat
|
||||
*/
|
||||
public static int getHotseatStartOffset(Context context) {
|
||||
public static int getHotseatEndOffset(Context context) {
|
||||
if (SysUINavigationMode.INSTANCE.get(context).getMode() == Mode.THREE_BUTTONS) {
|
||||
Resources res = context.getResources();
|
||||
return 2 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_spacing)
|
||||
|
||||
@@ -212,6 +212,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
|
||||
public static final long RECENTS_ATTACH_DURATION = 300;
|
||||
|
||||
private static final float MAX_QUICK_SWITCH_RECENTS_SCALE_PROGRESS = 0.07f;
|
||||
|
||||
/**
|
||||
* Used as the page index for logging when we return to the last task at the end of the gesture.
|
||||
*/
|
||||
@@ -252,6 +254,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
private SwipePipToHomeAnimator mSwipePipToHomeAnimator;
|
||||
protected boolean mIsSwipingPipToHome;
|
||||
|
||||
// Interpolate RecentsView scale from start of quick switch scroll until this scroll threshold
|
||||
private final float mQuickSwitchScaleScrollThreshold;
|
||||
|
||||
public AbsSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState,
|
||||
TaskAnimationManager taskAnimationManager, GestureState gestureState,
|
||||
long touchTimeMs, boolean continuingLastGesture,
|
||||
@@ -267,6 +272,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
mTaskAnimationManager = taskAnimationManager;
|
||||
mTouchTimeMs = touchTimeMs;
|
||||
mContinuingLastGesture = continuingLastGesture;
|
||||
mQuickSwitchScaleScrollThreshold = context.getResources().getDimension(
|
||||
R.dimen.quick_switch_scaling_scroll_threshold);
|
||||
|
||||
initAfterSubclassConstructor();
|
||||
initStateCallbacks();
|
||||
@@ -539,7 +546,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
@Override
|
||||
public void onMotionPauseDetected() {
|
||||
mHasMotionEverBeenPaused = true;
|
||||
maybeUpdateRecentsAttachedState();
|
||||
maybeUpdateRecentsAttachedState(true/* animate */, true/* moveFocusedTask */);
|
||||
performHapticFeedback();
|
||||
}
|
||||
|
||||
@@ -550,18 +557,24 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
};
|
||||
}
|
||||
|
||||
public void maybeUpdateRecentsAttachedState() {
|
||||
private void maybeUpdateRecentsAttachedState() {
|
||||
maybeUpdateRecentsAttachedState(true /* animate */);
|
||||
}
|
||||
|
||||
private void maybeUpdateRecentsAttachedState(boolean animate) {
|
||||
maybeUpdateRecentsAttachedState(animate, false /* moveFocusedTask */);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether to show or hide RecentsView. The window is always
|
||||
* synchronized with its corresponding TaskView in RecentsView, so if
|
||||
* RecentsView is shown, it will appear to be attached to the window.
|
||||
*
|
||||
* Note this method has no effect unless the navigation mode is NO_BUTTON.
|
||||
* @param animate whether to animate when attaching RecentsView
|
||||
* @param moveFocusedTask whether to move focused task to front when attaching
|
||||
*/
|
||||
private void maybeUpdateRecentsAttachedState(boolean animate) {
|
||||
private void maybeUpdateRecentsAttachedState(boolean animate, boolean moveFocusedTask) {
|
||||
if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) {
|
||||
return;
|
||||
}
|
||||
@@ -580,6 +593,12 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
} else {
|
||||
recentsAttachedToAppWindow = mHasMotionEverBeenPaused || mIsLikelyToStartNewTask;
|
||||
}
|
||||
if (moveFocusedTask && !mAnimationFactory.hasRecentsEverAttachedToAppWindow()
|
||||
&& recentsAttachedToAppWindow) {
|
||||
// Only move focused task if RecentsView has never been attached before, to avoid
|
||||
// TaskView jumping to new position as we move the tasks.
|
||||
mRecentsView.moveFocusedTaskToFront();
|
||||
}
|
||||
mAnimationFactory.setRecentsAttachedToAppWindow(recentsAttachedToAppWindow, animate);
|
||||
|
||||
// Reapply window transform throughout the attach animation, as the animation affects how
|
||||
@@ -669,7 +688,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
|| !canCreateNewOrUpdateExistingLauncherTransitionController()) {
|
||||
return;
|
||||
}
|
||||
mLauncherTransitionController.setProgress(mCurrentShift.value, mDragLengthFactor);
|
||||
mLauncherTransitionController.setProgress(
|
||||
Math.max(mCurrentShift.value, getScaleProgressDueToScroll()), mDragLengthFactor);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1784,7 +1804,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
*/
|
||||
protected void applyWindowTransform() {
|
||||
if (mWindowTransitionController != null) {
|
||||
mWindowTransitionController.setProgress(mCurrentShift.value, mDragLengthFactor);
|
||||
mWindowTransitionController.setProgress(
|
||||
Math.max(mCurrentShift.value, getScaleProgressDueToScroll()),
|
||||
mDragLengthFactor);
|
||||
}
|
||||
// No need to apply any transform if there is ongoing swipe-pip-to-home animator since
|
||||
// that animator handles the leash solely.
|
||||
@@ -1797,6 +1819,35 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
ProtoTracer.INSTANCE.get(mContext).scheduleFrameUpdate();
|
||||
}
|
||||
|
||||
// Scaling of RecentsView during quick switch based on amount of recents scroll
|
||||
private float getScaleProgressDueToScroll() {
|
||||
if (!mActivity.getDeviceProfile().isTablet || mRecentsView == null
|
||||
|| !mRecentsViewScrollLinked) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
float scrollOffset = Math.abs(mRecentsView.getScrollOffset(mRecentsView.getCurrentPage()));
|
||||
int maxScrollOffset = mRecentsView.getPagedOrientationHandler().getPrimaryValue(
|
||||
mRecentsView.getLastComputedTaskSize().width(),
|
||||
mRecentsView.getLastComputedTaskSize().height());
|
||||
maxScrollOffset += mRecentsView.getPageSpacing();
|
||||
|
||||
float maxScaleProgress =
|
||||
MAX_QUICK_SWITCH_RECENTS_SCALE_PROGRESS * mRecentsView.getMaxScaleForFullScreen();
|
||||
float scaleProgress = maxScaleProgress;
|
||||
|
||||
if (scrollOffset < mQuickSwitchScaleScrollThreshold) {
|
||||
scaleProgress = Utilities.mapToRange(scrollOffset, 0, mQuickSwitchScaleScrollThreshold,
|
||||
0, maxScaleProgress, ACCEL_DEACCEL);
|
||||
} else if (scrollOffset > (maxScrollOffset - mQuickSwitchScaleScrollThreshold)) {
|
||||
scaleProgress = Utilities.mapToRange(scrollOffset,
|
||||
(maxScrollOffset - mQuickSwitchScaleScrollThreshold), maxScrollOffset,
|
||||
maxScaleProgress, 0, ACCEL_DEACCEL);
|
||||
}
|
||||
|
||||
return scaleProgress;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used for winscope tracing, see launcher_trace.proto
|
||||
* @see com.android.systemui.shared.tracing.ProtoTraceable#writeToProto
|
||||
|
||||
@@ -400,6 +400,10 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
default boolean isRecentsAttachedToAppWindow() {
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean hasRecentsEverAttachedToAppWindow() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class DefaultAnimationFactory implements AnimationFactory {
|
||||
@@ -409,6 +413,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
private final Consumer<AnimatorControllerWithResistance> mCallback;
|
||||
|
||||
private boolean mIsAttachedToWindow;
|
||||
private boolean mHasEverAttachedToWindow;
|
||||
|
||||
DefaultAnimationFactory(Consumer<AnimatorControllerWithResistance> callback) {
|
||||
mCallback = callback;
|
||||
@@ -462,6 +467,9 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
}
|
||||
mIsAttachedToWindow = attached;
|
||||
RecentsView recentsView = mActivity.getOverviewPanel();
|
||||
if (attached) {
|
||||
mHasEverAttachedToWindow = true;
|
||||
}
|
||||
Animator fadeAnim = mActivity.getStateManager()
|
||||
.createStateElementAnimation(INDEX_RECENTS_FADE_ANIM, attached ? 1 : 0);
|
||||
|
||||
@@ -491,6 +499,11 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
return mIsAttachedToWindow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRecentsEverAttachedToAppWindow() {
|
||||
return mHasEverAttachedToWindow;
|
||||
}
|
||||
|
||||
protected void createBackgroundToOverviewAnim(ACTIVITY_TYPE activity, PendingAnimation pa) {
|
||||
// Scale down recents from being full screen to being in overview.
|
||||
RecentsView recentsView = activity.getOverviewPanel();
|
||||
|
||||
@@ -358,7 +358,7 @@ public class SystemUiProxy implements ISystemUiProxy,
|
||||
try {
|
||||
mSystemUiProxy.setSplitScreenMinimized(minimized);
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "Failed call stopScreenPinning", e);
|
||||
Log.w(TAG, "Failed call setSplitScreenMinimized", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +307,6 @@ public class TouchInteractionService extends Service implements PluginListener<O
|
||||
return sConnected;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isInitialized() {
|
||||
return sIsInitialized;
|
||||
}
|
||||
|
||||
@@ -17,13 +17,10 @@ package com.android.quickstep.views;
|
||||
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALL_APPS_EDU_SHOWN;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
@@ -35,7 +32,7 @@ import android.graphics.Rect;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
@@ -44,25 +41,21 @@ import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.allapps.AllAppsTransitionController;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.dragndrop.DragLayer;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.quickstep.util.MultiValueUpdateListener;
|
||||
|
||||
/**
|
||||
* View used to educate the user on how to access All Apps when in No Nav Button navigation mode.
|
||||
* Consumes all touches until after the animation is completed and the view is removed.
|
||||
* If the user drags on the view, the animation is overridden so the user can swipe to All Apps or
|
||||
* Home.
|
||||
*/
|
||||
public class AllAppsEduView extends AbstractFloatingView {
|
||||
|
||||
private static final float HINT_PROG_SCRIM_THRESHOLD = 0.06f;
|
||||
private static final float HINT_PROG_CONTENT_THRESHOLD = 0.08f;
|
||||
|
||||
private Launcher mLauncher;
|
||||
private AllAppsEduTouchController mTouchController;
|
||||
|
||||
private AnimatorSet mAnimation;
|
||||
|
||||
@@ -123,8 +116,35 @@ public class AllAppsEduView extends AbstractFloatingView {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onControllerTouchEvent(MotionEvent ev) {
|
||||
mTouchController.onControllerTouchEvent(ev);
|
||||
if (mAnimation != null) {
|
||||
updateAnimationOnTouchEvent(ev);
|
||||
}
|
||||
return super.onControllerTouchEvent(ev);
|
||||
}
|
||||
|
||||
private void updateAnimationOnTouchEvent(MotionEvent ev) {
|
||||
switch (ev.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mAnimation.pause();
|
||||
return;
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
mAnimation.resume();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mTouchController.isDraggingOrSettling()) {
|
||||
mAnimation = null;
|
||||
handleClose(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
|
||||
mTouchController.onControllerInterceptTouchEvent(ev);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -145,23 +165,9 @@ public class AllAppsEduView extends AbstractFloatingView {
|
||||
int secondPart = 1200;
|
||||
int introDuration = firstPart + secondPart;
|
||||
|
||||
StateAnimationConfig config = new StateAnimationConfig();
|
||||
config.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL,
|
||||
HINT_PROG_SCRIM_THRESHOLD, HINT_PROG_CONTENT_THRESHOLD));
|
||||
config.setInterpolator(ANIM_SCRIM_FADE,
|
||||
Interpolators.clampToProgress(ACCEL, 0, HINT_PROG_CONTENT_THRESHOLD));
|
||||
config.duration = secondPart;
|
||||
config.userControlled = false;
|
||||
AnimatorPlaybackController stateAnimationController =
|
||||
mLauncher.getStateManager().createAnimationToNewWorkspace(ALL_APPS, config);
|
||||
float maxAllAppsProgress = mLauncher.getDeviceProfile().isLandscape ? 0.35f : 0.15f;
|
||||
|
||||
AllAppsTransitionController allAppsController = mLauncher.getAllAppsController();
|
||||
PendingAnimation allAppsAlpha = new PendingAnimation(config.duration);
|
||||
allAppsController.setAlphas(ALL_APPS, config, allAppsAlpha);
|
||||
mLauncher.getWorkspace().getStateTransitionAnimation().setScrim(allAppsAlpha, ALL_APPS,
|
||||
config);
|
||||
mAnimation.play(allAppsAlpha.buildAnim());
|
||||
mTouchController.initAllAppsAnimation();
|
||||
float maxAllAppsProgress = 0.75f;
|
||||
|
||||
ValueAnimator intro = ValueAnimator.ofFloat(0, 1f);
|
||||
intro.setInterpolator(LINEAR);
|
||||
@@ -198,6 +204,7 @@ public class AllAppsEduView extends AbstractFloatingView {
|
||||
mGradient.setAlpha(0);
|
||||
}
|
||||
});
|
||||
mLauncher.getAppsView().setVisibility(View.VISIBLE);
|
||||
mAnimation.play(intro);
|
||||
|
||||
ValueAnimator closeAllApps = ValueAnimator.ofFloat(maxAllAppsProgress, 0f);
|
||||
@@ -223,6 +230,7 @@ public class AllAppsEduView extends AbstractFloatingView {
|
||||
|
||||
private void init(Launcher launcher) {
|
||||
mLauncher = launcher;
|
||||
mTouchController = new AllAppsEduTouchController(mLauncher);
|
||||
|
||||
int accentColor = Themes.getColorAccent(launcher);
|
||||
mGradient = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM,
|
||||
@@ -250,9 +258,8 @@ public class AllAppsEduView extends AbstractFloatingView {
|
||||
*/
|
||||
public static void show(Launcher launcher) {
|
||||
final DragLayer dragLayer = launcher.getDragLayer();
|
||||
ViewGroup parent = (ViewGroup) dragLayer.getParent();
|
||||
AllAppsEduView view = launcher.getViewCache().getView(R.layout.all_apps_edu_view,
|
||||
launcher, parent);
|
||||
AllAppsEduView view = (AllAppsEduView) launcher.getLayoutInflater().inflate(
|
||||
R.layout.all_apps_edu_view, dragLayer, false);
|
||||
view.init(launcher);
|
||||
launcher.getDragLayer().addView(view);
|
||||
launcher.getStatsLogManager().logger().log(LAUNCHER_ALL_APPS_EDU_SHOWN);
|
||||
@@ -260,4 +267,27 @@ public class AllAppsEduView extends AbstractFloatingView {
|
||||
view.requestLayout();
|
||||
view.playAnimation();
|
||||
}
|
||||
|
||||
private static class AllAppsEduTouchController extends PortraitStatesTouchController {
|
||||
|
||||
private AllAppsEduTouchController(Launcher l) {
|
||||
super(l);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canInterceptTouch(MotionEvent ev) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private AnimatorPlaybackController initAllAppsAnimation() {
|
||||
mFromState = NORMAL;
|
||||
mToState = ALL_APPS;
|
||||
mProgressMultiplier = initCurrentAnimation();
|
||||
return mCurrentAnimation;
|
||||
}
|
||||
|
||||
private boolean isDraggingOrSettling() {
|
||||
return mDetector.isDraggingOrSettling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,6 +563,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
* removed from recentsView
|
||||
*/
|
||||
private int mSplitHiddenTaskViewIndex;
|
||||
/**
|
||||
* The task to be removed and immediately re-added. Should not be added to task pool.
|
||||
*/
|
||||
private TaskView mMovingTaskView;
|
||||
|
||||
// Keeps track of the index where the first TaskView should be
|
||||
private int mTaskViewStartIndex = 0;
|
||||
@@ -826,9 +830,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
public void onViewRemoved(View child) {
|
||||
super.onViewRemoved(child);
|
||||
|
||||
// Clear the task data for the removed child if it was visible unless it's the initial
|
||||
// taskview for entering split screen, we only pretend to dismiss the task
|
||||
if (child instanceof TaskView && child != mSplitHiddenTaskView) {
|
||||
// Clear the task data for the removed child if it was visible unless:
|
||||
// - It's the initial taskview for entering split screen, we only pretend to dismiss the
|
||||
// task
|
||||
// - It's the focused task to be moved to the front, we immediately re-add the task
|
||||
if (child instanceof TaskView && child != mSplitHiddenTaskView
|
||||
&& child != mMovingTaskView) {
|
||||
TaskView taskView = (TaskView) child;
|
||||
mHasVisibleTaskData.delete(taskView.getTaskId());
|
||||
mTaskViewPool.recycle(taskView);
|
||||
@@ -1121,6 +1128,42 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the focused task to the front of the carousel in tablets, to minimize animation
|
||||
* required to focus the task in grid.
|
||||
*/
|
||||
public void moveFocusedTaskToFront() {
|
||||
if (!(mActivity.getDeviceProfile().isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get())) {
|
||||
return;
|
||||
}
|
||||
|
||||
TaskView focusedTaskView = getFocusedTaskView();
|
||||
if (focusedTaskView == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (indexOfChild(focusedTaskView) != mCurrentPage) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mCurrentPage == mTaskViewStartIndex) {
|
||||
return;
|
||||
}
|
||||
|
||||
int primaryScroll = mOrientationHandler.getPrimaryScroll(this);
|
||||
int currentPageScroll = getScrollForPage(mCurrentPage);
|
||||
mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
|
||||
|
||||
mMovingTaskView = focusedTaskView;
|
||||
removeView(focusedTaskView);
|
||||
mMovingTaskView = null;
|
||||
focusedTaskView.onRecycle();
|
||||
addView(focusedTaskView, mTaskViewStartIndex);
|
||||
setCurrentPage(mTaskViewStartIndex);
|
||||
|
||||
updateGridProperties();
|
||||
}
|
||||
|
||||
protected void applyLoadPlan(ArrayList<Task> tasks) {
|
||||
if (mPendingAnimation != null) {
|
||||
mPendingAnimation.addEndListener(success -> applyLoadPlan(tasks));
|
||||
@@ -1792,7 +1835,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
.displayOverviewTasksAsGrid(mActivity.getDeviceProfile())) {
|
||||
TaskView runningTaskView = getRunningTaskView();
|
||||
float runningTaskPrimaryGridTranslation = 0;
|
||||
if (indexOfChild(runningTaskView) != getNextPage()) {
|
||||
if (runningTaskView != null && indexOfChild(runningTaskView) != getNextPage()) {
|
||||
// Apply the gird translation to running task unless it's being snapped to.
|
||||
runningTaskPrimaryGridTranslation = mOrientationHandler.getPrimaryValue(
|
||||
runningTaskView.getGridTranslationX(),
|
||||
@@ -3090,6 +3133,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
splitController.getLayoutParamsForActivePosition(getResources(),
|
||||
mActivity.getDeviceProfile()));
|
||||
mSplitPlaceholderView.setIcon(taskView.getIconView());
|
||||
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
|
||||
finishRecentsAnimation(true, null);
|
||||
}
|
||||
}
|
||||
|
||||
public PendingAnimation createSplitSelectInitAnimation() {
|
||||
|
||||
@@ -531,6 +531,9 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
if (getTask() == null) {
|
||||
return;
|
||||
}
|
||||
if (confirmSecondSplitSelectApp()) {
|
||||
return;
|
||||
}
|
||||
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) {
|
||||
if (!mIsClickableAsLiveTile) {
|
||||
return;
|
||||
@@ -549,7 +552,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
if (targets == null) {
|
||||
// If the recents animation is cancelled somehow between the parent if block and
|
||||
// here, try to launch the task as a non live tile task.
|
||||
launcherNonLiveTileTask();
|
||||
launchTaskAnimated();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -567,19 +570,22 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
});
|
||||
anim.start();
|
||||
} else {
|
||||
launcherNonLiveTileTask();
|
||||
launchTaskAnimated();
|
||||
}
|
||||
mActivity.getStatsLogManager().logger().withItemInfo(getItemInfo())
|
||||
.log(LAUNCHER_TASK_LAUNCH_TAP);
|
||||
}
|
||||
|
||||
private void launcherNonLiveTileTask() {
|
||||
if (mActivity.isInState(OVERVIEW_SPLIT_SELECT)) {
|
||||
// User tapped to select second split screen app
|
||||
/**
|
||||
* @return {@code true} if user is already in split select mode and this tap was to choose the
|
||||
* second app. {@code false} otherwise
|
||||
*/
|
||||
private boolean confirmSecondSplitSelectApp() {
|
||||
boolean isSelectingSecondSplitApp = mActivity.isInState(OVERVIEW_SPLIT_SELECT);
|
||||
if (isSelectingSecondSplitApp) {
|
||||
getRecentsView().confirmSplitSelect(this);
|
||||
} else {
|
||||
launchTaskAnimated();
|
||||
}
|
||||
return isSelectingSecondSplitApp;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -777,7 +777,7 @@ public class DeviceProfile {
|
||||
int taskbarOffset = getTaskbarOffsetY();
|
||||
int hotseatTopDiff = hotseatHeight - taskbarSize - taskbarOffset;
|
||||
|
||||
int startOffset = ApiWrapper.getHotseatStartOffset(context);
|
||||
int endOffset = ApiWrapper.getHotseatEndOffset(context);
|
||||
int requiredWidth = iconSizePx * numShownHotseatIcons;
|
||||
|
||||
Resources res = context.getResources();
|
||||
@@ -785,16 +785,16 @@ public class DeviceProfile {
|
||||
float taskbarIconSpacing = 2 * res.getDimension(R.dimen.taskbar_icon_spacing);
|
||||
int maxSize = (int) (requiredWidth
|
||||
* (taskbarIconSize + taskbarIconSpacing) / taskbarIconSize);
|
||||
int hotseatSize = Math.min(maxSize, availableWidthPx - startOffset);
|
||||
int hotseatSize = Math.min(maxSize, availableWidthPx - endOffset);
|
||||
int sideSpacing = (availableWidthPx - hotseatSize) / 2;
|
||||
mHotseatPadding.set(sideSpacing, hotseatTopDiff, sideSpacing, taskbarOffset);
|
||||
|
||||
if (startOffset > sideSpacing) {
|
||||
if (endOffset > sideSpacing) {
|
||||
int diff = Utilities.isRtl(context.getResources())
|
||||
? sideSpacing - startOffset
|
||||
: startOffset - sideSpacing;
|
||||
mHotseatPadding.left += diff;
|
||||
mHotseatPadding.right -= diff;
|
||||
? sideSpacing - endOffset
|
||||
: endOffset - sideSpacing;
|
||||
mHotseatPadding.left -= diff;
|
||||
mHotseatPadding.right += diff;
|
||||
}
|
||||
} else {
|
||||
// We want the edges of the hotseat to line up with the edges of the workspace, but the
|
||||
|
||||
@@ -65,12 +65,12 @@ public abstract class AbstractStateChangeTouchController
|
||||
protected LauncherState mToState;
|
||||
protected AnimatorPlaybackController mCurrentAnimation;
|
||||
protected boolean mGoingBetweenStates = true;
|
||||
// Ratio of transition process [0, 1] to drag displacement (px)
|
||||
protected float mProgressMultiplier;
|
||||
|
||||
private boolean mNoIntercept;
|
||||
private boolean mIsLogContainerSet;
|
||||
private float mStartProgress;
|
||||
// Ratio of transition process [0, 1] to drag displacement (px)
|
||||
private float mProgressMultiplier;
|
||||
private float mDisplacementShift;
|
||||
private boolean mCanBlockFling;
|
||||
private boolean mAllAppsOvershootStarted;
|
||||
|
||||
@@ -278,12 +278,7 @@ public class RecyclerViewFastScroller extends View {
|
||||
mIgnoreDragGesture |= absDeltaY > mConfig.getScaledPagingTouchSlop();
|
||||
|
||||
if (!mIsDragging && !mIgnoreDragGesture && mRv.supportsFastScrolling()) {
|
||||
// condition #1: triggering thumb is distance, angle based
|
||||
if ((isNearThumb(mDownX, mLastY)
|
||||
&& absDeltaY > mConfig.getScaledPagingTouchSlop()
|
||||
&& absDeltaY > absDeltaX)
|
||||
// condition#2: Fastscroll function is now time based
|
||||
|| (isNearScrollBar(mDownX) && ev.getEventTime() - mDownTimeStampMillis
|
||||
if ((isNearThumb(mDownX, mLastY) && ev.getEventTime() - mDownTimeStampMillis
|
||||
> FASTSCROLL_THRESHOLD_MILLIS)) {
|
||||
calcTouchOffsetAndPrepToFastScroll(mDownY, mLastY);
|
||||
}
|
||||
@@ -433,9 +428,6 @@ public class RecyclerViewFastScroller extends View {
|
||||
}
|
||||
|
||||
private void updatePopupY(int lastTouchY) {
|
||||
if (!mPopupVisible) {
|
||||
return;
|
||||
}
|
||||
int height = mPopupView.getHeight();
|
||||
// Aligns the rounded corner of the pop up with the top of the thumb.
|
||||
float top = mRv.getScrollBarTop() + lastTouchY + (getScrollThumbRadius() / 2f)
|
||||
|
||||
@@ -39,9 +39,9 @@ public class ApiWrapper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum space that should be left empty at the start of hotseat
|
||||
* Returns the minimum space that should be left empty at the end of hotseat
|
||||
*/
|
||||
public static int getHotseatStartOffset(Context context) {
|
||||
public static int getHotseatEndOffset(Context context) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,9 +128,6 @@ public abstract class AbstractLauncherUiTest {
|
||||
}
|
||||
|
||||
public static void checkDetectedLeaks(LauncherInstrumentation launcher) {
|
||||
// TODO(b/191449914): Temporarily disable leak detection on tablets until bug is resolved.
|
||||
if (launcher.isTablet()) return;
|
||||
|
||||
if (sActivityLeakReported) return;
|
||||
|
||||
if (sStrictmodeDetectedActivityLeak != null) {
|
||||
|
||||
@@ -514,9 +514,8 @@ public final class LauncherInstrumentation {
|
||||
void fail(String message) {
|
||||
checkForAnomaly();
|
||||
Assert.fail(formatSystemHealthMessage(formatErrorWithEvents(
|
||||
"http://go/tapl test failure:\nContext: " + getContextDescription()
|
||||
+ " => resulting visible state is " + getVisibleStateMessage()
|
||||
+ ";\nDetails: " + message, true)));
|
||||
"http://go/tapl test failure: " + message + ";\nContext: " + getContextDescription()
|
||||
+ "; now visible state is " + getVisibleStateMessage(), true)));
|
||||
}
|
||||
|
||||
private String getContextDescription() {
|
||||
@@ -746,17 +745,13 @@ public final class LauncherInstrumentation {
|
||||
dumpViewHierarchy();
|
||||
action = "swiping up to home";
|
||||
|
||||
final boolean launcherIsVisible = isLauncherVisible();
|
||||
swipeToState(
|
||||
displaySize.x / 2, displaySize.y - 1,
|
||||
displaySize.x / 2, 0,
|
||||
ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, NORMAL_STATE_ORDINAL,
|
||||
launcherWasVisible
|
||||
launcherWasVisible || isTablet()
|
||||
? GestureScope.INSIDE_TO_OUTSIDE
|
||||
: GestureScope.OUTSIDE_WITH_PILFER);
|
||||
// b/193653850: launcherWasVisible is a flaky indicator.
|
||||
log("launcherWasVisible: " + launcherWasVisible + ", launcherIsVisible: "
|
||||
+ launcherIsVisible);
|
||||
}
|
||||
} else {
|
||||
log("Hierarchy before clicking home:");
|
||||
|
||||
Reference in New Issue
Block a user