diff options
author | Antonin Fouques <totofouques@gmail.com> | 2012-10-17 22:09:08 +0200 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-01 20:20:29 +0000 |
commit | e74a54343ce7896b5005154e8bcbc7d5f06c7808 (patch) | |
tree | 435245f8598a3d6e12405bdf191720ffba2419f1 /src/com/cyanogenmod/trebuchet/DragController.java | |
parent | 3969253120745ed01824f3e3df37de33ea3d7535 (diff) | |
download | android_packages_apps_Trebuchet-e74a54343ce7896b5005154e8bcbc7d5f06c7808.tar.gz android_packages_apps_Trebuchet-e74a54343ce7896b5005154e8bcbc7d5f06c7808.tar.bz2 android_packages_apps_Trebuchet-e74a54343ce7896b5005154e8bcbc7d5f06c7808.zip |
Trebuchet : Add a pref to set hotseat icon's number
This adds a preference for the hotseat (Launcher main bar/dock)
- Choose the number of icons on the hotseat
- Choose the place of the applications drawer button by drag'n'drop
- Translations in English + French
This is usefull for big screen devices.
You can set from 1 to 9 buttons on the hotseat.
You can set the app button where you want by drag'n'drop.
Default values are keeped unchanged so there is no pb with first screen tuto + no pb with default shortcuts.
Demo video : https://www.dropbox.com/s/2wamj9yr1s3woxl/Trebuchet-hotseat-icons.mp4
Demo apk : https://www.dropbox.com/s/psqab2gyivcyo3d/CmoaToto%20Trebuchet.apk
PatchSet 1 : initial commit
PatchSet 2 : coding style
PatchSet 3 : - Remove prefs for tablet
- AllApps Button move by Drag'n'Drop (instead of pref)
PatchSet 4 : searchbar & deletebar don't dis/appear while dragging AllApps button)
PatchSet 5 : dropOnFlingToDeleteTarget disabled for AllApps button
PatchSet 6 : - Fix shortcuts errors in database
- Set docks pref disabled for large screen programmatically
- Fix english strings/french trads
Change-Id: I21f6a4610ed16c8780ccf6e2acffcf6e07511457
Conflicts:
src/com/cyanogenmod/trebuchet/Hotseat.java
src/com/cyanogenmod/trebuchet/LauncherModel.java
src/com/cyanogenmod/trebuchet/Workspace.java
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/DragController.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/DragController.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/trebuchet/DragController.java b/src/com/cyanogenmod/trebuchet/DragController.java index 047c45548..b7709373f 100644 --- a/src/com/cyanogenmod/trebuchet/DragController.java +++ b/src/com/cyanogenmod/trebuchet/DragController.java @@ -34,6 +34,7 @@ import android.view.ViewConfiguration; import android.view.inputmethod.InputMethodManager; import com.cyanogenmod.trebuchet.R; +import com.cyanogenmod.trebuchet.DropTarget.DragObject; import java.util.ArrayList; @@ -440,7 +441,7 @@ public class DragController { case MotionEvent.ACTION_UP: mLastTouchUpTime = System.currentTimeMillis(); if (mDragging) { - PointF vec = isFlingingToDelete(mDragObject.dragSource); + PointF vec = isFlingingToDelete(mDragObject); if (vec != null) { dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec); } else { @@ -582,7 +583,7 @@ public class DragController { mHandler.removeCallbacks(mScrollRunnable); if (mDragging) { - PointF vec = isFlingingToDelete(mDragObject.dragSource); + PointF vec = isFlingingToDelete(mDragObject); if (vec != null) { dropOnFlingToDeleteTarget(dragLayerX, dragLayerY, vec); } else { @@ -605,9 +606,10 @@ public class DragController { * * @return the vector at which the item was flung, or null if no fling was detected. */ - private PointF isFlingingToDelete(DragSource source) { + private PointF isFlingingToDelete(DragObject object) { if (mFlingToDeleteDropTarget == null) return null; - if (!source.supportsFlingToDelete()) return null; + if (!object.dragSource.supportsFlingToDelete()) return null; + if (object.dragInfo instanceof AllAppsButtonInfo) return null; ViewConfiguration config = ViewConfiguration.get(mLauncher); mVelocityTracker.computeCurrentVelocity(1000, config.getScaledMaximumFlingVelocity()); |