Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 832cdbf3 authored by Matt Pietal's avatar Matt Pietal
Browse files

Sharesheet - Content preview polish

1. Add ripple feedback to clipboard copy even though the sharesheet
disappears really fast and you may not see it.
2. Make sure file icon is gray and not influence by the overlay.
3. Default multiple file sharing to file preview area and not image
preview area when there are mixed file types

Bug: 129979196
Test: Visual inspection
Change-Id: Ia86d418ccaca9a122f00dbc3e9c3b30785fb2abd
parent e0283ded
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -785,7 +785,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);
        }
    }

@@ -834,12 +834,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;
+24 −0
Original line number Diff line number Diff line
<!--
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>
+3 −1
Original line number Diff line number Diff line
@@ -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-->
+1 −0
Original line number Diff line number Diff line
@@ -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" />