resolve merge conflicts of f17eb616a8 to ub-launcher3-qt-r1-dev
Bug: None Test: I solemnly swear I tested this conflict resolution. Change-Id: I4e177dfb7ba3bde6eb53f63c2f2df273feef90ee
This commit is contained in:
-9
@@ -204,15 +204,6 @@ public abstract class RecentsUiFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Clean-up logic that occurs when recents is no longer in use/visible.
|
|
||||||
*
|
|
||||||
* @param launcher the launcher activity
|
|
||||||
*/
|
|
||||||
public static void resetOverview(Launcher launcher) {
|
|
||||||
launcher.<RecentsView>getOverviewPanel().reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recents logic that triggers when launcher state changes or launcher activity stops/resumes.
|
* Recents logic that triggers when launcher state changes or launcher activity stops/resumes.
|
||||||
*
|
*
|
||||||
|
|||||||
-3
@@ -21,7 +21,6 @@ import com.android.launcher3.AbstractFloatingView;
|
|||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.allapps.AllAppsTransitionController;
|
import com.android.launcher3.allapps.AllAppsTransitionController;
|
||||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||||
import com.android.quickstep.util.ClipAnimationHelper;
|
|
||||||
import com.android.quickstep.util.LayoutUtils;
|
import com.android.quickstep.util.LayoutUtils;
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
import com.android.quickstep.views.TaskView;
|
import com.android.quickstep.views.TaskView;
|
||||||
@@ -45,8 +44,6 @@ public class BackgroundAppState extends OverviewState {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStateEnabled(Launcher launcher) {
|
public void onStateEnabled(Launcher launcher) {
|
||||||
RecentsView rv = launcher.getOverviewPanel();
|
|
||||||
rv.setOverviewStateEnabled(true);
|
|
||||||
AbstractFloatingView.closeAllOpenViews(launcher, false);
|
AbstractFloatingView.closeAllOpenViews(launcher, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-8
@@ -86,17 +86,9 @@ public class OverviewState extends LauncherState {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStateEnabled(Launcher launcher) {
|
public void onStateEnabled(Launcher launcher) {
|
||||||
RecentsView rv = launcher.getOverviewPanel();
|
|
||||||
rv.setOverviewStateEnabled(true);
|
|
||||||
AbstractFloatingView.closeAllOpenViews(launcher);
|
AbstractFloatingView.closeAllOpenViews(launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStateDisabled(Launcher launcher) {
|
|
||||||
RecentsView rv = launcher.getOverviewPanel();
|
|
||||||
rv.setOverviewStateEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStateTransitionEnd(Launcher launcher) {
|
public void onStateTransitionEnd(Launcher launcher) {
|
||||||
launcher.getRotationHelper().setCurrentStateRequest(REQUEST_ROTATE);
|
launcher.getRotationHelper().setCurrentStateRequest(REQUEST_ROTATE);
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class TaskOverlayFactory implements ResourceBasedOverride {
|
public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||||
|
|
||||||
public static final String AIAI_PACKAGE = "com.google.android.as";
|
|
||||||
|
|
||||||
/** Note that these will be shown in order from top to bottom, if available for the task. */
|
/** Note that these will be shown in order from top to bottom, if available for the task. */
|
||||||
private static final TaskSystemShortcut[] MENU_OPTIONS = new TaskSystemShortcut[]{
|
private static final TaskSystemShortcut[] MENU_OPTIONS = new TaskSystemShortcut[]{
|
||||||
new TaskSystemShortcut.AppInfo(),
|
new TaskSystemShortcut.AppInfo(),
|
||||||
@@ -51,29 +49,33 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
|||||||
new MainThreadInitializedObject<>(c -> Overrides.getObject(TaskOverlayFactory.class,
|
new MainThreadInitializedObject<>(c -> Overrides.getObject(TaskOverlayFactory.class,
|
||||||
c, R.string.task_overlay_factory_class));
|
c, R.string.task_overlay_factory_class));
|
||||||
|
|
||||||
|
public List<TaskSystemShortcut> getEnabledShortcuts(TaskView taskView) {
|
||||||
|
final ArrayList<TaskSystemShortcut> shortcuts = new ArrayList<>();
|
||||||
|
final BaseDraggingActivity activity = BaseActivity.fromContext(taskView.getContext());
|
||||||
|
for (TaskSystemShortcut menuOption : MENU_OPTIONS) {
|
||||||
|
View.OnClickListener onClickListener =
|
||||||
|
menuOption.getOnClickListener(activity, taskView);
|
||||||
|
if (onClickListener != null) {
|
||||||
|
shortcuts.add(menuOption);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return shortcuts;
|
||||||
|
}
|
||||||
|
|
||||||
public TaskOverlay createOverlay(View thumbnailView) {
|
public TaskOverlay createOverlay(View thumbnailView) {
|
||||||
return new TaskOverlay();
|
return new TaskOverlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class TaskOverlay {
|
public static class TaskOverlay {
|
||||||
|
|
||||||
public void setTaskInfo(Task task, ThumbnailData thumbnail, Matrix matrix) {
|
/**
|
||||||
}
|
* Called when the current task is interactive for the user
|
||||||
|
*/
|
||||||
|
public void initOverlay(Task task, ThumbnailData thumbnail, Matrix matrix) { }
|
||||||
|
|
||||||
public void reset() {
|
/**
|
||||||
}
|
* Called when the overlay is no longer used.
|
||||||
|
*/
|
||||||
public List<TaskSystemShortcut> getEnabledShortcuts(TaskView taskView) {
|
public void reset() { }
|
||||||
final ArrayList<TaskSystemShortcut> shortcuts = new ArrayList<>();
|
|
||||||
final BaseDraggingActivity activity = BaseActivity.fromContext(taskView.getContext());
|
|
||||||
for (TaskSystemShortcut menuOption : MENU_OPTIONS) {
|
|
||||||
View.OnClickListener onClickListener =
|
|
||||||
menuOption.getOnClickListener(activity, taskView);
|
|
||||||
if (onClickListener != null) {
|
|
||||||
shortcuts.add(menuOption);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return shortcuts;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -35,6 +35,7 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity> {
|
|||||||
public FallbackRecentsView(Context context, AttributeSet attrs, int defStyleAttr) {
|
public FallbackRecentsView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
setOverviewStateEnabled(true);
|
setOverviewStateEnabled(true);
|
||||||
|
setOverlayEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+18
-1
@@ -20,6 +20,7 @@ import static com.android.launcher3.LauncherState.ALL_APPS_HEADER_EXTRA;
|
|||||||
import static com.android.launcher3.LauncherState.NORMAL;
|
import static com.android.launcher3.LauncherState.NORMAL;
|
||||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||||
import static com.android.launcher3.LauncherState.RECENTS_CLEAR_ALL_BUTTON;
|
import static com.android.launcher3.LauncherState.RECENTS_CLEAR_ALL_BUTTON;
|
||||||
|
import static com.android.launcher3.LauncherState.SPRING_LOADED;
|
||||||
import static com.android.launcher3.QuickstepAppTransitionManagerImpl.ALL_APPS_PROGRESS_OFF_SCREEN;
|
import static com.android.launcher3.QuickstepAppTransitionManagerImpl.ALL_APPS_PROGRESS_OFF_SCREEN;
|
||||||
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS;
|
import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS;
|
||||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
|
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
|
||||||
@@ -37,6 +38,7 @@ import android.view.View;
|
|||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.LauncherState;
|
import com.android.launcher3.LauncherState;
|
||||||
|
import com.android.launcher3.LauncherStateManager.StateListener;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.anim.Interpolators;
|
import com.android.launcher3.anim.Interpolators;
|
||||||
import com.android.launcher3.appprediction.PredictionUiStateManager;
|
import com.android.launcher3.appprediction.PredictionUiStateManager;
|
||||||
@@ -51,7 +53,7 @@ import com.android.quickstep.util.LayoutUtils;
|
|||||||
* {@link RecentsView} used in Launcher activity
|
* {@link RecentsView} used in Launcher activity
|
||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.O)
|
@TargetApi(Build.VERSION_CODES.O)
|
||||||
public class LauncherRecentsView extends RecentsView<Launcher> {
|
public class LauncherRecentsView extends RecentsView<Launcher> implements StateListener {
|
||||||
|
|
||||||
private final TransformParams mTransformParams = new TransformParams();
|
private final TransformParams mTransformParams = new TransformParams();
|
||||||
|
|
||||||
@@ -66,6 +68,7 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
|
|||||||
public LauncherRecentsView(Context context, AttributeSet attrs, int defStyleAttr) {
|
public LauncherRecentsView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
super(context, attrs, defStyleAttr);
|
super(context, attrs, defStyleAttr);
|
||||||
setContentAlpha(0);
|
setContentAlpha(0);
|
||||||
|
mActivity.getStateManager().addStateListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -221,6 +224,20 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
|
|||||||
PredictionUiStateManager.INSTANCE.get(getContext()).switchClient(Client.HOME);
|
PredictionUiStateManager.INSTANCE.get(getContext()).switchClient(Client.HOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStateTransitionStart(LauncherState toState) {
|
||||||
|
setOverviewStateEnabled(toState.overviewUi);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStateTransitionComplete(LauncherState finalState) {
|
||||||
|
if (finalState == NORMAL || finalState == SPRING_LOADED) {
|
||||||
|
// Clean-up logic that occurs when recents is no longer in use/visible.
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
setOverlayEnabled(finalState == OVERVIEW);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOverviewStateEnabled(boolean enabled) {
|
public void setOverviewStateEnabled(boolean enabled) {
|
||||||
super.setOverviewStateEnabled(enabled);
|
super.setOverviewStateEnabled(enabled);
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ import android.view.accessibility.AccessibilityEvent;
|
|||||||
import android.view.accessibility.AccessibilityNodeInfo;
|
import android.view.accessibility.AccessibilityNodeInfo;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.dynamicanimation.animation.SpringForce;
|
||||||
|
|
||||||
import com.android.launcher3.BaseActivity;
|
import com.android.launcher3.BaseActivity;
|
||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.Insettable;
|
import com.android.launcher3.Insettable;
|
||||||
@@ -111,9 +114,6 @@ import com.android.systemui.shared.system.TaskStackChangeListener;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.dynamicanimation.animation.SpringForce;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of recent tasks.
|
* A list of recent tasks.
|
||||||
*/
|
*/
|
||||||
@@ -168,8 +168,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
// The threshold at which we update the SystemUI flags when animating from the task into the app
|
// The threshold at which we update the SystemUI flags when animating from the task into the app
|
||||||
public static final float UPDATE_SYSUI_FLAGS_THRESHOLD = 0.85f;
|
public static final float UPDATE_SYSUI_FLAGS_THRESHOLD = 0.85f;
|
||||||
|
|
||||||
private static final float[] sTempFloatArray = new float[3];
|
|
||||||
|
|
||||||
protected final T mActivity;
|
protected final T mActivity;
|
||||||
private final float mFastFlingVelocity;
|
private final float mFastFlingVelocity;
|
||||||
private final RecentsModel mModel;
|
private final RecentsModel mModel;
|
||||||
@@ -189,6 +187,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
|
|
||||||
private boolean mDwbToastShown;
|
private boolean mDwbToastShown;
|
||||||
private boolean mDisallowScrollToClearAll;
|
private boolean mDisallowScrollToClearAll;
|
||||||
|
private boolean mOverlayEnabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Call reloadIdNeeded in onTaskStackChanged.
|
* TODO: Call reloadIdNeeded in onTaskStackChanged.
|
||||||
@@ -428,11 +427,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
// Clear the task data for the removed child if it was visible
|
// Clear the task data for the removed child if it was visible
|
||||||
if (child != mClearAllButton) {
|
if (child != mClearAllButton) {
|
||||||
TaskView taskView = (TaskView) child;
|
TaskView taskView = (TaskView) child;
|
||||||
Task task = taskView.getTask();
|
mHasVisibleTaskData.delete(taskView.getTask().key.id);
|
||||||
if (mHasVisibleTaskData.get(task.key.id)) {
|
|
||||||
mHasVisibleTaskData.delete(task.key.id);
|
|
||||||
taskView.onTaskListVisibilityChanged(false /* visible */);
|
|
||||||
}
|
|
||||||
mTaskViewPool.recycle(taskView);
|
mTaskViewPool.recycle(taskView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -455,7 +450,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
public void setOverviewStateEnabled(boolean enabled) {
|
public void setOverviewStateEnabled(boolean enabled) {
|
||||||
mOverviewStateEnabled = enabled;
|
mOverviewStateEnabled = enabled;
|
||||||
updateTaskStackListenerState();
|
updateTaskStackListenerState();
|
||||||
if (!enabled) mDwbToastShown = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDigitalWellbeingToastShown() {
|
public void onDigitalWellbeingToastShown() {
|
||||||
@@ -582,6 +576,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
}
|
}
|
||||||
resetTaskVisuals();
|
resetTaskVisuals();
|
||||||
onTaskStackUpdated();
|
onTaskStackUpdated();
|
||||||
|
updateEnabledOverlays();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTaskViewCount() {
|
public int getTaskViewCount() {
|
||||||
@@ -780,6 +775,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
|
|
||||||
unloadVisibleTaskData();
|
unloadVisibleTaskData();
|
||||||
setCurrentPage(0);
|
setCurrentPage(0);
|
||||||
|
mDwbToastShown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable TaskView getRunningTaskView() {
|
public @Nullable TaskView getRunningTaskView() {
|
||||||
@@ -1545,6 +1541,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
protected void notifyPageSwitchListener(int prevPage) {
|
protected void notifyPageSwitchListener(int prevPage) {
|
||||||
super.notifyPageSwitchListener(prevPage);
|
super.notifyPageSwitchListener(prevPage);
|
||||||
loadVisibleTaskData();
|
loadVisibleTaskData();
|
||||||
|
updateEnabledOverlays();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1685,4 +1682,19 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
|||||||
public ClipAnimationHelper getTempClipAnimationHelper() {
|
public ClipAnimationHelper getTempClipAnimationHelper() {
|
||||||
return mTempClipAnimationHelper;
|
return mTempClipAnimationHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateEnabledOverlays() {
|
||||||
|
int overlayEnabledPage = mOverlayEnabled ? getNextPage() : -1;
|
||||||
|
int taskCount = getTaskViewCount();
|
||||||
|
for (int i = 0; i < taskCount; i++) {
|
||||||
|
((TaskView) getChildAt(i)).setOverlayEnabled(i == overlayEnabledPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOverlayEnabled(boolean overlayEnabled) {
|
||||||
|
if (mOverlayEnabled != overlayEnabled) {
|
||||||
|
mOverlayEnabled = overlayEnabled;
|
||||||
|
updateEnabledOverlays();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import com.android.launcher3.anim.Interpolators;
|
|||||||
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
|
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
|
||||||
import com.android.launcher3.util.Themes;
|
import com.android.launcher3.util.Themes;
|
||||||
import com.android.launcher3.views.BaseDragLayer;
|
import com.android.launcher3.views.BaseDragLayer;
|
||||||
|
import com.android.quickstep.TaskOverlayFactory;
|
||||||
import com.android.quickstep.TaskSystemShortcut;
|
import com.android.quickstep.TaskSystemShortcut;
|
||||||
import com.android.quickstep.TaskUtils;
|
import com.android.quickstep.TaskUtils;
|
||||||
import com.android.quickstep.views.IconView.OnScaleUpdateListener;
|
import com.android.quickstep.views.IconView.OnScaleUpdateListener;
|
||||||
@@ -196,7 +197,7 @@ public class TaskMenuView extends AbstractFloatingView {
|
|||||||
|
|
||||||
final BaseDraggingActivity activity = BaseDraggingActivity.fromContext(getContext());
|
final BaseDraggingActivity activity = BaseDraggingActivity.fromContext(getContext());
|
||||||
final List<TaskSystemShortcut> shortcuts =
|
final List<TaskSystemShortcut> shortcuts =
|
||||||
taskView.getTaskOverlay().getEnabledShortcuts(taskView);
|
TaskOverlayFactory.INSTANCE.get(getContext()).getEnabledShortcuts(taskView);
|
||||||
final int count = shortcuts.size();
|
final int count = shortcuts.size();
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
final TaskSystemShortcut menuOption = shortcuts.get(i);
|
final TaskSystemShortcut menuOption = shortcuts.get(i);
|
||||||
|
|||||||
+21
-10
@@ -98,6 +98,9 @@ public class TaskThumbnailView extends View {
|
|||||||
private float mDimAlphaMultiplier = 1f;
|
private float mDimAlphaMultiplier = 1f;
|
||||||
private float mSaturation = 1f;
|
private float mSaturation = 1f;
|
||||||
|
|
||||||
|
private boolean mOverlayEnabled;
|
||||||
|
private boolean mRotated;
|
||||||
|
|
||||||
public TaskThumbnailView(Context context) {
|
public TaskThumbnailView(Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
}
|
}
|
||||||
@@ -192,10 +195,6 @@ public class TaskThumbnailView extends View {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TaskOverlay getTaskOverlay() {
|
|
||||||
return mOverlay;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw(Canvas canvas) {
|
protected void onDraw(Canvas canvas) {
|
||||||
RectF currentDrawnInsets = mFullscreenParams.mCurrentDrawnInsets;
|
RectF currentDrawnInsets = mFullscreenParams.mCurrentDrawnInsets;
|
||||||
@@ -257,6 +256,22 @@ public class TaskThumbnailView extends View {
|
|||||||
return (TaskView) getParent();
|
return (TaskView) getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOverlayEnabled(boolean overlayEnabled) {
|
||||||
|
if (mOverlayEnabled != overlayEnabled) {
|
||||||
|
mOverlayEnabled = overlayEnabled;
|
||||||
|
updateOverlay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateOverlay() {
|
||||||
|
// The overlay doesn't really work when the screenshot is rotated, so don't add it.
|
||||||
|
if (mOverlayEnabled && !mRotated && mBitmapShader != null && mThumbnailData != null) {
|
||||||
|
mOverlay.initOverlay(mTask, mThumbnailData, mMatrix);
|
||||||
|
} else {
|
||||||
|
mOverlay.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void updateThumbnailPaintFilter() {
|
private void updateThumbnailPaintFilter() {
|
||||||
int mul = (int) ((1 - mDimAlpha * mDimAlphaMultiplier) * 255);
|
int mul = (int) ((1 - mDimAlpha * mDimAlphaMultiplier) * 255);
|
||||||
ColorFilter filter = getColorFilter(mul, mIsDarkTextTheme, mSaturation);
|
ColorFilter filter = getColorFilter(mul, mIsDarkTextTheme, mSaturation);
|
||||||
@@ -351,12 +366,8 @@ public class TaskThumbnailView extends View {
|
|||||||
mPaint.setShader(mBitmapShader);
|
mPaint.setShader(mBitmapShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRotated) {
|
mRotated = isRotated;
|
||||||
// The overlay doesn't really work when the screenshot is rotated, so don't add it.
|
updateOverlay();
|
||||||
mOverlay.reset();
|
|
||||||
} else {
|
|
||||||
mOverlay.setTaskInfo(mTask, mThumbnailData, mMatrix);
|
|
||||||
}
|
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import android.os.Handler;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.FloatProperty;
|
import android.util.FloatProperty;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Property;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewOutlineProvider;
|
import android.view.ViewOutlineProvider;
|
||||||
import android.view.accessibility.AccessibilityNodeInfo;
|
import android.view.accessibility.AccessibilityNodeInfo;
|
||||||
@@ -253,10 +252,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
|||||||
return mIconView;
|
return mIconView;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TaskOverlayFactory.TaskOverlay getTaskOverlay() {
|
|
||||||
return mSnapshotView.getTaskOverlay();
|
|
||||||
}
|
|
||||||
|
|
||||||
public AnimatorPlaybackController createLaunchAnimationForRunningTask() {
|
public AnimatorPlaybackController createLaunchAnimationForRunningTask() {
|
||||||
final PendingAnimation pendingAnimation =
|
final PendingAnimation pendingAnimation =
|
||||||
getRecentsView().createTaskLauncherAnimation(this, RECENTS_LAUNCH_DURATION);
|
getRecentsView().createTaskLauncherAnimation(this, RECENTS_LAUNCH_DURATION);
|
||||||
@@ -488,6 +483,8 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
|||||||
// Clear any references to the thumbnail (it will be re-read either from the cache or the
|
// Clear any references to the thumbnail (it will be re-read either from the cache or the
|
||||||
// system on next bind)
|
// system on next bind)
|
||||||
mSnapshotView.setThumbnail(mTask, null);
|
mSnapshotView.setThumbnail(mTask, null);
|
||||||
|
setOverlayEnabled(false);
|
||||||
|
onTaskListVisibilityChanged(false);
|
||||||
if (mTask != null) {
|
if (mTask != null) {
|
||||||
mTask.thumbnail = null;
|
mTask.thumbnail = null;
|
||||||
}
|
}
|
||||||
@@ -608,7 +605,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
|||||||
|
|
||||||
final Context context = getContext();
|
final Context context = getContext();
|
||||||
final List<TaskSystemShortcut> shortcuts =
|
final List<TaskSystemShortcut> shortcuts =
|
||||||
mSnapshotView.getTaskOverlay().getEnabledShortcuts(this);
|
TaskOverlayFactory.INSTANCE.get(getContext()).getEnabledShortcuts(this);
|
||||||
final int count = shortcuts.size();
|
final int count = shortcuts.size();
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
final TaskSystemShortcut menuOption = shortcuts.get(i);
|
final TaskSystemShortcut menuOption = shortcuts.get(i);
|
||||||
@@ -647,7 +644,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<TaskSystemShortcut> shortcuts =
|
final List<TaskSystemShortcut> shortcuts =
|
||||||
mSnapshotView.getTaskOverlay().getEnabledShortcuts(this);
|
TaskOverlayFactory.INSTANCE.get(getContext()).getEnabledShortcuts(this);
|
||||||
final int count = shortcuts.size();
|
final int count = shortcuts.size();
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
final TaskSystemShortcut menuOption = shortcuts.get(i);
|
final TaskSystemShortcut menuOption = shortcuts.get(i);
|
||||||
@@ -733,6 +730,10 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
|||||||
return mShowScreenshot;
|
return mShowScreenshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setOverlayEnabled(boolean overlayEnabled) {
|
||||||
|
mSnapshotView.setOverlayEnabled(overlayEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We update and subsequently draw these in {@link #setFullscreenProgress(float)}.
|
* We update and subsequently draw these in {@link #setFullscreenProgress(float)}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -258,9 +258,6 @@ public class LauncherState {
|
|||||||
* Called when the start transition ends and the user settles on this particular state.
|
* Called when the start transition ends and the user settles on this particular state.
|
||||||
*/
|
*/
|
||||||
public void onStateTransitionEnd(Launcher launcher) {
|
public void onStateTransitionEnd(Launcher launcher) {
|
||||||
if (this == NORMAL || this == SPRING_LOADED) {
|
|
||||||
UiFactory.resetOverview(launcher);
|
|
||||||
}
|
|
||||||
if (this == NORMAL) {
|
if (this == NORMAL) {
|
||||||
// Clear any rotation locks when going to normal state
|
// Clear any rotation locks when going to normal state
|
||||||
launcher.getRotationHelper().setCurrentStateRequest(REQUEST_NONE);
|
launcher.getRotationHelper().setCurrentStateRequest(REQUEST_NONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user