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

Commit 68fbcc9d authored by Ben Lin's avatar Ben Lin Committed by Android (Google) Code Review
Browse files

Merge "Proper ActionMode clean up when spring opening directories."

parents 26bff155 eecb915c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -138,6 +138,11 @@ public abstract class AbstractActionHandler<T extends Activity & CommonAddons>
        mActivity.startActivity(intent);
    }

    @Override
    public void springOpenDirectory(DocumentInfo doc) {
        throw new UnsupportedOperationException("Can't spring open directories.");
    }

    @Override
    public void openSettings(RootInfo root) {
        throw new UnsupportedOperationException("Can't open settings.");
+7 −0
Original line number Diff line number Diff line
@@ -68,6 +68,13 @@ public interface ActionHandler {

    boolean openDocument(DocumentDetails doc);

    /**
     * This is called when user hovers over a doc for enough time during a drag n' drop, to open a
     * folder that accepts drop. We should only open a container that's not an archive, since archives
     * do not accept dropping.
     */
    void springOpenDirectory(DocumentInfo doc);

    void showChooserForDoc(DocumentInfo doc);

    void openContainerDocument(DocumentInfo doc);
+0 −7
Original line number Diff line number Diff line
@@ -383,13 +383,6 @@ public abstract class BaseActivity
        invalidateOptionsMenu();
    }

    /**
     * This is called when user hovers over a doc for enough time during a drag n' drop, to open a
     * folder that accepts drop. We should only open a container that's not an archive.
     */
    public void springOpenDirectory(DocumentInfo doc) {
    }

    private void reloadSearch(String query) {
        FragmentManager fm = getFragmentManager();
        RootInfo root = getCurrentRoot();
+1 −1
Original line number Diff line number Diff line
@@ -897,7 +897,7 @@ public class DirectoryFragment extends Fragment
    public void onViewHovered(View view) {
        BaseActivity activity = mActivity;
        if (getModelId(view) != null) {
           activity.springOpenDirectory(getDestination(view));
            mActions.springOpenDirectory(getDestination(view));
        }
        activity.setRootsDrawerOpen(false);
    }
+7 −0
Original line number Diff line number Diff line
@@ -173,6 +173,13 @@ public class ActionHandler<T extends Activity & Addons> extends AbstractActionHa
        return false;
    }

    @Override
    public void springOpenDirectory(DocumentInfo doc) {
        assert(doc.isDirectory());
        mActionModeAddons.finishActionMode();
        openContainerDocument(doc);
    }

    @Override
    public boolean viewDocument(DocumentDetails details) {
        DocumentInfo doc = mModel.getDocument(details.getModelId());
Loading