Merge "Updating visuals for incompatible apps." into nyc-dev
am: 87c343c
* commit '87c343cddc19da30df591667eda7bef4300bdb94':
Updating visuals for incompatible apps.
Change-Id: I1128da7385502f5cf4e6ecfc710f525dabc54cbf
This commit is contained in:
@@ -14,8 +14,8 @@ Copyright (C) 2014 The Android Open Source Project
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="48.0dp"
|
android:width="24.0dp"
|
||||||
android:height="48.0dp"
|
android:height="24.0dp"
|
||||||
android:viewportWidth="24.0"
|
android:viewportWidth="24.0"
|
||||||
android:viewportHeight="24.0">
|
android:viewportHeight="24.0">
|
||||||
<path
|
<path
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ Copyright (C) 2014 The Android Open Source Project
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="48.0dp"
|
android:width="24.0dp"
|
||||||
android:height="48.0dp"
|
android:height="24.0dp"
|
||||||
android:viewportWidth="24.0"
|
android:viewportWidth="24.0"
|
||||||
android:viewportHeight="24.0">
|
android:viewportHeight="24.0">
|
||||||
<path
|
<path
|
||||||
|
|||||||
@@ -25,6 +25,14 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
</com.android.systemui.recents.views.RecentsView>
|
</com.android.systemui.recents.views.RecentsView>
|
||||||
|
|
||||||
|
<!-- Incompatible task overlay -->
|
||||||
|
<ViewStub android:id="@+id/incompatible_app_overlay_stub"
|
||||||
|
android:inflatedId="@+id/incompatible_app_overlay"
|
||||||
|
android:layout="@layout/recents_incompatible_app_overlay"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:layout_gravity="center_horizontal|top" />
|
||||||
|
|
||||||
<!-- Nav Bar Scrim View -->
|
<!-- Nav Bar Scrim View -->
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/nav_bar_scrim"
|
android:id="@+id/nav_bar_scrim"
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2016 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.
|
||||||
|
-->
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:alpha="0"
|
||||||
|
android:background="#88000000"
|
||||||
|
android:forceHasOverlappingRendering="false">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:drawableTop="@drawable/recents_info_light"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:text="@string/recents_incompatible_app_message" />
|
||||||
|
</FrameLayout>
|
||||||
@@ -26,7 +26,9 @@
|
|||||||
android:id="@+id/task_view_thumbnail"
|
android:id="@+id/task_view_thumbnail"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
<include layout="@layout/recents_task_view_header" />
|
<include layout="@layout/recents_task_view_header" />
|
||||||
|
|
||||||
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||||
android:id="@+id/lock_to_app_fab"
|
android:id="@+id/lock_to_app_fab"
|
||||||
android:layout_width="@dimen/recents_lock_to_app_size"
|
android:layout_width="@dimen/recents_lock_to_app_size"
|
||||||
@@ -45,6 +47,17 @@
|
|||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/recents_lock_to_app_pin" />
|
android:src="@drawable/recents_lock_to_app_pin" />
|
||||||
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
|
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
|
||||||
|
|
||||||
|
<!-- The incompatible app toast -->
|
||||||
|
<ViewStub android:id="@+id/incompatible_app_toast_stub"
|
||||||
|
android:inflatedId="@+id/incompatible_app_toast"
|
||||||
|
android:layout="@*android:layout/transient_notification"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top|center_horizontal"
|
||||||
|
android:layout_marginTop="48dp"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</com.android.systemui.recents.views.TaskView>
|
</com.android.systemui.recents.views.TaskView>
|
||||||
|
|
||||||
|
|||||||
@@ -31,40 +31,19 @@
|
|||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingEnd="12dp" />
|
android:paddingEnd="12dp" />
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:id="@+id/title_container"
|
android:id="@+id/title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical|start"
|
android:layout_gravity="center_vertical|start"
|
||||||
android:orientation="vertical">
|
android:textSize="16sp"
|
||||||
<TextView
|
android:textColor="#ffffffff"
|
||||||
android:id="@+id/title"
|
android:text="@string/recents_empty_message"
|
||||||
android:layout_width="match_parent"
|
android:fontFamily="sans-serif-medium"
|
||||||
android:layout_height="wrap_content"
|
android:singleLine="true"
|
||||||
android:layout_gravity="start"
|
android:maxLines="1"
|
||||||
android:textSize="16sp"
|
android:ellipsize="marquee"
|
||||||
android:textColor="#ffffffff"
|
android:fadingEdge="horizontal" />
|
||||||
android:text="@string/recents_empty_message"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:fadingEdge="horizontal" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/sub_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="start"
|
|
||||||
android:textSize="11sp"
|
|
||||||
android:textColor="#ffffffff"
|
|
||||||
android:text="@string/recents_launch_non_dockable_task_label"
|
|
||||||
android:fontFamily="sans-serif-medium"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:fadingEdge="horizontal"
|
|
||||||
android:visibility="gone" />
|
|
||||||
</LinearLayout>
|
|
||||||
<com.android.systemui.recents.views.FixedSizeImageView
|
<com.android.systemui.recents.views.FixedSizeImageView
|
||||||
android:id="@+id/move_task"
|
android:id="@+id/move_task"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -735,10 +735,8 @@
|
|||||||
<string name="recents_launch_disabled_message"><xliff:g id="app" example="Calendar">%s</xliff:g> is disabled in safe-mode.</string>
|
<string name="recents_launch_disabled_message"><xliff:g id="app" example="Calendar">%s</xliff:g> is disabled in safe-mode.</string>
|
||||||
<!-- Recents: Stack action button string. [CHAR LIMIT=NONE] -->
|
<!-- Recents: Stack action button string. [CHAR LIMIT=NONE] -->
|
||||||
<string name="recents_stack_action_button_label">Clear all</string>
|
<string name="recents_stack_action_button_label">Clear all</string>
|
||||||
<!-- Recents: Non-dockable task drag message. [CHAR LIMIT=NONE] -->
|
<!-- Recents: Incompatible task message. [CHAR LIMIT=NONE] -->
|
||||||
<string name="recents_drag_non_dockable_task_message">This app does not support multi-window</string>
|
<string name="recents_incompatible_app_message">App doesn\'t support split screen</string>
|
||||||
<!-- Recents: Non-dockable task launch sub header. [CHAR LIMIT=NONE] -->
|
|
||||||
<string name="recents_launch_non_dockable_task_label">App does not support multi-window</string>
|
|
||||||
|
|
||||||
<!-- Recents: MultiStack add stack split horizontal radio button. [CHAR LIMIT=NONE] -->
|
<!-- Recents: MultiStack add stack split horizontal radio button. [CHAR LIMIT=NONE] -->
|
||||||
<string name="recents_multistack_add_stack_dialog_split_horizontal">Split Horizontal</string>
|
<string name="recents_multistack_add_stack_dialog_split_horizontal">Split Horizontal</string>
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ public class Recents extends SystemUI
|
|||||||
mDraggingInRecentsCurrentUser = currentUser;
|
mDraggingInRecentsCurrentUser = currentUser;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(mContext, R.string.recents_drag_non_dockable_task_message,
|
Toast.makeText(mContext, R.string.recents_incompatible_app_message,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import android.view.WindowManager.LayoutParams;
|
|||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||||
|
import com.android.systemui.Interpolators;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.recents.events.EventBus;
|
import com.android.systemui.recents.events.EventBus;
|
||||||
import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent;
|
import com.android.systemui.recents.events.activity.CancelEnterRecentsWindowAnimationEvent;
|
||||||
@@ -58,8 +59,10 @@ import com.android.systemui.recents.events.component.RecentsVisibilityChangedEve
|
|||||||
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
|
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
|
||||||
import com.android.systemui.recents.events.ui.AllTaskViewsDismissedEvent;
|
import com.android.systemui.recents.events.ui.AllTaskViewsDismissedEvent;
|
||||||
import com.android.systemui.recents.events.ui.DeleteTaskDataEvent;
|
import com.android.systemui.recents.events.ui.DeleteTaskDataEvent;
|
||||||
|
import com.android.systemui.recents.events.ui.HideIncompatibleAppOverlayEvent;
|
||||||
import com.android.systemui.recents.events.ui.RecentsDrawnEvent;
|
import com.android.systemui.recents.events.ui.RecentsDrawnEvent;
|
||||||
import com.android.systemui.recents.events.ui.ShowApplicationInfoEvent;
|
import com.android.systemui.recents.events.ui.ShowApplicationInfoEvent;
|
||||||
|
import com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent;
|
||||||
import com.android.systemui.recents.events.ui.StackViewScrolledEvent;
|
import com.android.systemui.recents.events.ui.StackViewScrolledEvent;
|
||||||
import com.android.systemui.recents.events.ui.UpdateFreeformTaskViewVisibilityEvent;
|
import com.android.systemui.recents.events.ui.UpdateFreeformTaskViewVisibilityEvent;
|
||||||
import com.android.systemui.recents.events.ui.UserInteractionEvent;
|
import com.android.systemui.recents.events.ui.UserInteractionEvent;
|
||||||
@@ -68,12 +71,12 @@ import com.android.systemui.recents.events.ui.focus.FocusNextTaskViewEvent;
|
|||||||
import com.android.systemui.recents.events.ui.focus.FocusPreviousTaskViewEvent;
|
import com.android.systemui.recents.events.ui.focus.FocusPreviousTaskViewEvent;
|
||||||
import com.android.systemui.recents.misc.DozeTrigger;
|
import com.android.systemui.recents.misc.DozeTrigger;
|
||||||
import com.android.systemui.recents.misc.SystemServicesProxy;
|
import com.android.systemui.recents.misc.SystemServicesProxy;
|
||||||
|
import com.android.systemui.recents.misc.Utilities;
|
||||||
import com.android.systemui.recents.model.RecentsPackageMonitor;
|
import com.android.systemui.recents.model.RecentsPackageMonitor;
|
||||||
import com.android.systemui.recents.model.RecentsTaskLoadPlan;
|
import com.android.systemui.recents.model.RecentsTaskLoadPlan;
|
||||||
import com.android.systemui.recents.model.RecentsTaskLoader;
|
import com.android.systemui.recents.model.RecentsTaskLoader;
|
||||||
import com.android.systemui.recents.model.Task;
|
import com.android.systemui.recents.model.Task;
|
||||||
import com.android.systemui.recents.model.TaskStack;
|
import com.android.systemui.recents.model.TaskStack;
|
||||||
import com.android.systemui.recents.views.AnimationProps;
|
|
||||||
import com.android.systemui.recents.views.RecentsView;
|
import com.android.systemui.recents.views.RecentsView;
|
||||||
import com.android.systemui.recents.views.SystemBarScrimViews;
|
import com.android.systemui.recents.views.SystemBarScrimViews;
|
||||||
import com.android.systemui.statusbar.BaseStatusBar;
|
import com.android.systemui.statusbar.BaseStatusBar;
|
||||||
@@ -90,6 +93,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
private final static boolean DEBUG = false;
|
private final static boolean DEBUG = false;
|
||||||
|
|
||||||
public final static int EVENT_BUS_PRIORITY = Recents.EVENT_BUS_PRIORITY + 1;
|
public final static int EVENT_BUS_PRIORITY = Recents.EVENT_BUS_PRIORITY + 1;
|
||||||
|
public final static int INCOMPATIBLE_APP_ALPHA_DURATION = 150;
|
||||||
|
|
||||||
private RecentsPackageMonitor mPackageMonitor;
|
private RecentsPackageMonitor mPackageMonitor;
|
||||||
private long mLastTabKeyEventTime;
|
private long mLastTabKeyEventTime;
|
||||||
@@ -101,6 +105,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
// Top level views
|
// Top level views
|
||||||
private RecentsView mRecentsView;
|
private RecentsView mRecentsView;
|
||||||
private SystemBarScrimViews mScrimViews;
|
private SystemBarScrimViews mScrimViews;
|
||||||
|
private View mIncompatibleAppOverlay;
|
||||||
|
|
||||||
// Runnables to finish the Recents activity
|
// Runnables to finish the Recents activity
|
||||||
private Intent mHomeIntent;
|
private Intent mHomeIntent;
|
||||||
@@ -674,6 +679,30 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
MetricsLogger.count(this, "overview_app_info", 1);
|
MetricsLogger.count(this, "overview_app_info", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void onBusEvent(ShowIncompatibleAppOverlayEvent event) {
|
||||||
|
if (mIncompatibleAppOverlay == null) {
|
||||||
|
mIncompatibleAppOverlay = Utilities.findViewStubById(this,
|
||||||
|
R.id.incompatible_app_overlay_stub).inflate();
|
||||||
|
mIncompatibleAppOverlay.setWillNotDraw(false);
|
||||||
|
mIncompatibleAppOverlay.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
mIncompatibleAppOverlay.animate()
|
||||||
|
.alpha(1f)
|
||||||
|
.setDuration(INCOMPATIBLE_APP_ALPHA_DURATION)
|
||||||
|
.setInterpolator(Interpolators.ALPHA_IN)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void onBusEvent(HideIncompatibleAppOverlayEvent event) {
|
||||||
|
if (mIncompatibleAppOverlay != null) {
|
||||||
|
mIncompatibleAppOverlay.animate()
|
||||||
|
.alpha(0f)
|
||||||
|
.setDuration(INCOMPATIBLE_APP_ALPHA_DURATION)
|
||||||
|
.setInterpolator(Interpolators.ALPHA_OUT)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public final void onBusEvent(DeleteTaskDataEvent event) {
|
public final void onBusEvent(DeleteTaskDataEvent event) {
|
||||||
// Remove any stored data from the loader
|
// Remove any stored data from the loader
|
||||||
RecentsTaskLoader loader = Recents.getTaskLoader();
|
RecentsTaskLoader loader = Recents.getTaskLoader();
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.systemui.recents.events.ui;
|
||||||
|
|
||||||
|
import com.android.systemui.recents.events.EventBus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is sent when a user stops draggin an incompatible app task.
|
||||||
|
*/
|
||||||
|
public class HideIncompatibleAppOverlayEvent extends EventBus.Event {
|
||||||
|
// Simple event
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.systemui.recents.events.ui;
|
||||||
|
|
||||||
|
import com.android.systemui.recents.events.EventBus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is sent when a user starts dragging an incompatible app task.
|
||||||
|
*/
|
||||||
|
public class ShowIncompatibleAppOverlayEvent extends EventBus.Event {
|
||||||
|
// Simple event
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ package com.android.systemui.recents.misc;
|
|||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorSet;
|
import android.animation.AnimatorSet;
|
||||||
import android.annotation.FloatRange;
|
import android.annotation.FloatRange;
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
@@ -30,6 +31,7 @@ import android.util.Property;
|
|||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewParent;
|
import android.view.ViewParent;
|
||||||
|
import android.view.ViewStub;
|
||||||
|
|
||||||
import com.android.systemui.recents.model.Task;
|
import com.android.systemui.recents.model.Task;
|
||||||
import com.android.systemui.recents.views.TaskViewTransform;
|
import com.android.systemui.recents.views.TaskViewTransform;
|
||||||
@@ -219,6 +221,20 @@ public class Utilities {
|
|||||||
animator.removeAllListeners();
|
animator.removeAllListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a view stub for the given view id.
|
||||||
|
*/
|
||||||
|
public static ViewStub findViewStubById(View v, int stubId) {
|
||||||
|
return (ViewStub) v.findViewById(stubId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a view stub for the given view id.
|
||||||
|
*/
|
||||||
|
public static ViewStub findViewStubById(Activity a, int stubId) {
|
||||||
|
return (ViewStub) a.findViewById(stubId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates {@param transforms} to be the same size as {@param tasks}.
|
* Updates {@param transforms} to be the same size as {@param tasks}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,19 +20,17 @@ import android.app.ActivityManager;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
import android.view.ViewDebug;
|
import android.view.ViewDebug;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.android.internal.policy.DividerSnapAlgorithm;
|
import com.android.internal.policy.DividerSnapAlgorithm;
|
||||||
import com.android.systemui.R;
|
|
||||||
import com.android.systemui.recents.Recents;
|
import com.android.systemui.recents.Recents;
|
||||||
import com.android.systemui.recents.RecentsConfiguration;
|
import com.android.systemui.recents.RecentsConfiguration;
|
||||||
import com.android.systemui.recents.RecentsImpl;
|
|
||||||
import com.android.systemui.recents.events.EventBus;
|
import com.android.systemui.recents.events.EventBus;
|
||||||
import com.android.systemui.recents.events.activity.ConfigurationChangedEvent;
|
import com.android.systemui.recents.events.activity.ConfigurationChangedEvent;
|
||||||
|
import com.android.systemui.recents.events.ui.HideIncompatibleAppOverlayEvent;
|
||||||
|
import com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent;
|
||||||
import com.android.systemui.recents.events.ui.dragndrop.DragDropTargetChangedEvent;
|
import com.android.systemui.recents.events.ui.dragndrop.DragDropTargetChangedEvent;
|
||||||
import com.android.systemui.recents.events.ui.dragndrop.DragEndEvent;
|
import com.android.systemui.recents.events.ui.dragndrop.DragEndEvent;
|
||||||
import com.android.systemui.recents.events.ui.dragndrop.DragStartEvent;
|
import com.android.systemui.recents.events.ui.dragndrop.DragStartEvent;
|
||||||
@@ -166,8 +164,7 @@ public class RecentsViewTouchHandler {
|
|||||||
if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask()
|
if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask()
|
||||||
&& mDividerSnapAlgorithm.isSplitScreenFeasible()) {
|
&& mDividerSnapAlgorithm.isSplitScreenFeasible()) {
|
||||||
if (!event.task.isDockable) {
|
if (!event.task.isDockable) {
|
||||||
Toast.makeText(mRv.getContext(), R.string.recents_drag_non_dockable_task_message,
|
EventBus.getDefault().send(new ShowIncompatibleAppOverlayEvent());
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
} else {
|
} else {
|
||||||
// Add the dock state drop targets (these take priority)
|
// Add the dock state drop targets (these take priority)
|
||||||
TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
|
TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
|
||||||
@@ -184,6 +181,9 @@ public class RecentsViewTouchHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void onBusEvent(DragEndEvent event) {
|
public final void onBusEvent(DragEndEvent event) {
|
||||||
|
if (!mDragTask.isDockable) {
|
||||||
|
EventBus.getDefault().send(new HideIncompatibleAppOverlayEvent());
|
||||||
|
}
|
||||||
mDragRequested = false;
|
mDragRequested = false;
|
||||||
mDragTask = null;
|
mDragTask = null;
|
||||||
mTaskView = null;
|
mTaskView = null;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import android.view.MotionEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewDebug;
|
import android.view.ViewDebug;
|
||||||
import android.view.ViewOutlineProvider;
|
import android.view.ViewOutlineProvider;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
@@ -157,6 +158,7 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks
|
|||||||
@ViewDebug.ExportedProperty(deepExport=true, prefix="header_")
|
@ViewDebug.ExportedProperty(deepExport=true, prefix="header_")
|
||||||
TaskViewHeader mHeaderView;
|
TaskViewHeader mHeaderView;
|
||||||
View mActionButtonView;
|
View mActionButtonView;
|
||||||
|
View mIncompatibleAppToastView;
|
||||||
TaskViewCallbacks mCb;
|
TaskViewCallbacks mCb;
|
||||||
|
|
||||||
@ViewDebug.ExportedProperty(category="recents")
|
@ViewDebug.ExportedProperty(category="recents")
|
||||||
@@ -345,6 +347,9 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks
|
|||||||
mActionButtonView.setScaleY(1f);
|
mActionButtonView.setScaleY(1f);
|
||||||
mActionButtonView.setAlpha(0f);
|
mActionButtonView.setAlpha(0f);
|
||||||
mActionButtonView.setTranslationZ(mActionButtonTranslationZ);
|
mActionButtonView.setTranslationZ(mActionButtonTranslationZ);
|
||||||
|
if (mIncompatibleAppToastView != null) {
|
||||||
|
mIncompatibleAppToastView.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -536,6 +541,10 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks
|
|||||||
// These values will be animated in when onStartLaunchTargetEnterAnimation() is called
|
// These values will be animated in when onStartLaunchTargetEnterAnimation() is called
|
||||||
setDimAlphaWithoutHeader(0);
|
setDimAlphaWithoutHeader(0);
|
||||||
mActionButtonView.setAlpha(0f);
|
mActionButtonView.setAlpha(0f);
|
||||||
|
if (mIncompatibleAppToastView != null &&
|
||||||
|
mIncompatibleAppToastView.getVisibility() == View.VISIBLE) {
|
||||||
|
mIncompatibleAppToastView.setAlpha(0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -554,6 +563,15 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks
|
|||||||
if (screenPinningEnabled) {
|
if (screenPinningEnabled) {
|
||||||
showActionButton(true /* fadeIn */, duration /* fadeInDuration */);
|
showActionButton(true /* fadeIn */, duration /* fadeInDuration */);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mIncompatibleAppToastView != null &&
|
||||||
|
mIncompatibleAppToastView.getVisibility() == View.VISIBLE) {
|
||||||
|
mIncompatibleAppToastView.animate()
|
||||||
|
.alpha(1f)
|
||||||
|
.setDuration(duration)
|
||||||
|
.setInterpolator(Interpolators.ALPHA_IN)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -587,6 +605,18 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks
|
|||||||
mTask = t;
|
mTask = t;
|
||||||
mTask.addCallback(this);
|
mTask.addCallback(this);
|
||||||
mIsDisabledInSafeMode = !mTask.isSystemApp && ssp.isInSafeMode();
|
mIsDisabledInSafeMode = !mTask.isSystemApp && ssp.isInSafeMode();
|
||||||
|
|
||||||
|
if (!t.isDockable && ssp.hasDockedTask()) {
|
||||||
|
if (mIncompatibleAppToastView == null) {
|
||||||
|
mIncompatibleAppToastView = Utilities.findViewStubById(this,
|
||||||
|
R.id.incompatible_app_toast_stub).inflate();
|
||||||
|
TextView msg = (TextView) findViewById(com.android.internal.R.id.message);
|
||||||
|
msg.setText(R.string.recents_incompatible_app_message);
|
||||||
|
}
|
||||||
|
mIncompatibleAppToastView.setVisibility(View.VISIBLE);
|
||||||
|
} else if (mIncompatibleAppToastView != null) {
|
||||||
|
mIncompatibleAppToastView.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import android.view.View;
|
|||||||
import android.view.ViewAnimationUtils;
|
import android.view.ViewAnimationUtils;
|
||||||
import android.view.ViewDebug;
|
import android.view.ViewDebug;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewStub;
|
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
@@ -141,15 +140,12 @@ public class TaskViewHeader extends FrameLayout
|
|||||||
// Header views
|
// Header views
|
||||||
ImageView mIconView;
|
ImageView mIconView;
|
||||||
TextView mTitleView;
|
TextView mTitleView;
|
||||||
TextView mSubTitleView;
|
|
||||||
ImageView mMoveTaskButton;
|
ImageView mMoveTaskButton;
|
||||||
ImageView mDismissButton;
|
ImageView mDismissButton;
|
||||||
ViewStub mAppOverlayViewStub;
|
|
||||||
FrameLayout mAppOverlayView;
|
FrameLayout mAppOverlayView;
|
||||||
ImageView mAppIconView;
|
ImageView mAppIconView;
|
||||||
ImageView mAppInfoView;
|
ImageView mAppInfoView;
|
||||||
TextView mAppTitleView;
|
TextView mAppTitleView;
|
||||||
ViewStub mFocusTimerIndicatorStub;
|
|
||||||
ProgressBar mFocusTimerIndicator;
|
ProgressBar mFocusTimerIndicator;
|
||||||
|
|
||||||
// Header drawables
|
// Header drawables
|
||||||
@@ -242,13 +238,10 @@ public class TaskViewHeader extends FrameLayout
|
|||||||
mIconView.setClickable(false);
|
mIconView.setClickable(false);
|
||||||
mIconView.setOnLongClickListener(this);
|
mIconView.setOnLongClickListener(this);
|
||||||
mTitleView = (TextView) findViewById(R.id.title);
|
mTitleView = (TextView) findViewById(R.id.title);
|
||||||
mSubTitleView = (TextView) findViewById(R.id.sub_title);
|
|
||||||
mDismissButton = (ImageView) findViewById(R.id.dismiss_task);
|
mDismissButton = (ImageView) findViewById(R.id.dismiss_task);
|
||||||
if (ssp.hasFreeformWorkspaceSupport()) {
|
if (ssp.hasFreeformWorkspaceSupport()) {
|
||||||
mMoveTaskButton = (ImageView) findViewById(R.id.move_task);
|
mMoveTaskButton = (ImageView) findViewById(R.id.move_task);
|
||||||
}
|
}
|
||||||
mFocusTimerIndicatorStub = (ViewStub) findViewById(R.id.focus_timer_indicator_stub);
|
|
||||||
mAppOverlayViewStub = (ViewStub) findViewById(R.id.app_overlay_stub);
|
|
||||||
|
|
||||||
onConfigurationChanged();
|
onConfigurationChanged();
|
||||||
}
|
}
|
||||||
@@ -305,8 +298,7 @@ public class TaskViewHeader extends FrameLayout
|
|||||||
R.dimen.recents_task_view_header_button_padding_tablet_land,
|
R.dimen.recents_task_view_header_button_padding_tablet_land,
|
||||||
R.dimen.recents_task_view_header_button_padding,
|
R.dimen.recents_task_view_header_button_padding,
|
||||||
R.dimen.recents_task_view_header_button_padding_tablet_land);
|
R.dimen.recents_task_view_header_button_padding_tablet_land);
|
||||||
updateLayoutParams(mIconView, findViewById(R.id.title_container), mMoveTaskButton,
|
updateLayoutParams(mIconView, mTitleView, mMoveTaskButton, mDismissButton);
|
||||||
mDismissButton);
|
|
||||||
if (mAppOverlayView != null) {
|
if (mAppOverlayView != null) {
|
||||||
updateLayoutParams(mAppIconView, mAppTitleView, null, mAppInfoView);
|
updateLayoutParams(mAppIconView, mAppTitleView, null, mAppInfoView);
|
||||||
}
|
}
|
||||||
@@ -462,13 +454,6 @@ public class TaskViewHeader extends FrameLayout
|
|||||||
mTitleView.setContentDescription(t.titleDescription);
|
mTitleView.setContentDescription(t.titleDescription);
|
||||||
mTitleView.setTextColor(t.useLightOnPrimaryColor ?
|
mTitleView.setTextColor(t.useLightOnPrimaryColor ?
|
||||||
mTaskBarViewLightTextColor : mTaskBarViewDarkTextColor);
|
mTaskBarViewLightTextColor : mTaskBarViewDarkTextColor);
|
||||||
if (!t.isDockable && ssp.hasDockedTask()) {
|
|
||||||
mSubTitleView.setVisibility(View.VISIBLE);
|
|
||||||
mSubTitleView.setTextColor(t.useLightOnPrimaryColor ?
|
|
||||||
mTaskBarViewLightTextColor : mTaskBarViewDarkTextColor);
|
|
||||||
} else {
|
|
||||||
mSubTitleView.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
mDismissButton.setImageDrawable(t.useLightOnPrimaryColor ?
|
mDismissButton.setImageDrawable(t.useLightOnPrimaryColor ?
|
||||||
mLightDismissDrawable : mDarkDismissDrawable);
|
mLightDismissDrawable : mDarkDismissDrawable);
|
||||||
mDismissButton.setContentDescription(t.dismissDescription);
|
mDismissButton.setContentDescription(t.dismissDescription);
|
||||||
@@ -491,7 +476,8 @@ public class TaskViewHeader extends FrameLayout
|
|||||||
|
|
||||||
if (Recents.getDebugFlags().isFastToggleRecentsEnabled()) {
|
if (Recents.getDebugFlags().isFastToggleRecentsEnabled()) {
|
||||||
if (mFocusTimerIndicator == null) {
|
if (mFocusTimerIndicator == null) {
|
||||||
mFocusTimerIndicator = (ProgressBar) mFocusTimerIndicatorStub.inflate();
|
mFocusTimerIndicator = (ProgressBar) Utilities.findViewStubById(this,
|
||||||
|
R.id.focus_timer_indicator_stub).inflate();
|
||||||
}
|
}
|
||||||
mFocusTimerIndicator.getProgressDrawable()
|
mFocusTimerIndicator.getProgressDrawable()
|
||||||
.setColorFilter(
|
.setColorFilter(
|
||||||
@@ -637,7 +623,8 @@ public class TaskViewHeader extends FrameLayout
|
|||||||
|
|
||||||
// Inflate the overlay if necessary
|
// Inflate the overlay if necessary
|
||||||
if (mAppOverlayView == null) {
|
if (mAppOverlayView == null) {
|
||||||
mAppOverlayView = (FrameLayout) mAppOverlayViewStub.inflate();
|
mAppOverlayView = (FrameLayout) Utilities.findViewStubById(this,
|
||||||
|
R.id.app_overlay_stub).inflate();
|
||||||
mAppOverlayView.setBackground(mOverlayBackground);
|
mAppOverlayView.setBackground(mOverlayBackground);
|
||||||
mAppIconView = (ImageView) mAppOverlayView.findViewById(R.id.app_icon);
|
mAppIconView = (ImageView) mAppOverlayView.findViewById(R.id.app_icon);
|
||||||
mAppIconView.setOnClickListener(this);
|
mAppIconView.setOnClickListener(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user