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

Commit 4f63c76b authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Refactoring WallpaperOffsetInterpolator to a new file Removing some us...

Merge "Refactoring WallpaperOffsetInterpolator to a new file Removing some us unused methods" into ub-launcher3-master
parents b9388f57 9eba1fd7
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
@@ -164,40 +164,6 @@ public class TiledImageView extends FrameLayout {
        }
    }

    private RectF mTempRectF = new RectF();
    public void positionFromMatrix(Matrix matrix) {
        if (mRenderer.source != null) {
            final int rotation = mRenderer.source.getRotation();
            final boolean swap = !(rotation % 180 == 0);
            final int width = swap ? mRenderer.source.getImageHeight()
                    : mRenderer.source.getImageWidth();
            final int height = swap ? mRenderer.source.getImageWidth()
                    : mRenderer.source.getImageHeight();
            mTempRectF.set(0, 0, width, height);
            matrix.mapRect(mTempRectF);
            matrix.getValues(mValues);
            int cx = width / 2;
            int cy = height / 2;
            float scale = mValues[Matrix.MSCALE_X];
            int xoffset = Math.round((getWidth() - mTempRectF.width()) / 2 / scale);
            int yoffset = Math.round((getHeight() - mTempRectF.height()) / 2 / scale);
            if (rotation == 90 || rotation == 180) {
                cx += (mTempRectF.left / scale) - xoffset;
            } else {
                cx -= (mTempRectF.left / scale) - xoffset;
            }
            if (rotation == 180 || rotation == 270) {
                cy += (mTempRectF.top / scale) - yoffset;
            } else {
                cy -= (mTempRectF.top / scale) - yoffset;
            }
            mRenderer.scale = scale;
            mRenderer.centerX = swap ? cy : cx;
            mRenderer.centerY = swap ? cx : cy;
            invalidate();
        }
    }

    @Thunk class TileRenderer implements Renderer {

        private GLES20Canvas mCanvas;
+0 −9
Original line number Diff line number Diff line
@@ -61,13 +61,4 @@ public class AnotherWindowDropTarget implements DropTarget {
    // These methods are implemented in Views
    @Override
    public void getHitRectRelativeToDragLayer(Rect outRect) {}

    @Override
    public void getLocationInDragLayer(int[] loc) {}

    @Override
    public int getLeft() { return 0; }

    @Override
    public int getTop() { return 0; }
}
+0 −5
Original line number Diff line number Diff line
@@ -302,11 +302,6 @@ public abstract class ButtonDropTarget extends TextView
        return to;
    }

    @Override
    public void getLocationInDragLayer(int[] loc) {
        mLauncher.getDragLayer().getLocationInDragLayer(this, loc);
    }

    public void enableAccessibleDrag(boolean enable) {
        setOnClickListener(enable ? this : null);
    }
+1 −14
Original line number Diff line number Diff line
@@ -153,9 +153,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
    private static final boolean DESTRUCTIVE_REORDER = false;
    private static final boolean DEBUG_VISUALIZE_OCCUPIED = false;

    static final int LANDSCAPE = 0;
    static final int PORTRAIT = 1;

    private static final float REORDER_PREVIEW_MAGNITUDE = 0.12f;
    private static final int REORDER_ANIMATION_DURATION = 150;
    @Thunk float mReorderPreviewAnimationMagnitude;
@@ -403,10 +400,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
        mIsDragTarget = false;
    }

    public boolean isDragTarget() {
        return mIsDragTarget;
    }

    void setIsDragOverlapping(boolean isDragOverlapping) {
        if (mIsDragOverlapping != isDragOverlapping) {
            mIsDragOverlapping = isDragOverlapping;
@@ -449,10 +442,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
                (ParcelableSparseArray) parcelable : new ParcelableSparseArray();
    }

    public boolean getIsDragOverlapping() {
        return mIsDragOverlapping;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        if (!mIsDragTarget) {
@@ -1313,9 +1302,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
     * @param spanX Horizontal span of the object.
     * @param spanY Vertical span of the object.
     * @param direction The favored direction in which the views should move from x, y
     * @param exactDirectionOnly If this parameter is true, then only solutions where the direction
     *        matches exactly. Otherwise we find the best matching direction.
     * @param occoupied The array which represents which cells in the CellLayout are occupied
     * @param occupied The array which represents which cells in the CellLayout are occupied
     * @param blockOccupied The array which represents which cells in the specified block (cellX,
     *        cellY, spanX, spanY) are occupied. This is used when try to move a group of views.
     * @param result Array in which to place the result, or null (in which case a new array will
+1 −6
Original line number Diff line number Diff line
@@ -29,9 +29,7 @@ import com.android.launcher3.accessibility.DragViewStateAnnouncer;
 */
public interface DropTarget {

    public static final String TAG = "DropTarget";

    public static class DragObject {
    class DragObject {
        public int x = -1;
        public int y = -1;

@@ -154,7 +152,4 @@ public interface DropTarget {

    // These methods are implemented in Views
    void getHitRectRelativeToDragLayer(Rect outRect);
    void getLocationInDragLayer(int[] loc);
    int getLeft();
    int getTop();
}
Loading