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

Commit d8c25f89 authored by Aga Wronska's avatar Aga Wronska Committed by Android (Google) Code Review
Browse files

Merge "Stop current root reloading when it is clicked again"

parents bacab479 45f75e2a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -201,6 +201,11 @@ public abstract class BaseActivity extends Activity implements SearchManagerList
    void onStackRestored(boolean restored, boolean external) {}

    void onRootPicked(RootInfo root) {
        // Skip refreshing if root didn't change
        if(root.equals(getCurrentRoot())) {
            return;
        }

        mState.derivedMode = LocalPreferences.getViewMode(this, root, MODE_GRID);

        // Clear entire backstack and start in new root
+3 −3
Original line number Diff line number Diff line
@@ -180,9 +180,9 @@ public class RootsFragment extends Fragment {
            Item item = mAdapter.getItem(position);
            if (item instanceof RootItem) {
                BaseActivity activity = BaseActivity.get(RootsFragment.this);
                RootInfo info = ((RootItem) item).root;
                Metrics.logRootVisited(getActivity(), info);
                activity.onRootPicked(info);
                RootInfo newRoot = ((RootItem) item).root;
                Metrics.logRootVisited(getActivity(), newRoot);
                activity.onRootPicked(newRoot);
            } else if (item instanceof AppItem) {
                DocumentsActivity activity = DocumentsActivity.get(RootsFragment.this);
                ResolveInfo info = ((AppItem) item).info;