summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-04-29 00:59:24 +0200
committerNebojsa Cvetkovic <nebkat@gmail.com>2013-04-29 13:48:59 +0100
commitbd9793a7c059a616745f636128c665860d78ed8d (patch)
tree7073cbedf336824693edf96dc66b8b6d6a4dcc9f /src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java
parentb76a4e1cd7734e35b779615d337e22b6c65648ee (diff)
downloadpackages_apps_trebuchet-bd9793a7c059a616745f636128c665860d78ed8d.zip
packages_apps_trebuchet-bd9793a7c059a616745f636128c665860d78ed8d.tar.gz
packages_apps_trebuchet-bd9793a7c059a616745f636128c665860d78ed8d.tar.bz2
Trebuchet: Lock homescreen
Allow lock shortcuts and folders positions in the workspace, hotseat and apps and widgets drawer. When is enabled the system avoids to move any shortcut or folder, change its names and access to widgets. Patchset 2: Fixed typo Change-Id: I832da526cf1eb32752218656a7c2dafc53010236 JIRA: CYAN-686 Issue: https://jira.cyanogenmod.org/browse/CYAN-686 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java')
-rw-r--r--src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java b/src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java
index 1f0befa..1674060 100644
--- a/src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java
+++ b/src/com/cyanogenmod/trebuchet/PagedViewWithDraggableItems.java
@@ -20,6 +20,7 @@ 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
@@ -73,7 +74,10 @@ public abstract class PagedViewWithDraggableItems extends PagedView
break;
case MotionEvent.ACTION_MOVE:
if (mTouchState != TOUCH_STATE_SCROLLING && !mIsDragging && mIsDragEnabled) {
- determineDraggingStart(ev);
+ // Only if workspace is not locked
+ if (!mLauncher.getLockWorkspace()) {
+ determineDraggingStart(ev);
+ }
}
break;
}
@@ -100,6 +104,11 @@ 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