This commit is contained in:
Thibault Deckers 2020-10-19 17:36:48 +09:00
parent f18befe486
commit 175318058b
5 changed files with 247 additions and 241 deletions

View file

@ -84,16 +84,20 @@ class MainActivity : FlutterActivity() {
val search = ShortcutInfoCompat.Builder(this, "search")
.setShortLabel(getString(R.string.search_shortcut_short_label))
.setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_search))
.setIntent(Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
.putExtra("page", "/search"))
.setIntent(
Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
.putExtra("page", "/search")
)
.build()
val videos = ShortcutInfoCompat.Builder(this, "videos")
.setShortLabel(getString(R.string.videos_shortcut_short_label))
.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("filters", arrayOf("{\"type\":\"mime\",\"mime\":\"video/*\"}")))
.putExtra("filters", arrayOf("{\"type\":\"mime\",\"mime\":\"video/*\"}"))
)
.build()
ShortcutManagerCompat.setDynamicShortcuts(this, listOf(videos, search))

View file

@ -42,7 +42,8 @@ object MediaMetadataRetrieverHelper {
MediaMetadataRetriever.METADATA_KEY_YEAR to "Year",
).apply {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
putAll(hashMapOf(
putAll(
hashMapOf(
MediaMetadataRetriever.METADATA_KEY_HAS_IMAGE to "Has Image",
MediaMetadataRetriever.METADATA_KEY_IMAGE_COUNT to "Image Count",
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_WIDTH to "Image Width",
MediaMetadataRetriever.METADATA_KEY_VIDEO_FRAME_COUNT to "Video Frame Count",
))
)
)
}
}