Making caret visibility part of state definition

> Hiding the caret in fast overview state
> Hiding caret in task swipe down interaction

Bug: 79700605
Change-Id: I984d535bc75802501e8aeb13c8f37387f331e5bc
This commit is contained in:
Sunny Goyal
2018-05-22 15:58:20 -07:00
parent dcae7e2b24
commit 56e1019e95
6 changed files with 46 additions and 15 deletions
@@ -100,9 +100,9 @@ public class OverviewState extends LauncherState {
@Override
public int getVisibleElements(Launcher launcher) {
if (launcher.getDeviceProfile().isVerticalBarLayout()) {
return 0;
return VERTICAL_SWIPE_INDICATOR;
} else {
return HOTSEAT_SEARCH_BOX |
return HOTSEAT_SEARCH_BOX | VERTICAL_SWIPE_INDICATOR |
(launcher.getAppsView().getFloatingHeaderView().hasVisibleContent()
? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS);
}
@@ -35,6 +35,9 @@ import android.view.ViewDebug;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.LayoutUtils;
@@ -136,6 +139,12 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
}
anim.play(ObjectAnimator.ofFloat(
mActivity.getAllAppsController(), ALL_APPS_PROGRESS, allAppsProgressOffscreen));
ObjectAnimator dragHandleAnim = ObjectAnimator.ofInt(
mActivity.findViewById(R.id.scrim_view), ScrimView.DRAG_HANDLE_ALPHA, 0);
dragHandleAnim.setInterpolator(Interpolators.ACCEL_2);
anim.play(dragHandleAnim);
return anim;
}
@@ -150,7 +159,7 @@ public class LauncherRecentsView extends RecentsView<Launcher> {
mActivity.getStateManager().goToState(NORMAL, false /* animate */);
} else {
LauncherState state = mActivity.getStateManager().getState();
mActivity.getAllAppsController().setProgress(state.getVerticalProgress(mActivity));
mActivity.getAllAppsController().setState(state);
}
super.onTaskLaunched(success);
}
@@ -153,15 +153,6 @@ public class ShelfScrimView extends ScrimView {
}
}
@Override
protected void updateDragHandleAlpha() {
if (mDrawingFlatColor) {
super.updateDragHandleAlpha();
} else if (mDragHandle != null) {
mDragHandle.setAlpha(255);
}
}
@Override
protected void onDraw(Canvas canvas) {
float translate = drawBackground(canvas);