Loading src/com/android/settings/cyanogenmod/TouchInterceptor.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -86,13 +86,17 @@ public class TouchInterceptor extends ListView { // The dragger icon itself is quite small, so pretend the // The dragger icon itself is quite small, so pretend the // touch area is bigger // touch area is bigger if (x < r.right * 2) { if (x < r.right * 2) { // Fix x position while dragging int[] itemPos = new int[2]; item.getLocationOnScreen(itemPos); item.setDrawingCacheEnabled(true); item.setDrawingCacheEnabled(true); // Create a copy of the drawing cache so that it does // Create a copy of the drawing cache so that it does // not get recycled // not get recycled // by the framework when the list tries to clean up // by the framework when the list tries to clean up // memory // memory Bitmap bitmap = Bitmap.createBitmap(item.getDrawingCache()); Bitmap bitmap = Bitmap.createBitmap(item.getDrawingCache()); startDragging(bitmap, y); startDragging(bitmap, itemPos[0], y); mDragPos = itemnum; mDragPos = itemnum; mFirstDragPos = mDragPos; mFirstDragPos = mDragPos; mHeight = getHeight(); mHeight = getHeight(); Loading Loading @@ -292,12 +296,12 @@ public class TouchInterceptor extends ListView { return super.onTouchEvent(ev); return super.onTouchEvent(ev); } } private void startDragging(Bitmap bm, int y) { private void startDragging(Bitmap bm, int x, int y) { stopDragging(); stopDragging(); mWindowParams = new WindowManager.LayoutParams(); mWindowParams = new WindowManager.LayoutParams(); mWindowParams.gravity = Gravity.TOP; mWindowParams.gravity = Gravity.TOP | Gravity.LEFT; mWindowParams.x = 0; mWindowParams.x = x; mWindowParams.y = y - mDragPoint + mCoordOffset; mWindowParams.y = y - mDragPoint + mCoordOffset; mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT; mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT; Loading Loading
src/com/android/settings/cyanogenmod/TouchInterceptor.java +8 −4 Original line number Original line Diff line number Diff line Loading @@ -86,13 +86,17 @@ public class TouchInterceptor extends ListView { // The dragger icon itself is quite small, so pretend the // The dragger icon itself is quite small, so pretend the // touch area is bigger // touch area is bigger if (x < r.right * 2) { if (x < r.right * 2) { // Fix x position while dragging int[] itemPos = new int[2]; item.getLocationOnScreen(itemPos); item.setDrawingCacheEnabled(true); item.setDrawingCacheEnabled(true); // Create a copy of the drawing cache so that it does // Create a copy of the drawing cache so that it does // not get recycled // not get recycled // by the framework when the list tries to clean up // by the framework when the list tries to clean up // memory // memory Bitmap bitmap = Bitmap.createBitmap(item.getDrawingCache()); Bitmap bitmap = Bitmap.createBitmap(item.getDrawingCache()); startDragging(bitmap, y); startDragging(bitmap, itemPos[0], y); mDragPos = itemnum; mDragPos = itemnum; mFirstDragPos = mDragPos; mFirstDragPos = mDragPos; mHeight = getHeight(); mHeight = getHeight(); Loading Loading @@ -292,12 +296,12 @@ public class TouchInterceptor extends ListView { return super.onTouchEvent(ev); return super.onTouchEvent(ev); } } private void startDragging(Bitmap bm, int y) { private void startDragging(Bitmap bm, int x, int y) { stopDragging(); stopDragging(); mWindowParams = new WindowManager.LayoutParams(); mWindowParams = new WindowManager.LayoutParams(); mWindowParams.gravity = Gravity.TOP; mWindowParams.gravity = Gravity.TOP | Gravity.LEFT; mWindowParams.x = 0; mWindowParams.x = x; mWindowParams.y = y - mDragPoint + mCoordOffset; mWindowParams.y = y - mDragPoint + mCoordOffset; mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT; mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT; Loading