Merge "Sharesheet - Content preview polish" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-05 19:36:23 +00:00
committed by Android (Google) Code Review
4 changed files with 34 additions and 5 deletions

View File

@@ -788,7 +788,7 @@ public class ChooserActivity extends ResolverActivity {
} else {
ImageView fileIconView = parent.findViewById(R.id.content_preview_file_icon);
fileIconView.setVisibility(View.VISIBLE);
fileIconView.setImageResource(R.drawable.ic_doc_generic);
fileIconView.setImageResource(R.drawable.chooser_file_generic);
}
}
@@ -837,12 +837,14 @@ public class ChooserActivity extends ResolverActivity {
}
for (Uri uri : uris) {
if (findPreferredContentPreview(uri, resolver) == CONTENT_PREVIEW_IMAGE) {
return CONTENT_PREVIEW_IMAGE;
// Defaulting to file preview when there are mixed image/file types is
// preferable, as it shows the user the correct number of items being shared
if (findPreferredContentPreview(uri, resolver) == CONTENT_PREVIEW_FILE) {
return CONTENT_PREVIEW_FILE;
}
}
return CONTENT_PREVIEW_FILE;
return CONTENT_PREVIEW_IMAGE;
}
return CONTENT_PREVIEW_TEXT;

View File

@@ -0,0 +1,24 @@
<!--
Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF737373"
android:pathData="M6 2c-1.1 0,-1.99.9,-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2,-.9 2,-2V8l-6,-6H6zm7 7V3.5L18.5 9H13z"/>
</vector>

View File

@@ -51,7 +51,9 @@
android:layout_height="24dp"
android:gravity="center"
android:layout_gravity="center_vertical"
android:background="@drawable/ic_content_copy_gm2"/>
android:foreground="@drawable/ic_content_copy_gm2"
android:clickable="true"
android:background="?attr/selectableItemBackgroundBorderless"/>
</LinearLayout>
<!-- Required sub-layout so we can get the nice rounded corners-->

View File

@@ -3477,6 +3477,7 @@
<java-symbol type="layout" name="shutdown_dialog" />
<java-symbol type="dimen" name="chooser_service_spacing" />
<java-symbol type="bool" name="config_showSysuiShutdown" />
<java-symbol type="drawable" name="chooser_file_generic" />
<java-symbol type="layout" name="notification_template_messaging_text_message" />
<java-symbol type="layout" name="notification_template_messaging_image_message" />