Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8165766b authored by Miki Dahab's avatar Miki Dahab Committed by Gerrit Code Review
Browse files

Trebuchet: Allow uninstall/app info shortcut with locked homescreen

Allow users to access the drag-and-drop uninstall and app info shortcuts
even when the homescreen is locked.

Change-Id: I67721e0d653b59ae7c8af8bac5ede754cb0615f8
parent f7621a4f
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;


/* Class that does most of the work of enabling dragging items out of a PagedView by performing a
@@ -104,11 +103,6 @@ public abstract class PagedViewWithDraggableItems extends PagedView

    @Override
    public boolean onLongClick(View v) {
        // Only if workspace is not locked
        if (mLauncher.getLockWorkspace()) {
            Toast.makeText(mLauncher, mLauncher.getString(R.string.workspace_locked), Toast.LENGTH_SHORT).show();
            return false;
        }
        // Return early if this is not initiated from a touch
        if (!v.isInTouchMode()) return false;
        // Return early if we are still animating the pages
+6 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.cyanogenmod.trebuchet.FolderIcon.FolderRingAnimator;
import com.cyanogenmod.trebuchet.LauncherSettings.Favorites;
@@ -2691,6 +2692,11 @@ public class Workspace extends PagedView
        // If it's an external drop (e.g. from All Apps), check if it should be accepted
        CellLayout dropTargetLayout = mDropToLayout;
        if (d.dragSource != this) {
            // Don't accept if homescreen is locked
            if (mLauncher.getLockWorkspace()) {
                Toast.makeText(mLauncher, mLauncher.getString(R.string.workspace_locked), Toast.LENGTH_SHORT).show();
                return false;
            }
            // Don't accept the drop if we're not over a screen at time of drop
            if (dropTargetLayout == null) {
                return false;