Loading src/com/android/documentsui/MenuManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,8 @@ public abstract class MenuManager { updateModePicker(menu.findItem(R.id.sub_menu_grid), menu.findItem(R.id.sub_menu_list)); } public void updateModel(Model model) {} /** * Called when we needs {@link MenuManager} to ask Android to show context menu for us. * {@link MenuManager} can choose to defeat this request. Loading src/com/android/documentsui/Model.java +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ public class Model { } @VisibleForTesting protected void update(DirectoryResult result) { public void update(DirectoryResult result) { assert(result != null); if (DEBUG) Log.i(TAG, "Updating model with new result set."); Loading src/com/android/documentsui/dirlist/DirectoryFragment.java +1 −0 Original line number Diff line number Diff line Loading @@ -1121,6 +1121,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On mModel.doc != null ? mModel.doc.derivedUri : null); // For orientation changed case, sometimes the docs loading comes after the menu // update. We need to update the menu here to ensure the status is correct. mInjector.menuManager.updateModel(mModel); mInjector.menuManager.updateOptionMenu(); mActivity.updateHeaderTitle(); Loading src/com/android/documentsui/dirlist/DocumentHolder.java +7 −1 Original line number Diff line number Diff line Loading @@ -31,8 +31,8 @@ import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; import androidx.recyclerview.widget.RecyclerView; import com.android.documentsui.base.Shared; import com.android.documentsui.base.State; import java.util.function.Consumer; import java.util.function.Function; import javax.annotation.Nullable; Loading @@ -49,6 +49,8 @@ public abstract class DocumentHolder protected @Nullable String mModelId; protected @State.ActionType int mAction; // See #addKeyEventListener for details on the need for this field. private KeyboardEventListener<DocumentItemDetails> mKeyEventListener; Loading Loading @@ -99,6 +101,10 @@ public abstract class DocumentHolder setEnabledRecursive(itemView, enabled); } public void setAction(@State.ActionType int action) { mAction = action; } public void bindPreviewIcon(boolean show, Function<View, Boolean> clickCallback) {} @Override Loading src/com/android/documentsui/dirlist/GridDirectoryHolder.java +2 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.widget.TextView; import com.android.documentsui.IconUtils; import com.android.documentsui.R; import com.android.documentsui.base.State; import com.android.documentsui.ui.Views; final class GridDirectoryHolder extends DocumentHolder { Loading Loading @@ -73,7 +74,7 @@ final class GridDirectoryHolder extends DocumentHolder { @Override public boolean inSelectRegion(MotionEvent event) { return Views.isEventOver(event, mIconLayout); return mAction == State.ACTION_BROWSE ? Views.isEventOver(event, mIconLayout) : false; } /** Loading Loading
src/com/android/documentsui/MenuManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,8 @@ public abstract class MenuManager { updateModePicker(menu.findItem(R.id.sub_menu_grid), menu.findItem(R.id.sub_menu_list)); } public void updateModel(Model model) {} /** * Called when we needs {@link MenuManager} to ask Android to show context menu for us. * {@link MenuManager} can choose to defeat this request. Loading
src/com/android/documentsui/Model.java +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ public class Model { } @VisibleForTesting protected void update(DirectoryResult result) { public void update(DirectoryResult result) { assert(result != null); if (DEBUG) Log.i(TAG, "Updating model with new result set."); Loading
src/com/android/documentsui/dirlist/DirectoryFragment.java +1 −0 Original line number Diff line number Diff line Loading @@ -1121,6 +1121,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On mModel.doc != null ? mModel.doc.derivedUri : null); // For orientation changed case, sometimes the docs loading comes after the menu // update. We need to update the menu here to ensure the status is correct. mInjector.menuManager.updateModel(mModel); mInjector.menuManager.updateOptionMenu(); mActivity.updateHeaderTitle(); Loading
src/com/android/documentsui/dirlist/DocumentHolder.java +7 −1 Original line number Diff line number Diff line Loading @@ -31,8 +31,8 @@ import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; import androidx.recyclerview.widget.RecyclerView; import com.android.documentsui.base.Shared; import com.android.documentsui.base.State; import java.util.function.Consumer; import java.util.function.Function; import javax.annotation.Nullable; Loading @@ -49,6 +49,8 @@ public abstract class DocumentHolder protected @Nullable String mModelId; protected @State.ActionType int mAction; // See #addKeyEventListener for details on the need for this field. private KeyboardEventListener<DocumentItemDetails> mKeyEventListener; Loading Loading @@ -99,6 +101,10 @@ public abstract class DocumentHolder setEnabledRecursive(itemView, enabled); } public void setAction(@State.ActionType int action) { mAction = action; } public void bindPreviewIcon(boolean show, Function<View, Boolean> clickCallback) {} @Override Loading
src/com/android/documentsui/dirlist/GridDirectoryHolder.java +2 −1 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.widget.TextView; import com.android.documentsui.IconUtils; import com.android.documentsui.R; import com.android.documentsui.base.State; import com.android.documentsui.ui.Views; final class GridDirectoryHolder extends DocumentHolder { Loading Loading @@ -73,7 +74,7 @@ final class GridDirectoryHolder extends DocumentHolder { @Override public boolean inSelectRegion(MotionEvent event) { return Views.isEventOver(event, mIconLayout); return mAction == State.ACTION_BROWSE ? Views.isEventOver(event, mIconLayout) : false; } /** Loading