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

Commit 45f75e2a authored by Aga Wronska's avatar Aga Wronska
Browse files

Stop current root reloading when it is clicked again

Bug: 25079217
Change-Id: I5d32be06d9eda4e5aced965030cce863e8a1965d
parent 75929877
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -205,6 +205,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;