diff options
Diffstat (limited to 'java/src')
3 files changed, 21 insertions, 8 deletions
diff --git a/java/src/com/android/intentresolver/contentpreview/FileContentPreviewUi.java b/java/src/com/android/intentresolver/contentpreview/FileContentPreviewUi.java index e43ab6d3..85f94451 100644 --- a/java/src/com/android/intentresolver/contentpreview/FileContentPreviewUi.java +++ b/java/src/com/android/intentresolver/contentpreview/FileContentPreviewUi.java @@ -96,8 +96,12 @@ class FileContentPreviewUi extends ContentPreviewUi { final ActionRow actionRow = contentPreviewLayout.findViewById(com.android.internal.R.id.chooser_action_row); - actionRow.setActions( - createActions(new ArrayList<>(), mActionFactory.createCustomActions())); + List<ActionRow.Action> actions = + createActions(new ArrayList<>(), mActionFactory.createCustomActions()); + actionRow.setActions(actions); + if (actions.isEmpty()) { + contentPreviewLayout.findViewById(R.id.actions_top_divider).setVisibility(View.GONE); + } return contentPreviewLayout; } diff --git a/java/src/com/android/intentresolver/contentpreview/FilesPlusTextContentPreviewUi.java b/java/src/com/android/intentresolver/contentpreview/FilesPlusTextContentPreviewUi.java index e15d53c4..21650ad9 100644 --- a/java/src/com/android/intentresolver/contentpreview/FilesPlusTextContentPreviewUi.java +++ b/java/src/com/android/intentresolver/contentpreview/FilesPlusTextContentPreviewUi.java @@ -98,9 +98,14 @@ class FilesPlusTextContentPreviewUi extends ContentPreviewUi { final ActionRow actionRow = contentPreviewLayout.findViewById(com.android.internal.R.id.chooser_action_row); - actionRow.setActions(createActions( + List<ActionRow.Action> actions = createActions( createImagePreviewActions(), - mActionFactory.createCustomActions())); + mActionFactory.createCustomActions()); + actionRow.setActions(actions); + + if (actions.isEmpty()) { + contentPreviewLayout.findViewById(R.id.actions_top_divider).setVisibility(View.GONE); + } if (shouldShowPreview()) { mImageLoader.loadImage(mFiles.get(0).getPreviewUri(), bitmap -> { diff --git a/java/src/com/android/intentresolver/contentpreview/UnifiedContentPreviewUi.java b/java/src/com/android/intentresolver/contentpreview/UnifiedContentPreviewUi.java index f0ffc65c..04c1664b 100644 --- a/java/src/com/android/intentresolver/contentpreview/UnifiedContentPreviewUi.java +++ b/java/src/com/android/intentresolver/contentpreview/UnifiedContentPreviewUi.java @@ -85,10 +85,14 @@ class UnifiedContentPreviewUi extends ContentPreviewUi { final ActionRow actionRow = contentPreviewLayout.findViewById(com.android.internal.R.id.chooser_action_row); - actionRow.setActions( - createActions( - createImagePreviewActions(), - mActionFactory.createCustomActions())); + List<ActionRow.Action> actions = createActions( + createImagePreviewActions(), + mActionFactory.createCustomActions()); + actionRow.setActions(actions); + if (actions.isEmpty()) { + contentPreviewLayout.findViewById(R.id.actions_top_divider).setVisibility(View.GONE); + } + if (mFiles.size() == 0) { Log.i( |