Thumbnails
classThumbnails: BaseColumns
| kotlin.Any | |
| ↳ | android.provider.MediaStore.Images.Thumbnails |
This class provides utility methods to obtain thumbnails for various Images items.
Summary
| Constants | |
|---|---|
| static String |
Path to the thumbnail file on disk. |
| static String |
The default sort order for this table |
| static Int | |
| static String |
The height of the thumbnail |
| static String |
The original image for the thumbnal |
| static String |
The kind of the thumbnail |
| static Int | |
| static Int | |
| static String |
The blob raw data of thumbnail |
| static String |
The width of the thumbnal |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| open static Unit |
cancelThumbnailRequest(cr: ContentResolver!, origId: Long)Cancel any outstanding #getThumbnail requests, causing them to return by throwing a |
| open static Unit |
cancelThumbnailRequest(cr: ContentResolver!, origId: Long, groupId: Long)Cancel any outstanding #getThumbnail requests, causing them to return by throwing a |
| open static Uri! |
getContentUri(volumeName: String!)Get the content:// style URI for the image media table on the given volume. |
| open static Size |
getKindSize(kind: Int)Return the typical |
| open static Bitmap! |
getThumbnail(cr: ContentResolver!, imageId: Long, kind: Int, options: BitmapFactory.Options!)Return thumbnail representing a specific image item. |
| open static Bitmap! |
getThumbnail(cr: ContentResolver!, imageId: Long, groupId: Long, kind: Int, options: BitmapFactory.Options!)Return thumbnail representing a specific image item. |
| static Cursor! |
query(cr: ContentResolver!, uri: Uri!, projection: Array<String!>!) |
| static Cursor! |
queryMiniThumbnail(cr: ContentResolver!, origId: Long, kind: Int, projection: Array<String!>!) |
| static Cursor! |
queryMiniThumbnails(cr: ContentResolver!, uri: Uri!, kind: Int, projection: Array<String!>!) |
| Properties | |
|---|---|
| static Uri! |
The content:// style URI for the "primary" external storage volume. |
| static Uri! |
The content:// style URI for the internal storage. |
Constants
DATA
static valDATA: String
Deprecated: Deprecated in Java.
Path to the thumbnail file on disk. As of android.os.Build.VERSION_CODES#Q, this thumbnail has correct rotation, don't need to rotate it again.
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_STRING .
Value: "_data"DEFAULT_SORT_ORDER
static valDEFAULT_SORT_ORDER: String
Deprecated: Deprecated in Java.
The default sort order for this table
Value: "image_id ASC"FULL_SCREEN_KIND
static valFULL_SCREEN_KIND: Int
Deprecated: Deprecated in Java.
Value: 2HEIGHT
static valHEIGHT: String
Deprecated: Deprecated in Java.
The height of the thumbnail
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.
Value: "height"IMAGE_ID
static valIMAGE_ID: String
Deprecated: Deprecated in Java.
The original image for the thumbnal
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .
Value: "image_id"KIND
static valKIND: String
Deprecated: Deprecated in Java.
The kind of the thumbnail
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER .
Value: "kind"THUMB_DATA
static valTHUMB_DATA: String
Deprecated: this column never existed internally, and could never have returned valid data.
The blob raw data of thumbnail
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_BLOB .
Value: "thumb_data"WIDTH
static valWIDTH: String
Deprecated: Deprecated in Java.
The width of the thumbnal
This constant represents a column name that can be used with a android.content.ContentProvider through a android.content.ContentValues or android.database.Cursor object. The values stored in this column are Cursor#FIELD_TYPE_INTEGER , and are read-only and cannot be mutated.
Value: "width"Public constructors
Public methods
cancelThumbnailRequest
open static funcancelThumbnailRequest(
cr: ContentResolver!,
origId: Long
): Unit
Deprecated: Callers should migrate to using ContentResolver.loadThumbnail, since it offers richer control over requested thumbnail sizes and cancellation behavior.
Cancel any outstanding #getThumbnail requests, causing them to return by throwing a OperationCanceledException.
This method has no effect on ContentResolver.loadThumbnail calls, since they provide their own CancellationSignal.
cancelThumbnailRequest
open static funcancelThumbnailRequest(
cr: ContentResolver!,
origId: Long,
groupId: Long
): Unit
Deprecated: Callers should migrate to using ContentResolver.loadThumbnail, since it offers richer control over requested thumbnail sizes and cancellation behavior.
Cancel any outstanding #getThumbnail requests, causing them to return by throwing a OperationCanceledException.
This method has no effect on ContentResolver.loadThumbnail calls, since they provide their own CancellationSignal.
getContentUri
open static fungetContentUri(volumeName: String!): Uri!
Deprecated: Deprecated in Java.
Get the content:// style URI for the image media table on the given volume.
| Parameters | |
|---|---|
volumeName |
String!: the name of the volume to get the URI for |
| Return | |
|---|---|
Uri! |
the URI to the image media table on the given volume |
getKindSize
open static fungetKindSize(kind: Int): Size
Deprecated: Callers should migrate to using ContentResolver.loadThumbnail, since it offers richer control over requested thumbnail sizes and cancellation behavior.
Return the typical Size (in pixels) used internally when the given thumbnail kind is requested.
| Return | |
|---|---|
Size |
This value cannot be null. |
getThumbnail
open static fungetThumbnail(
cr: ContentResolver!,
imageId: Long,
kind: Int,
options: BitmapFactory.Options!
): Bitmap!
Deprecated: Callers should migrate to using ContentResolver.loadThumbnail, since it offers richer control over requested thumbnail sizes and cancellation behavior.
Return thumbnail representing a specific image item. If a thumbnail doesn't exist, this method will block until it's generated. Callers are responsible for their own in-memory caching of returned values. As of android.os.Build.VERSION_CODES#Q, this output of the thumbnail has correct rotation, don't need to rotate it again.
| Parameters | |
|---|---|
imageId |
Long: the image item to obtain a thumbnail for. |
kind |
Int: optimal thumbnail size desired. |
| Return | |
|---|---|
Bitmap! |
decoded thumbnail, or null if problem was encountered. |
getThumbnail
open static fungetThumbnail(
cr: ContentResolver!,
imageId: Long,
groupId: Long,
kind: Int,
options: BitmapFactory.Options!
): Bitmap!
Deprecated: Callers should migrate to using ContentResolver.loadThumbnail, since it offers richer control over requested thumbnail sizes and cancellation behavior.
Return thumbnail representing a specific image item. If a thumbnail doesn't exist, this method will block until it's generated. Callers are responsible for their own in-memory caching of returned values. As of android.os.Build.VERSION_CODES#Q, this output of the thumbnail has correct rotation, don't need to rotate it again.
| Parameters | |
|---|---|
imageId |
Long: the image item to obtain a thumbnail for. |
kind |
Int: optimal thumbnail size desired. |
| Return | |
|---|---|
Bitmap! |
decoded thumbnail, or null if problem was encountered. |
query
static funquery(
cr: ContentResolver!,
uri: Uri!,
projection: Array<String!>!
): Cursor!
Deprecated: all queries should be performed through ContentResolver directly, which offers modern features like CancellationSignal.
queryMiniThumbnail
static funqueryMiniThumbnail(
cr: ContentResolver!,
origId: Long,
kind: Int,
projection: Array<String!>!
): Cursor!
Deprecated: all queries should be performed through ContentResolver directly, which offers modern features like CancellationSignal.
queryMiniThumbnails
static funqueryMiniThumbnails(
cr: ContentResolver!,
uri: Uri!,
kind: Int,
projection: Array<String!>!
): Cursor!
Deprecated: all queries should be performed through ContentResolver directly, which offers modern features like CancellationSignal.
Properties
EXTERNAL_CONTENT_URI
static valEXTERNAL_CONTENT_URI: Uri!
Deprecated: Deprecated in Java.
The content:// style URI for the "primary" external storage volume.
INTERNAL_CONTENT_URI
static valINTERNAL_CONTENT_URI: Uri!
Deprecated: Deprecated in Java.
The content:// style URI for the internal storage.