mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Add drag and drop from AllAppsView (to the workspace).
Also had to fix AppInfoCache to load the icon as a drawable, which I had broken when I made AllAppsView use the icons as power of two textures.
This commit is contained in:
@@ -62,22 +62,20 @@ public class DragView extends View implements TweenCallback {
|
||||
* @param registrationX The x coordinate of the registration point.
|
||||
* @param registrationY The y coordinate of the registration point.
|
||||
*/
|
||||
public DragView(Context context, Bitmap bitmap, int registrationX, int registrationY) {
|
||||
public DragView(Context context, Bitmap bitmap, int registrationX, int registrationY,
|
||||
int left, int top, int width, int height) {
|
||||
super(context);
|
||||
|
||||
mWindowManager = WindowManagerImpl.getDefault();
|
||||
|
||||
mTween = new SymmetricalLinearTween(false, 110 /*ms duration*/, this);
|
||||
|
||||
int width = bitmap.getWidth();
|
||||
int height = bitmap.getHeight();
|
||||
|
||||
Matrix scale = new Matrix();
|
||||
float scaleFactor = width;
|
||||
scaleFactor = mScale = (scaleFactor + DRAG_SCALE) / scaleFactor;
|
||||
scale.setScale(scaleFactor, scaleFactor);
|
||||
|
||||
mBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, scale, true);
|
||||
mBitmap = Bitmap.createBitmap(bitmap, left, top, width, height, scale, true);
|
||||
|
||||
// The point in our scaled bitmap that the touch events are located
|
||||
mRegistrationX = registrationX + (DRAG_SCALE / 2);
|
||||
|
||||
Reference in New Issue
Block a user