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

Commit 747f3992 authored by Ben Lin's avatar Ben Lin Committed by android-build-merger
Browse files

Merge "Open drawer only on first update." into nyc-dev

am: 527184d4

* commit '527184d4':
  Open drawer only on first update.

Change-Id: Iba746faf3b159a34b798513977114680ba4b5bb5
parents a12899eb 527184d4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -195,6 +195,10 @@ public abstract class FragmentTuner {
     */
    private static final class FilesTuner extends FragmentTuner {

        // We use this to keep track of whether a model has been previously loaded or not so we can
        // open the drawer on empty directories on first launch
        private boolean mModelPreviousLoaded;

        public FilesTuner(Context context, State state) {
            super(context, state);
        }
@@ -230,10 +234,12 @@ public abstract class FragmentTuner {
        @Override
        void onModelLoaded(Model model, @ResultType int resultType, boolean isSearch) {
            // When launched into empty root, open drawer.
            if (model.isEmpty() && !mState.hasInitialLocationChanged() && !isSearch) {
            if (model.isEmpty() && !mState.hasInitialLocationChanged() && !isSearch
                    && !mModelPreviousLoaded) {
                // This noops on layouts without drawer, so no need to guard.
                ((BaseActivity) mContext).setRootsDrawerOpen(true);
            }
            mModelPreviousLoaded = true;
        }

        @Override