Loading core/java/android/provider/DocumentsContract.java +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading core/java/android/provider/DocumentsProvider.java +14 −1 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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); Loading packages/DocumentsUI/res/layout/item_doc_grid.xml +18 −4 Original line number Diff line number Diff line Loading @@ -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" Loading packages/DocumentsUI/res/layout/item_doc_list.xml +18 −4 Original line number Diff line number Diff line Loading @@ -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" Loading packages/DocumentsUI/res/layout/item_root_header.xml +10 −3 Original line number Diff line number Diff line Loading @@ -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
core/java/android/provider/DocumentsContract.java +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading
core/java/android/provider/DocumentsProvider.java +14 −1 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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); Loading
packages/DocumentsUI/res/layout/item_doc_grid.xml +18 −4 Original line number Diff line number Diff line Loading @@ -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" Loading
packages/DocumentsUI/res/layout/item_doc_list.xml +18 −4 Original line number Diff line number Diff line Loading @@ -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" Loading
packages/DocumentsUI/res/layout/item_root_header.xml +10 −3 Original line number Diff line number Diff line Loading @@ -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>