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

Commit af4d039f authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "More UX work for thumbnails, search, management." into klp-dev

parents dc6fd0a2 4ec97392
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -459,6 +459,7 @@ public final class DocumentsContract {
    private static final String PATH_SEARCH = "search";

    private static final String PARAM_QUERY = "query";
    private static final String PARAM_MANAGE = "manage";

    /**
     * Build Uri representing the roots of a document provider. When queried, a
@@ -583,6 +584,16 @@ public final class DocumentsContract {
        return searchDocumentsUri.getQueryParameter(PARAM_QUERY);
    }

    /** {@hide} */
    public static Uri setManageMode(Uri uri) {
        return uri.buildUpon().appendQueryParameter(PARAM_MANAGE, "true").build();
    }

    /** {@hide} */
    public static boolean isManageMode(Uri uri) {
        return uri.getBooleanQueryParameter(PARAM_MANAGE, false);
    }

    /**
     * Return list of all documents that the calling package has "open." These
     * are Uris matching {@link DocumentsContract} to which persistent
+14 −1
Original line number Diff line number Diff line
@@ -167,6 +167,14 @@ public abstract class DocumentsProvider extends ContentProvider {
            String parentDocumentId, String[] projection, String sortOrder)
            throws FileNotFoundException;

    /** {@hide} */
    @SuppressWarnings("unused")
    public Cursor queryChildDocumentsForManage(
            String parentDocumentId, String[] projection, String sortOrder)
            throws FileNotFoundException {
        throw new UnsupportedOperationException("Manage not supported");
    }

    /**
     * Return documents that that match the given query, starting the search at
     * the given directory.
@@ -262,7 +270,12 @@ public abstract class DocumentsProvider extends ContentProvider {
                case MATCH_DOCUMENT:
                    return queryDocument(getDocumentId(uri), projection);
                case MATCH_CHILDREN:
                    if (DocumentsContract.isManageMode(uri)) {
                        return queryChildDocumentsForManage(
                                getDocumentId(uri), projection, sortOrder);
                    } else {
                        return queryChildDocuments(getDocumentId(uri), projection, sortOrder);
                    }
                case MATCH_SEARCH:
                    return querySearchDocuments(
                            getDocumentId(uri), getSearchDocumentsQuery(uri), projection);
+18 −4
Original line number Diff line number Diff line
@@ -32,13 +32,27 @@
            android:layout_weight="1"
            android:background="#fff">

            <ImageView
            <FrameLayout
                android:id="@android:id/icon"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <ImageView
                    android:id="@+id/icon_mime"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:scaleType="centerInside"
                    android:contentDescription="@null" />

                <ImageView
                    android:id="@+id/icon_thumb"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:scaleType="centerCrop"
                    android:contentDescription="@null" />

            </FrameLayout>

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
+18 −4
Original line number Diff line number Diff line
@@ -25,16 +25,30 @@
    android:paddingBottom="8dip"
    android:orientation="horizontal">

    <ImageView
    <FrameLayout
        android:id="@android:id/icon"
        android:layout_width="@dimen/icon_size"
        android:layout_height="@dimen/icon_size"
        android:layout_marginStart="12dp"
        android:layout_marginEnd="20dp"
        android:layout_gravity="center_vertical"
        android:layout_gravity="center_vertical">

        <ImageView
            android:id="@+id/icon_mime"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerInside"
            android:contentDescription="@null" />

        <ImageView
            android:id="@+id/icon_thumb"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:contentDescription="@null" />

    </FrameLayout>

    <LinearLayout
        android:layout_width="0dip"
        android:layout_height="wrap_content"
+10 −3
Original line number Diff line number Diff line
@@ -14,6 +14,13 @@
     limitations under the License.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="12dp">

    <TextView
        android:id="@android:id/title"
        style="?android:attr/listSeparatorTextViewStyle" />

</FrameLayout>
Loading