Loading Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,12 @@ java_defaults { "docsui-change-ids", "guava", "modules-utils-build_system", // Glide and dependencies. Optimized out when use_peek_preview_ro flag enabled. // See b/421076517 for more details. "androidx.exifinterface_exifinterface", "glide-disklrucache-prebuilt", "glide-gifdecoder-prebuilt", "glide-prebuilt", ], privileged: true, Loading res/flag(com.android.documentsui.flags.use_material3)/layout/peek_layout.xml +2 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,8 @@ android:layout_width="match_parent" android:layout_height="match_parent"> <com.android.documentsui.peek.RenderView android:id="@+id/peek_preview" <FrameLayout android:id="@+id/peek_preview_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- Text and icons using android:white because the underlying black scrim doesn't Loading res/flag(com.android.documentsui.flags.use_material3)/layout/peek_no_preview.xml +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ See the License for the specific language governing permissions and limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/peek_preview_container" android:layout_width="match_parent" android:layout_height="match_parent"> Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -694,4 +694,7 @@ <!-- Text used in Peek to indicate that no preview is available. --> <string name="peek_no_preview">No preview available</string> <!-- Accessibility label for an image preview in Peek. --> <string name="a11y_peek_image_preview">Image preview of <xliff:g id="filename" example="image.png">%s</xliff:g></string> </resources> src/com/android/documentsui/OperationDialogFragment.java +16 −10 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.text.Html; import android.widget.TextView; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.FragmentManager; Loading @@ -44,6 +45,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; /** * Alert dialog for operation dialogs. Loading @@ -68,16 +70,18 @@ public class OperationDialogFragment extends DialogFragment { public static void show( FragmentManager fm, @DialogType int dialogType, ArrayList<DocumentInfo> failedSrcList, ArrayList<Uri> uriList, ArrayList<DocumentInfo> failedDocs, ArrayList<Uri> failedUris, ArrayList<String> failedPaths, DocumentStack dstStack, @OpType int operationType) { final Bundle args = new Bundle(); args.putInt(FileOperationService.EXTRA_DIALOG_TYPE, dialogType); args.putInt(FileOperationService.EXTRA_OPERATION_TYPE, operationType); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_DOCS, failedSrcList); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_URIS, uriList); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_DOCS, failedDocs); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_URIS, failedUris); args.putStringArrayList(FileOperationService.EXTRA_FAILED_PATHS, failedPaths); final FragmentTransaction ft = fm.beginTransaction(); final OperationDialogFragment fragment = new OperationDialogFragment(); Loading @@ -88,21 +92,23 @@ public class OperationDialogFragment extends DialogFragment { } @Override public Dialog onCreateDialog(Bundle inState) { public @NonNull Dialog onCreateDialog(Bundle inState) { super.onCreate(inState); final @DialogType int dialogType = getArguments().getInt(FileOperationService.EXTRA_DIALOG_TYPE); final @OpType int operationType = getArguments().getInt(FileOperationService.EXTRA_OPERATION_TYPE); final ArrayList<Uri> uriList = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_URIS); final ArrayList<DocumentInfo> docList = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_DOCS); final List<DocumentInfo> failedDocs = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_DOCS, DocumentInfo.class); final List<Uri> failedUris = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_URIS, Uri.class); final List<String> failedPaths = getArguments().getStringArrayList( FileOperationService.EXTRA_FAILED_PATHS); final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); final String message = new MessageBuilder(getContext()).generateListMessage( dialogType, operationType, docList, uriList); dialogType, operationType, failedDocs, failedUris, failedPaths); builder.setMessage(Html.fromHtml(message)); builder.setPositiveButton( Loading Loading
Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,12 @@ java_defaults { "docsui-change-ids", "guava", "modules-utils-build_system", // Glide and dependencies. Optimized out when use_peek_preview_ro flag enabled. // See b/421076517 for more details. "androidx.exifinterface_exifinterface", "glide-disklrucache-prebuilt", "glide-gifdecoder-prebuilt", "glide-prebuilt", ], privileged: true, Loading
res/flag(com.android.documentsui.flags.use_material3)/layout/peek_layout.xml +2 −2 Original line number Diff line number Diff line Loading @@ -29,8 +29,8 @@ android:layout_width="match_parent" android:layout_height="match_parent"> <com.android.documentsui.peek.RenderView android:id="@+id/peek_preview" <FrameLayout android:id="@+id/peek_preview_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- Text and icons using android:white because the underlying black scrim doesn't Loading
res/flag(com.android.documentsui.flags.use_material3)/layout/peek_no_preview.xml +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,8 @@ See the License for the specific language governing permissions and limitations under the License. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/peek_preview_container" android:layout_width="match_parent" android:layout_height="match_parent"> Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -694,4 +694,7 @@ <!-- Text used in Peek to indicate that no preview is available. --> <string name="peek_no_preview">No preview available</string> <!-- Accessibility label for an image preview in Peek. --> <string name="a11y_peek_image_preview">Image preview of <xliff:g id="filename" example="image.png">%s</xliff:g></string> </resources>
src/com/android/documentsui/OperationDialogFragment.java +16 −10 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.text.Html; import android.widget.TextView; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.FragmentManager; Loading @@ -44,6 +45,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; /** * Alert dialog for operation dialogs. Loading @@ -68,16 +70,18 @@ public class OperationDialogFragment extends DialogFragment { public static void show( FragmentManager fm, @DialogType int dialogType, ArrayList<DocumentInfo> failedSrcList, ArrayList<Uri> uriList, ArrayList<DocumentInfo> failedDocs, ArrayList<Uri> failedUris, ArrayList<String> failedPaths, DocumentStack dstStack, @OpType int operationType) { final Bundle args = new Bundle(); args.putInt(FileOperationService.EXTRA_DIALOG_TYPE, dialogType); args.putInt(FileOperationService.EXTRA_OPERATION_TYPE, operationType); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_DOCS, failedSrcList); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_URIS, uriList); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_DOCS, failedDocs); args.putParcelableArrayList(FileOperationService.EXTRA_FAILED_URIS, failedUris); args.putStringArrayList(FileOperationService.EXTRA_FAILED_PATHS, failedPaths); final FragmentTransaction ft = fm.beginTransaction(); final OperationDialogFragment fragment = new OperationDialogFragment(); Loading @@ -88,21 +92,23 @@ public class OperationDialogFragment extends DialogFragment { } @Override public Dialog onCreateDialog(Bundle inState) { public @NonNull Dialog onCreateDialog(Bundle inState) { super.onCreate(inState); final @DialogType int dialogType = getArguments().getInt(FileOperationService.EXTRA_DIALOG_TYPE); final @OpType int operationType = getArguments().getInt(FileOperationService.EXTRA_OPERATION_TYPE); final ArrayList<Uri> uriList = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_URIS); final ArrayList<DocumentInfo> docList = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_DOCS); final List<DocumentInfo> failedDocs = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_DOCS, DocumentInfo.class); final List<Uri> failedUris = getArguments().getParcelableArrayList( FileOperationService.EXTRA_FAILED_URIS, Uri.class); final List<String> failedPaths = getArguments().getStringArrayList( FileOperationService.EXTRA_FAILED_PATHS); final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); final String message = new MessageBuilder(getContext()).generateListMessage( dialogType, operationType, docList, uriList); dialogType, operationType, failedDocs, failedUris, failedPaths); builder.setMessage(Html.fromHtml(message)); builder.setPositiveButton( Loading