Adding a custom view for DragHandle

> Separating page indicator and drag handle
> Page indicator always draws irrespactive of oriantation
> Drag handle is responsible for accessibility interactions
> Adding assissibility actions for DragHandle

Bug: 72500733
Change-Id: I9030337456964af1bdf77f1c01956452321f9229
This commit is contained in:
Sunny Goyal
2018-03-26 12:10:31 -07:00
parent 864ae5a2b3
commit 81b4c7bb3c
20 changed files with 348 additions and 225 deletions

View File

@@ -18,8 +18,9 @@ package com.android.launcher3;
import static com.android.launcher3.LauncherAnimUtils.DRAWABLE_ALPHA;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherState.HOTSEAT_EXTRA;
import static com.android.launcher3.LauncherState.DRAG_HANDLE_INDICATOR;
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
import static com.android.launcher3.LauncherState.HOTSEAT_SEARCH_BOX;
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
import android.view.View;
@@ -81,16 +82,19 @@ public class WorkspaceStateTransitionAnimation {
int elements = state.getVisibleElements(mLauncher);
float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0;
float hotseatExtraAlpha = (elements & HOTSEAT_EXTRA) != 0 ? 1 : 0;
propertySetter.setViewAlpha(mLauncher.getHotseat().getLayout(), hotseatIconsAlpha,
pageAlphaProvider.interpolator);
for (View hotseatExtraContent : UiFactory.getHotseatExtraContent(mLauncher.getHotseat())) {
propertySetter.setViewAlpha(hotseatExtraContent, hotseatExtraAlpha,
pageAlphaProvider.interpolator);
}
propertySetter.setViewAlpha(mLauncher.getWorkspace().getPageIndicator(),
hotseatIconsAlpha, pageAlphaProvider.interpolator);
propertySetter.setViewAlpha(mLauncher.getHotseatSearchBox(),
(elements & HOTSEAT_SEARCH_BOX) != 0 ? 1 : 0,
pageAlphaProvider.interpolator);
propertySetter.setViewAlpha(mLauncher.getDragHandleIndicator(),
(elements & DRAG_HANDLE_INDICATOR) != 0 ? 1 : 0,
pageAlphaProvider.interpolator);
// Set scrim
propertySetter.setFloat(ViewScrim.get(mWorkspace), ViewScrim.PROGRESS,
state.hasScrim ? 1 : 0, Interpolators.LINEAR);