format
This commit is contained in:
parent
f18befe486
commit
175318058b
5 changed files with 247 additions and 241 deletions
|
@ -84,16 +84,20 @@ class MainActivity : FlutterActivity() {
|
||||||
val search = ShortcutInfoCompat.Builder(this, "search")
|
val search = ShortcutInfoCompat.Builder(this, "search")
|
||||||
.setShortLabel(getString(R.string.search_shortcut_short_label))
|
.setShortLabel(getString(R.string.search_shortcut_short_label))
|
||||||
.setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_search))
|
.setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_search))
|
||||||
.setIntent(Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
.setIntent(
|
||||||
.putExtra("page", "/search"))
|
Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
||||||
|
.putExtra("page", "/search")
|
||||||
|
)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val videos = ShortcutInfoCompat.Builder(this, "videos")
|
val videos = ShortcutInfoCompat.Builder(this, "videos")
|
||||||
.setShortLabel(getString(R.string.videos_shortcut_short_label))
|
.setShortLabel(getString(R.string.videos_shortcut_short_label))
|
||||||
.setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_movie))
|
.setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_movie))
|
||||||
.setIntent(Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
.setIntent(
|
||||||
|
Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
||||||
.putExtra("page", "/collection")
|
.putExtra("page", "/collection")
|
||||||
.putExtra("filters", arrayOf("{\"type\":\"mime\",\"mime\":\"video/*\"}")))
|
.putExtra("filters", arrayOf("{\"type\":\"mime\",\"mime\":\"video/*\"}"))
|
||||||
|
)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
ShortcutManagerCompat.setDynamicShortcuts(this, listOf(videos, search))
|
ShortcutManagerCompat.setDynamicShortcuts(this, listOf(videos, search))
|
||||||
|
|
|
@ -42,7 +42,8 @@ object MediaMetadataRetrieverHelper {
|
||||||
MediaMetadataRetriever.METADATA_KEY_YEAR to "Year",
|
MediaMetadataRetriever.METADATA_KEY_YEAR to "Year",
|
||||||
).apply {
|
).apply {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
putAll(hashMapOf(
|
putAll(
|
||||||
|
hashMapOf(
|
||||||
MediaMetadataRetriever.METADATA_KEY_HAS_IMAGE to "Has Image",
|
MediaMetadataRetriever.METADATA_KEY_HAS_IMAGE to "Has Image",
|
||||||
MediaMetadataRetriever.METADATA_KEY_IMAGE_COUNT to "Image Count",
|
MediaMetadataRetriever.METADATA_KEY_IMAGE_COUNT to "Image Count",
|
||||||
MediaMetadataRetriever.METADATA_KEY_IMAGE_HEIGHT to "Image Height",
|
MediaMetadataRetriever.METADATA_KEY_IMAGE_HEIGHT to "Image Height",
|
||||||
|
@ -50,7 +51,8 @@ object MediaMetadataRetrieverHelper {
|
||||||
MediaMetadataRetriever.METADATA_KEY_IMAGE_ROTATION to "Image Rotation",
|
MediaMetadataRetriever.METADATA_KEY_IMAGE_ROTATION to "Image Rotation",
|
||||||
MediaMetadataRetriever.METADATA_KEY_IMAGE_WIDTH to "Image Width",
|
MediaMetadataRetriever.METADATA_KEY_IMAGE_WIDTH to "Image Width",
|
||||||
MediaMetadataRetriever.METADATA_KEY_VIDEO_FRAME_COUNT to "Video Frame Count",
|
MediaMetadataRetriever.METADATA_KEY_VIDEO_FRAME_COUNT to "Video Frame Count",
|
||||||
))
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue