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

Commit bb21ac1a 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 907a2fde fd26e8d1
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;