Search in sources :

Example 46 with Hotseat

use of com.android.launcher3.Hotseat in project Neo-Launcher by NeoApplications.

the class LauncherRecentsView method shouldStealTouchFromSiblingsBelow.

@Override
protected boolean shouldStealTouchFromSiblingsBelow(MotionEvent ev) {
    if (ev.getAction() == MotionEvent.ACTION_DOWN) {
        // Allow touches to go through to the hotseat.
        Hotseat hotseat = mActivity.getHotseat();
        boolean touchingHotseat = hotseat.isShown() && mActivity.getDragLayer().isEventOverView(hotseat, ev, this);
        return !touchingHotseat;
    }
    return super.shouldStealTouchFromSiblingsBelow(ev);
}
Also used : Hotseat(com.android.launcher3.Hotseat)

Example 47 with Hotseat

use of com.android.launcher3.Hotseat in project Neo-Launcher by NeoApplications.

the class LauncherRecentsView method createAdjacentPageAnimForTaskLaunch.

/**
 * Animates adjacent tasks and translate hotseat off screen as well.
 */
@Override
public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv, ClipAnimationHelper helper) {
    AnimatorSet anim = super.createAdjacentPageAnimForTaskLaunch(tv, helper);
    if (!SysUINavigationMode.getMode(mActivity).hasGestures) {
        // so don't animate it here either.
        return anim;
    }
    float allAppsProgressOffscreen = ALL_APPS_PROGRESS_OFF_SCREEN;
    LauncherState state = mActivity.getStateManager().getState();
    if ((state.getVisibleElements(mActivity) & ALL_APPS_HEADER_EXTRA) != 0) {
        float maxShiftRange = mActivity.getDeviceProfile().heightPx;
        float currShiftRange = mActivity.getAllAppsController().getShiftRange();
        allAppsProgressOffscreen = 1f + (maxShiftRange - currShiftRange) / maxShiftRange;
    }
    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;
}
Also used : LauncherState(com.android.launcher3.LauncherState) ObjectAnimator(android.animation.ObjectAnimator) AnimatorSet(android.animation.AnimatorSet)

Example 48 with Hotseat

use of com.android.launcher3.Hotseat in project Neo-Launcher by NeoApplications.

the class BubbleTextView method shouldTextBeVisible.

public boolean shouldTextBeVisible() {
    // Text should be visible everywhere but the hotseat.
    Object tag = getParent() instanceof FolderIcon ? ((View) getParent()).getTag() : getTag();
    ItemInfo info = tag instanceof ItemInfo ? (ItemInfo) tag : null;
    return info == null || info.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT;
}
Also used : PackageItemInfo(com.android.launcher3.model.PackageItemInfo) FolderIcon(com.android.launcher3.folder.FolderIcon)

Example 49 with Hotseat

use of com.android.launcher3.Hotseat in project Neo-Launcher by NeoApplications.

the class CellLayout method commitTempPlacement.

private void commitTempPlacement() {
    mTmpOccupied.copyTo(mOccupied);
    int screenId = Launcher.cast(mActivity).getWorkspace().getIdForScreen(this);
    int container = Favorites.CONTAINER_DESKTOP;
    if (mContainerType == HOTSEAT) {
        screenId = -1;
        container = Favorites.CONTAINER_HOTSEAT;
    }
    int childCount = mShortcutsAndWidgets.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View child = mShortcutsAndWidgets.getChildAt(i);
        LayoutParams lp = (LayoutParams) child.getLayoutParams();
        ItemInfo info = (ItemInfo) child.getTag();
        // AllApps button in the hotseat.
        if (info != null) {
            final boolean requiresDbUpdate = (info.cellX != lp.tmpCellX || info.cellY != lp.tmpCellY || info.spanX != lp.cellHSpan || info.spanY != lp.cellVSpan);
            info.cellX = lp.cellX = lp.tmpCellX;
            info.cellY = lp.cellY = lp.tmpCellY;
            info.spanX = lp.cellHSpan;
            info.spanY = lp.cellVSpan;
            if (requiresDbUpdate) {
                Launcher.cast(mActivity).getModelWriter().modifyItemInDatabase(info, container, screenId, info.cellX, info.cellY, info.spanX, info.spanY);
            }
        }
    }
}
Also used : View(android.view.View) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point)

Example 50 with Hotseat

use of com.android.launcher3.Hotseat in project Neo-Launcher by NeoApplications.

the class Launcher method dump.

/**
 * $ adb shell dumpsys activity com.android.launcher3.Launcher [--all]
 */
@Override
public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
    super.dump(prefix, fd, writer, args);
    if (args.length > 0 && TextUtils.equals(args[0], "--all")) {
        writer.println(prefix + "Workspace Items");
        for (int i = 0; i < mWorkspace.getPageCount(); i++) {
            writer.println(prefix + "  Homescreen " + i);
            ViewGroup layout = ((CellLayout) mWorkspace.getPageAt(i)).getShortcutsAndWidgets();
            for (int j = 0; j < layout.getChildCount(); j++) {
                Object tag = layout.getChildAt(j).getTag();
                if (tag != null) {
                    writer.println(prefix + "    " + tag.toString());
                }
            }
        }
        writer.println(prefix + "  Hotseat");
        ViewGroup layout = mHotseat.getShortcutsAndWidgets();
        for (int j = 0; j < layout.getChildCount(); j++) {
            Object tag = layout.getChildAt(j).getTag();
            if (tag != null) {
                writer.println(prefix + "    " + tag.toString());
            }
        }
    }
    writer.println(prefix + "Misc:");
    dumpMisc(prefix + "\t", writer);
    writer.println(prefix + "\tmWorkspaceLoading=" + mWorkspaceLoading);
    writer.println(prefix + "\tmPendingRequestArgs=" + mPendingRequestArgs + " mPendingActivityResult=" + mPendingActivityResult);
    writer.println(prefix + "\tmRotationHelper: " + mRotationHelper);
    writer.println(prefix + "\tmAppWidgetHost.isListening: " + mAppWidgetHost.isListening());
    // Extra logging for b/116853349
    mDragLayer.dump(prefix, writer);
    mStateManager.dump(prefix, writer);
    try {
        FileLog.flushAll(writer);
    } catch (Exception e) {
    // Ignore
    }
    mModel.dumpState(prefix, fd, writer, args);
    if (mLauncherCallbacks != null) {
        mLauncherCallbacks.dump(prefix, fd, writer, args);
    }
}
Also used : ViewGroup(android.view.ViewGroup) DragObject(com.android.launcher3.DropTarget.DragObject) Point(android.graphics.Point) ActivityNotFoundException(android.content.ActivityNotFoundException)

Aggregations

ItemInfo (com.android.launcher3.model.data.ItemInfo)67 View (android.view.View)66 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)46 Point (android.graphics.Point)27 ArrayList (java.util.ArrayList)27 CellLayout (com.android.launcher3.CellLayout)26 ViewGroup (android.view.ViewGroup)23 BubbleTextView (com.android.launcher3.BubbleTextView)23 FolderInfo (com.android.launcher3.model.data.FolderInfo)23 ArrowTipView (com.android.launcher3.views.ArrowTipView)22 FolderIcon (com.android.launcher3.folder.FolderIcon)20 SuppressLint (android.annotation.SuppressLint)19 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)19 Hotseat (com.android.launcher3.Hotseat)16 Intent (android.content.Intent)15 IntArray (com.android.launcher3.util.IntArray)13 Workspace (com.android.launcher3.Workspace)12 DraggableView (com.android.launcher3.dragndrop.DraggableView)12 HashSet (java.util.HashSet)12 AppWidgetHostView (android.appwidget.AppWidgetHostView)11