Search in sources :

Example 1 with AccessibleDragListenerAdapter

use of com.android.launcher3.accessibility.AccessibleDragListenerAdapter in project android_packages_apps_Launcher3 by crdroidandroid.

the class Folder method startDrag.

public boolean startDrag(View v, DragOptions options) {
    Object tag = v.getTag();
    if (tag instanceof WorkspaceItemInfo) {
        WorkspaceItemInfo item = (WorkspaceItemInfo) tag;
        mEmptyCellRank = item.rank;
        mCurrentDragView = v;
        mDragController.addDragListener(this);
        if (options.isAccessibleDrag) {
            mDragController.addDragListener(new AccessibleDragListenerAdapter(mContent, FolderAccessibilityHelper::new) {

                @Override
                protected void enableAccessibleDrag(boolean enable) {
                    super.enableAccessibleDrag(enable);
                    mFooter.setImportantForAccessibility(enable ? IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : IMPORTANT_FOR_ACCESSIBILITY_AUTO);
                }
            });
        }
        mLauncherDelegate.beginDragShared(v, this, options);
    }
    return true;
}
Also used : AccessibleDragListenerAdapter(com.android.launcher3.accessibility.AccessibleDragListenerAdapter) WorkspaceItemInfo(com.android.launcher3.model.data.WorkspaceItemInfo)

Example 2 with AccessibleDragListenerAdapter

use of com.android.launcher3.accessibility.AccessibleDragListenerAdapter in project android_packages_apps_Launcher3 by crdroidandroid.

the class Workspace method startDrag.

public void startDrag(CellLayout.CellInfo cellInfo, DragOptions options) {
    View child = cellInfo.cell;
    mDragInfo = cellInfo;
    child.setVisibility(INVISIBLE);
    if (options.isAccessibleDrag) {
        mDragController.addDragListener(new AccessibleDragListenerAdapter(this, WorkspaceAccessibilityHelper::new) {

            @Override
            protected void enableAccessibleDrag(boolean enable) {
                super.enableAccessibleDrag(enable);
                setEnableForLayout(mLauncher.getHotseat(), enable);
            }
        });
    }
    beginDragShared(child, this, options);
}
Also used : AccessibleDragListenerAdapter(com.android.launcher3.accessibility.AccessibleDragListenerAdapter) DraggableView(com.android.launcher3.dragndrop.DraggableView) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) AppWidgetHostView(android.appwidget.AppWidgetHostView) View(android.view.View) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) DragView(com.android.launcher3.dragndrop.DragView)

Aggregations

AccessibleDragListenerAdapter (com.android.launcher3.accessibility.AccessibleDragListenerAdapter)2 AppWidgetHostView (android.appwidget.AppWidgetHostView)1 View (android.view.View)1 DragView (com.android.launcher3.dragndrop.DragView)1 DraggableView (com.android.launcher3.dragndrop.DraggableView)1 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)1 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)1 PendingAppWidgetHostView (com.android.launcher3.widget.PendingAppWidgetHostView)1