Merge "Adding a custom view for DragHandle" into ub-launcher3-master
This commit is contained in:
commit
3d58de67a8
20 files changed
+348
-225
No files matched your search
@@ -112,8 +112,9 @@ public class OverviewState extends LauncherState {
|
||||
if (launcher.getDeviceProfile().isVerticalBarLayout()) {
|
||||
return NONE;
|
||||
} else {
|
||||
return launcher.getAppsView().getFloatingHeaderView().hasVisibleContent()
|
||||
? HOTSEAT_EXTRA | ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS | HOTSEAT_EXTRA;
|
||||
return HOTSEAT_SEARCH_BOX | DRAG_HANDLE_INDICATOR |
|
||||
(launcher.getAppsView().getFloatingHeaderView().hasVisibleContent()
|
||||
? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,14 +21,10 @@ import static com.android.quickstep.OverviewInteractionState.KEY_SWIPE_UP_ENABLE
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.view.View;
|
||||
import android.view.View.AccessibilityDelegate;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.Hotseat;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherStateManager.StateHandler;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.util.TouchController;
|
||||
import com.android.quickstep.OverviewInteractionState;
|
||||
import com.android.quickstep.RecentsModel;
|
||||
@@ -59,10 +55,6 @@ public class UiFactory {
|
||||
}
|
||||
}
|
||||
|
||||
public static AccessibilityDelegate newPageIndicatorAccessibilityDelegate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static StateHandler[] getStateHandler(Launcher launcher) {
|
||||
return new StateHandler[] {
|
||||
launcher.getAllAppsController(), launcher.getWorkspace(),
|
||||
@@ -99,11 +91,4 @@ public class UiFactory {
|
||||
model.onTrimMemory(level);
|
||||
}
|
||||
}
|
||||
|
||||
public static View[] getHotseatExtraContent(Hotseat hotseat) {
|
||||
return new View[] {
|
||||
hotseat.findViewById(R.id.drag_indicator),
|
||||
hotseat.findViewById(R.id.search_container_hotseat),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) 2018 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.quickstep.views;
|
||||
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType;
|
||||
import com.android.launcher3.views.LauncherDragIndicator;
|
||||
|
||||
public class QuickstepDragIndicator extends LauncherDragIndicator {
|
||||
|
||||
public QuickstepDragIndicator(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public QuickstepDragIndicator(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public QuickstepDragIndicator(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private boolean isInOverview() {
|
||||
return mLauncher.isInState(OVERVIEW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(info);
|
||||
if (isInOverview()) {
|
||||
info.setContentDescription(getContext().getString(R.string.all_apps_button_label));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initCustomActions(AccessibilityNodeInfo info) {
|
||||
if (!isInOverview()) {
|
||||
super.initCustomActions(info);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (isInOverview()) {
|
||||
mLauncher.getUserEventDispatcher().logActionOnControl(
|
||||
Action.Touch.TAP, ControlType.ALL_APPS_BUTTON, ContainerType.TASKSWITCHER);
|
||||
mLauncher.getStateManager().goToState(ALL_APPS);
|
||||
super.onClick(view);
|
||||
} else {
|
||||
mLauncher.getUserEventDispatcher().logActionOnControl(
|
||||
Action.Touch.TAP, ControlType.ALL_APPS_BUTTON, ContainerType.WORKSPACE);
|
||||
mLauncher.getStateManager().goToState(OVERVIEW);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user