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

Commit db6c200b authored by Garfield Tan's avatar Garfield Tan Committed by android-build-merger
Browse files

Fix a bug that stops user from dropping docs on empty area.

am: 85a479e9

Change-Id: Ic662b0b7ab3af781eba8d31377fd8ecb3862c9aa
parents de682eec 85a479e9
Loading
Loading
Loading
Loading
+19 −5
Original line number Diff line number Diff line
@@ -66,7 +66,8 @@ public interface DocumentClipper {
     * returned from {@link ClipboardManager#getPrimaryClip()}.
     *
     * @param destination destination document.
     * @param docStack the document stack to the destination folder,
     * @param docStack the document stack to the destination folder (not including the destination
     *                 folder)
     * @param callback callback to notify when operation finishes.
     */
    void copyFromClipboard(
@@ -94,8 +95,8 @@ public interface DocumentClipper {
     */
    void copyFromClipData(
            final RootInfo root,
            final @Nullable DocumentInfo destination,
            final @Nullable ClipData clipData,
            final DocumentInfo destination,
            final ClipData clipData,
            final FileOperations.Callback callback);

    /**
@@ -108,8 +109,21 @@ public interface DocumentClipper {
     * @param callback callback to notify when operation finishes
     */
    void copyFromClipData(
            final @Nullable DocumentInfo destination,
            final DocumentInfo destination,
            final DocumentStack docStack,
            final @Nullable ClipData clipData,
            final ClipData clipData,
            final FileOperations.Callback callback);

    /**
     * Copies documents from given clip data to a folder.
     *
     * @param dstStack the document stack to the destination folder, including the destination
     *            folder.
     * @param clipData the clipData to copy from
     * @param callback callback to notify when operation finishes
     */
    void copyFromClipData(
            final DocumentStack dstStack,
            final ClipData clipData,
            final FileOperations.Callback callback);
}
+4 −11
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ final class RuntimeDocumentClipper implements DocumentClipper {
    @Override
    public void copyFromClipData(
            final RootInfo root,
            final @Nullable DocumentInfo destination,
            final DocumentInfo destination,
            final @Nullable ClipData clipData,
            final FileOperations.Callback callback) {
        DocumentStack dstStack = new DocumentStack(root, destination);
@@ -236,7 +236,7 @@ final class RuntimeDocumentClipper implements DocumentClipper {

    @Override
    public void copyFromClipData(
            final @Nullable DocumentInfo destination,
            final DocumentInfo destination,
            final DocumentStack docStack,
            final @Nullable ClipData clipData,
            final FileOperations.Callback callback) {
@@ -245,15 +245,8 @@ final class RuntimeDocumentClipper implements DocumentClipper {
        copyFromClipData(dstStack, clipData, callback);
    }

    /**
     * Copies documents from given clip data to a folder.
     *
     * @param dstStack the document stack to the destination folder, including the destination
     *            folder.
     * @param clipData the clipData to copy from
     * @param callback callback to notify when operation finishes
     */
    private void copyFromClipData(
    @Override
    public void copyFromClipData(
            final DocumentStack dstStack,
            final @Nullable ClipData clipData,
            final FileOperations.Callback callback) {
+1 −2
Original line number Diff line number Diff line
@@ -965,9 +965,8 @@ public class DirectoryFragment extends Fragment

        DocumentInfo dst = getDestination(v);
        // If destination is already at top of stack, no need to pass it in
        if (!mState.stack.isEmpty() && mState.stack.peek().equals(dst)) {
        if (dst.equals(mState.stack.peek())) {
            mClipper.copyFromClipData(
                    null,
                    mState.stack,
                    clipData,
                    mInjector.dialogs::showFileOperationStatus);
+4 −0
Original line number Diff line number Diff line
@@ -76,6 +76,10 @@ public class TestDocumentClipper implements DocumentClipper {
            ClipData clipData, Callback callback) {
    }

    @Override
    public void copyFromClipData(DocumentStack docStack, ClipData clipData, Callback callback) {
    }

    @Override
    public int getOpType(ClipData data) {
        return 0;