summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author Ben Reich <benreich@google.com> 2025-03-14 17:57:32 +1100
committer Ben Reich <benreich@google.com> 2025-03-14 17:59:15 +1100
commitdc3e73e728894bf178b3a10e2b2f36717ee8f557 (patch)
treeb8807f1f0363252ab209b0844f376700e7c61c45 /src
parente1604abe849bae1601dd879ce2fb494702dac184 (diff)
Remove the full width "Use this folder" for all form factors
Fix: 403347213 Test: m DocumentsUIGoogle and view in all form factors Flag: com.android.documentsui.flags.use_material3 Change-Id: I452e2a38c88b48279396b8ff6de00ebd1c3fac29
Diffstat (limited to 'src')
-rw-r--r--src/com/android/documentsui/picker/PickFragment.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/com/android/documentsui/picker/PickFragment.java b/src/com/android/documentsui/picker/PickFragment.java
index 66f05fa0f..0d20083a8 100644
--- a/src/com/android/documentsui/picker/PickFragment.java
+++ b/src/com/android/documentsui/picker/PickFragment.java
@@ -181,12 +181,21 @@ public class PickFragment extends Fragment {
switch (mAction) {
case State.ACTION_OPEN_TREE:
mPick.setText(getString(R.string.open_tree_button));
- // On laptops we want the "Use this folder" button to appear with the "Cancel"
- // button as a back gesture with a mouse is not easy.
- if (!isUseMaterial3FlagEnabled()
- || !getActivity().getPackageManager()
- .hasSystemFeature(PackageManager.FEATURE_PC)) {
+ // When use_material3 flag is enabled, all form factors should have the pick button
+ // wrap the text content instead of taking up the full width.
+ if (!isUseMaterial3FlagEnabled()) {
+ mCancel.setVisibility(View.GONE);
mPick.setWidth(Integer.MAX_VALUE);
+ mPickOverlay.setVisibility(
+ mPickTarget.isBlockedFromTree() && mRestrictScopeStorage
+ ? View.VISIBLE
+ : View.GONE);
+ } else if (!getActivity()
+ .getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_PC)) {
+ // On non-desktop devices the back gesture is used to cancel the picker, so
+ // don't show the "Cancel" button on these devices and instead enable the pick
+ // overlay which enables showing a toast when the disabled button is pressed.
mCancel.setVisibility(View.GONE);
mPickOverlay.setVisibility(
mPickTarget.isBlockedFromTree() && mRestrictScopeStorage