shortcuts: added static support on API 25, added pin support on API <26, improved icons
This commit is contained in:
parent
d7e14cd84b
commit
e5ea5ed374
28 changed files with 305 additions and 57 deletions
|
@ -30,6 +30,9 @@
|
||||||
<!-- TODO TLAD remove this permission when this is fixed: https://github.com/flutter/flutter/issues/42451 -->
|
<!-- TODO TLAD remove this permission when this is fixed: https://github.com/flutter/flutter/issues/42451 -->
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
|
||||||
|
<!-- for API < 26 -->
|
||||||
|
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
||||||
|
|
||||||
<!-- from Android R, we should define <queries> to make other apps visible to this app -->
|
<!-- from Android R, we should define <queries> to make other apps visible to this app -->
|
||||||
<queries>
|
<queries>
|
||||||
<intent>
|
<intent>
|
||||||
|
|
|
@ -119,7 +119,9 @@ class MainActivity : FlutterActivity() {
|
||||||
when (requestCode) {
|
when (requestCode) {
|
||||||
DOCUMENT_TREE_ACCESS_REQUEST -> onDocumentTreeAccessResult(data, resultCode, requestCode)
|
DOCUMENT_TREE_ACCESS_REQUEST -> onDocumentTreeAccessResult(data, resultCode, requestCode)
|
||||||
DELETE_PERMISSION_REQUEST -> onDeletePermissionResult(resultCode)
|
DELETE_PERMISSION_REQUEST -> onDeletePermissionResult(resultCode)
|
||||||
CREATE_FILE_REQUEST, OPEN_FILE_REQUEST, SELECT_DIRECTORY_REQUEST -> onPermissionResult(requestCode, data?.data)
|
CREATE_FILE_REQUEST,
|
||||||
|
OPEN_FILE_REQUEST,
|
||||||
|
SELECT_DIRECTORY_REQUEST -> onStorageAccessResult(requestCode, data?.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +129,7 @@ class MainActivity : FlutterActivity() {
|
||||||
private fun onDocumentTreeAccessResult(data: Intent?, resultCode: Int, requestCode: Int) {
|
private fun onDocumentTreeAccessResult(data: Intent?, resultCode: Int, requestCode: Int) {
|
||||||
val treeUri = data?.data
|
val treeUri = data?.data
|
||||||
if (resultCode != RESULT_OK || treeUri == null) {
|
if (resultCode != RESULT_OK || treeUri == null) {
|
||||||
onPermissionResult(requestCode, null)
|
onStorageAccessResult(requestCode, null)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +140,7 @@ class MainActivity : FlutterActivity() {
|
||||||
contentResolver.takePersistableUriPermission(treeUri, takeFlags)
|
contentResolver.takePersistableUriPermission(treeUri, takeFlags)
|
||||||
|
|
||||||
// resume pending action
|
// resume pending action
|
||||||
onPermissionResult(requestCode, treeUri)
|
onStorageAccessResult(requestCode, treeUri)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onDeletePermissionResult(resultCode: Int) {
|
private fun onDeletePermissionResult(resultCode: Int) {
|
||||||
|
@ -152,9 +154,17 @@ class MainActivity : FlutterActivity() {
|
||||||
when (intent?.action) {
|
when (intent?.action) {
|
||||||
Intent.ACTION_MAIN -> {
|
Intent.ACTION_MAIN -> {
|
||||||
intent.getStringExtra("page")?.let { page ->
|
intent.getStringExtra("page")?.let { page ->
|
||||||
|
var filters = intent.getStringArrayExtra("filters")?.toList()
|
||||||
|
if (filters == null) {
|
||||||
|
// fallback for shortcuts created on API < 26
|
||||||
|
val filterString = intent.getStringExtra("filtersString")
|
||||||
|
if (filterString != null) {
|
||||||
|
filters = filterString.split(EXTRA_STRING_ARRAY_SEPARATOR)
|
||||||
|
}
|
||||||
|
}
|
||||||
return hashMapOf(
|
return hashMapOf(
|
||||||
"page" to page,
|
"page" to page,
|
||||||
"filters" to intent.getStringArrayExtra("filters")?.toList(),
|
"filters" to filters,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,9 +219,13 @@ class MainActivity : FlutterActivity() {
|
||||||
private fun setupShortcuts() {
|
private fun setupShortcuts() {
|
||||||
// do not use 'route' as extra key, as the Flutter framework acts on it
|
// do not use 'route' as extra key, as the Flutter framework acts on it
|
||||||
|
|
||||||
|
// shortcut adaptive icons are placed in `mipmap`, not `drawable`,
|
||||||
|
// so that foreground is rendered at the intended scale
|
||||||
|
val supportAdaptiveIcon = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||||
|
|
||||||
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, if (supportAdaptiveIcon) R.mipmap.ic_shortcut_search else R.drawable.ic_shortcut_search))
|
||||||
.setIntent(
|
.setIntent(
|
||||||
Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
||||||
.putExtra("page", "/search")
|
.putExtra("page", "/search")
|
||||||
|
@ -220,7 +234,7 @@ class MainActivity : FlutterActivity() {
|
||||||
|
|
||||||
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, if (supportAdaptiveIcon) R.mipmap.ic_shortcut_movie else R.drawable.ic_shortcut_movie))
|
||||||
.setIntent(
|
.setIntent(
|
||||||
Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java)
|
||||||
.putExtra("page", "/collection")
|
.putExtra("page", "/collection")
|
||||||
|
@ -234,18 +248,19 @@ class MainActivity : FlutterActivity() {
|
||||||
companion object {
|
companion object {
|
||||||
private val LOG_TAG = LogUtils.createTag<MainActivity>()
|
private val LOG_TAG = LogUtils.createTag<MainActivity>()
|
||||||
const val VIEWER_CHANNEL = "deckers.thibault/aves/viewer"
|
const val VIEWER_CHANNEL = "deckers.thibault/aves/viewer"
|
||||||
|
const val EXTRA_STRING_ARRAY_SEPARATOR = "###"
|
||||||
const val DOCUMENT_TREE_ACCESS_REQUEST = 1
|
const val DOCUMENT_TREE_ACCESS_REQUEST = 1
|
||||||
const val DELETE_PERMISSION_REQUEST = 2
|
const val DELETE_PERMISSION_REQUEST = 2
|
||||||
const val CREATE_FILE_REQUEST = 3
|
const val CREATE_FILE_REQUEST = 3
|
||||||
const val OPEN_FILE_REQUEST = 4
|
const val OPEN_FILE_REQUEST = 4
|
||||||
const val SELECT_DIRECTORY_REQUEST = 5
|
const val SELECT_DIRECTORY_REQUEST = 5
|
||||||
|
|
||||||
// permission request code to pending runnable
|
// request code to pending runnable
|
||||||
val pendingResultHandlers = ConcurrentHashMap<Int, PendingResultHandler>()
|
val pendingStorageAccessResultHandlers = ConcurrentHashMap<Int, PendingStorageAccessResultHandler>()
|
||||||
|
|
||||||
fun onPermissionResult(requestCode: Int, uri: Uri?) {
|
private fun onStorageAccessResult(requestCode: Int, uri: Uri?) {
|
||||||
Log.d(LOG_TAG, "onPermissionResult with requestCode=$requestCode, uri=$uri")
|
Log.d(LOG_TAG, "onStorageAccessResult with requestCode=$requestCode, uri=$uri")
|
||||||
val handler = pendingResultHandlers.remove(requestCode) ?: return
|
val handler = pendingStorageAccessResultHandlers.remove(requestCode) ?: return
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
handler.onGranted(uri)
|
handler.onGranted(uri)
|
||||||
} else {
|
} else {
|
||||||
|
@ -261,4 +276,4 @@ class MainActivity : FlutterActivity() {
|
||||||
|
|
||||||
// onGranted: user selected a directory/file (with no guarantee that it matches the requested `path`)
|
// onGranted: user selected a directory/file (with no guarantee that it matches the requested `path`)
|
||||||
// onDenied: user cancelled
|
// onDenied: user cancelled
|
||||||
data class PendingResultHandler(val path: String?, val onGranted: (uri: Uri) -> Unit, val onDenied: () -> Unit)
|
data class PendingStorageAccessResultHandler(val path: String?, val onGranted: (uri: Uri) -> Unit, val onDenied: () -> Unit)
|
||||||
|
|
|
@ -46,8 +46,12 @@ class SearchSuggestionsProvider : MethodChannel.MethodCallHandler, ContentProvid
|
||||||
|
|
||||||
val matrixCursor = MatrixCursor(columns)
|
val matrixCursor = MatrixCursor(columns)
|
||||||
context?.let { context ->
|
context?.let { context ->
|
||||||
|
// shortcut adaptive icons are placed in `mipmap`, not `drawable`,
|
||||||
|
// so that foreground is rendered at the intended scale
|
||||||
|
val supportAdaptiveIcon = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||||
|
|
||||||
val searchShortcutTitle = "${context.resources.getString(R.string.search_shortcut_short_label)} $query"
|
val searchShortcutTitle = "${context.resources.getString(R.string.search_shortcut_short_label)} $query"
|
||||||
val searchShortcutIcon = context.resourceUri(R.mipmap.ic_shortcut_search)
|
val searchShortcutIcon = context.resourceUri(if (supportAdaptiveIcon) R.mipmap.ic_shortcut_search else R.drawable.ic_shortcut_search)
|
||||||
matrixCursor.addRow(arrayOf(null, null, null, searchShortcutTitle, null, searchShortcutIcon))
|
matrixCursor.addRow(arrayOf(null, null, null, searchShortcutTitle, null, searchShortcutIcon))
|
||||||
|
|
||||||
runBlocking {
|
runBlocking {
|
||||||
|
|
|
@ -3,6 +3,7 @@ package deckers.thibault.aves.channel.calls
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.BitmapFactory
|
import android.graphics.BitmapFactory
|
||||||
|
import android.os.Build
|
||||||
import androidx.core.content.pm.ShortcutInfoCompat
|
import androidx.core.content.pm.ShortcutInfoCompat
|
||||||
import androidx.core.content.pm.ShortcutManagerCompat
|
import androidx.core.content.pm.ShortcutManagerCompat
|
||||||
import androidx.core.graphics.drawable.IconCompat
|
import androidx.core.graphics.drawable.IconCompat
|
||||||
|
@ -52,16 +53,24 @@ class AppShortcutHandler(private val context: Context) : MethodCallHandler {
|
||||||
var bitmap = BitmapFactory.decodeByteArray(iconBytes, 0, iconBytes.size)
|
var bitmap = BitmapFactory.decodeByteArray(iconBytes, 0, iconBytes.size)
|
||||||
bitmap = centerSquareCrop(context, bitmap, 256)
|
bitmap = centerSquareCrop(context, bitmap, 256)
|
||||||
if (bitmap != null) {
|
if (bitmap != null) {
|
||||||
icon = IconCompat.createWithBitmap(bitmap)
|
// adaptive, so the bitmap is used as background and covers the whole icon
|
||||||
|
icon = IconCompat.createWithAdaptiveBitmap(bitmap)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (icon == null) {
|
if (icon == null) {
|
||||||
icon = IconCompat.createWithResource(context, R.mipmap.ic_shortcut_collection)
|
// shortcut adaptive icons are placed in `mipmap`, not `drawable`,
|
||||||
|
// so that foreground is rendered at the intended scale
|
||||||
|
val supportAdaptiveIcon = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
|
||||||
|
|
||||||
|
icon = IconCompat.createWithResource(context, if (supportAdaptiveIcon) R.mipmap.ic_shortcut_collection else R.drawable.ic_shortcut_collection)
|
||||||
}
|
}
|
||||||
|
|
||||||
val intent = Intent(Intent.ACTION_MAIN, null, context, MainActivity::class.java)
|
val intent = Intent(Intent.ACTION_MAIN, null, context, MainActivity::class.java)
|
||||||
.putExtra("page", "/collection")
|
.putExtra("page", "/collection")
|
||||||
.putExtra("filters", filters.toTypedArray())
|
.putExtra("filters", filters.toTypedArray())
|
||||||
|
// on API 25, `String[]` or `ArrayList` extras are null when using the shortcut
|
||||||
|
// so we use a joined `String` as fallback
|
||||||
|
.putExtra("filtersString", filters.joinToString(MainActivity.EXTRA_STRING_ARRAY_SEPARATOR))
|
||||||
|
|
||||||
// multiple shortcuts sharing the same ID cannot be created with different labels or icons
|
// multiple shortcuts sharing the same ID cannot be created with different labels or icons
|
||||||
// so we provide a unique ID for each one, and let the user manage duplicates (i.e. same filter set), if any
|
// so we provide a unique ID for each one, and let the user manage duplicates (i.e. same filter set), if any
|
||||||
|
|
|
@ -7,7 +7,7 @@ import android.os.Handler
|
||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import deckers.thibault.aves.MainActivity
|
import deckers.thibault.aves.MainActivity
|
||||||
import deckers.thibault.aves.PendingResultHandler
|
import deckers.thibault.aves.PendingStorageAccessResultHandler
|
||||||
import deckers.thibault.aves.utils.LogUtils
|
import deckers.thibault.aves.utils.LogUtils
|
||||||
import deckers.thibault.aves.utils.PermissionManager
|
import deckers.thibault.aves.utils.PermissionManager
|
||||||
import deckers.thibault.aves.utils.StorageUtils
|
import deckers.thibault.aves.utils.StorageUtils
|
||||||
|
@ -82,7 +82,7 @@ class StorageAccessStreamHandler(private val activity: Activity, arguments: Any?
|
||||||
type = mimeType
|
type = mimeType
|
||||||
putExtra(Intent.EXTRA_TITLE, name)
|
putExtra(Intent.EXTRA_TITLE, name)
|
||||||
}
|
}
|
||||||
MainActivity.pendingResultHandlers[MainActivity.CREATE_FILE_REQUEST] = PendingResultHandler(null, { uri ->
|
MainActivity.pendingStorageAccessResultHandlers[MainActivity.CREATE_FILE_REQUEST] = PendingStorageAccessResultHandler(null, { uri ->
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
activity.contentResolver.openOutputStream(uri)?.use { output ->
|
activity.contentResolver.openOutputStream(uri)?.use { output ->
|
||||||
|
@ -116,7 +116,7 @@ class StorageAccessStreamHandler(private val activity: Activity, arguments: Any?
|
||||||
addCategory(Intent.CATEGORY_OPENABLE)
|
addCategory(Intent.CATEGORY_OPENABLE)
|
||||||
type = mimeType
|
type = mimeType
|
||||||
}
|
}
|
||||||
MainActivity.pendingResultHandlers[MainActivity.OPEN_FILE_REQUEST] = PendingResultHandler(null, { uri ->
|
MainActivity.pendingStorageAccessResultHandlers[MainActivity.OPEN_FILE_REQUEST] = PendingStorageAccessResultHandler(null, { uri ->
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
activity.contentResolver.openInputStream(uri)?.use { input ->
|
activity.contentResolver.openInputStream(uri)?.use { input ->
|
||||||
val buffer = ByteArray(BUFFER_SIZE)
|
val buffer = ByteArray(BUFFER_SIZE)
|
||||||
|
@ -138,7 +138,7 @@ class StorageAccessStreamHandler(private val activity: Activity, arguments: Any?
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
|
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
|
||||||
|
|
||||||
MainActivity.pendingResultHandlers[MainActivity.SELECT_DIRECTORY_REQUEST] = PendingResultHandler(null, { uri ->
|
MainActivity.pendingStorageAccessResultHandlers[MainActivity.SELECT_DIRECTORY_REQUEST] = PendingStorageAccessResultHandler(null, { uri ->
|
||||||
success(StorageUtils.convertTreeUriToDirPath(activity, uri))
|
success(StorageUtils.convertTreeUriToDirPath(activity, uri))
|
||||||
endOfStream()
|
endOfStream()
|
||||||
}, {
|
}, {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import android.os.storage.StorageManager
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import deckers.thibault.aves.MainActivity
|
import deckers.thibault.aves.MainActivity
|
||||||
import deckers.thibault.aves.PendingResultHandler
|
import deckers.thibault.aves.PendingStorageAccessResultHandler
|
||||||
import deckers.thibault.aves.utils.StorageUtils.PathSegments
|
import deckers.thibault.aves.utils.StorageUtils.PathSegments
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
@ -35,7 +35,7 @@ object PermissionManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intent.resolveActivity(activity.packageManager) != null) {
|
if (intent.resolveActivity(activity.packageManager) != null) {
|
||||||
MainActivity.pendingResultHandlers[MainActivity.DOCUMENT_TREE_ACCESS_REQUEST] = PendingResultHandler(path, onGranted, onDenied)
|
MainActivity.pendingStorageAccessResultHandlers[MainActivity.DOCUMENT_TREE_ACCESS_REQUEST] = PendingStorageAccessResultHandler(path, onGranted, onDenied)
|
||||||
activity.startActivityForResult(intent, MainActivity.DOCUMENT_TREE_ACCESS_REQUEST)
|
activity.startActivityForResult(intent, MainActivity.DOCUMENT_TREE_ACCESS_REQUEST)
|
||||||
} else {
|
} else {
|
||||||
Log.e(LOG_TAG, "failed to resolve activity for intent=$intent")
|
Log.e(LOG_TAG, "failed to resolve activity for intent=$intent")
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="48dp"
|
||||||
|
android:height="48dp"
|
||||||
|
android:viewportWidth="48"
|
||||||
|
android:viewportHeight="48">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_background"
|
||||||
|
android:pathData="M0,24 A1,1 0 1,1 48,24 A1,1 0 1,1 0,24" />
|
||||||
|
<group
|
||||||
|
android:translateX="12"
|
||||||
|
android:translateY="12">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_foreground"
|
||||||
|
android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="48dp"
|
||||||
|
android:height="48dp"
|
||||||
|
android:viewportWidth="48"
|
||||||
|
android:viewportHeight="48">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_background"
|
||||||
|
android:pathData="M0,24 A1,1 0 1,1 48,24 A1,1 0 1,1 0,24" />
|
||||||
|
<group
|
||||||
|
android:translateX="12"
|
||||||
|
android:translateY="12">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_foreground"
|
||||||
|
android:pathData="M4,6.47L5.76,10H20v8H4V6.47M22,4h-4l2,4h-3l-2,-4h-2l2,4h-3l-2,-4H8l2,4H7L5,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="48dp"
|
||||||
|
android:height="48dp"
|
||||||
|
android:viewportWidth="48"
|
||||||
|
android:viewportHeight="48">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_background"
|
||||||
|
android:pathData="M0,24 A1,1 0 1,1 48,24 A1,1 0 1,1 0,24" />
|
||||||
|
<group
|
||||||
|
android:translateX="12"
|
||||||
|
android:translateY="12">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_foreground"
|
||||||
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -1,15 +1,16 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="108dp"
|
android:width="108dp"
|
||||||
android:height="108dp"
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
android:viewportWidth="108"
|
android:viewportWidth="108"
|
||||||
android:viewportHeight="108"
|
android:viewportHeight="108">
|
||||||
android:tint="#455A64">
|
<group
|
||||||
<group android:scaleX="1.7226"
|
android:scaleX="1.7226"
|
||||||
android:scaleY="1.7226"
|
android:scaleY="1.7226"
|
||||||
android:translateX="33.3288"
|
android:translateX="33.3288"
|
||||||
android:translateY="33.3288">
|
android:translateY="33.3288">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@android:color/white"
|
android:fillColor="@android:color/white"
|
||||||
android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z"/>
|
android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z" />
|
||||||
</group>
|
</group>
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="108dp"
|
android:width="108dp"
|
||||||
android:height="108dp"
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
android:viewportWidth="108"
|
android:viewportWidth="108"
|
||||||
android:viewportHeight="108"
|
android:viewportHeight="108">
|
||||||
android:tint="#455A64">
|
<group
|
||||||
<group android:scaleX="1.7226"
|
android:scaleX="1.7226"
|
||||||
android:scaleY="1.7226"
|
android:scaleY="1.7226"
|
||||||
android:translateX="33.3288"
|
android:translateX="33.3288"
|
||||||
android:translateY="33.3288">
|
android:translateY="33.3288">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@android:color/white"
|
android:fillColor="@android:color/white"
|
||||||
android:pathData="M4,6.47L5.76,10H20v8H4V6.47M22,4h-4l2,4h-3l-2,-4h-2l2,4h-3l-2,-4H8l2,4H7L5,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4z"/>
|
android:pathData="M4,6.47L5.76,10H20v8H4V6.47M22,4h-4l2,4h-3l-2,-4h-2l2,4h-3l-2,-4H8l2,4H7L5,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4z" />
|
||||||
</group>
|
</group>
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="108dp"
|
android:width="108dp"
|
||||||
android:height="108dp"
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
android:viewportWidth="108"
|
android:viewportWidth="108"
|
||||||
android:viewportHeight="108"
|
android:viewportHeight="108">
|
||||||
android:tint="#455A64">
|
<group
|
||||||
<group android:scaleX="1.7226"
|
android:scaleX="1.7226"
|
||||||
android:scaleY="1.7226"
|
android:scaleY="1.7226"
|
||||||
android:translateX="33.3288"
|
android:translateX="33.3288"
|
||||||
android:translateY="33.3288">
|
android:translateY="33.3288">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@android:color/white"
|
android:fillColor="@android:color/white"
|
||||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||||
</group>
|
</group>
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_background"
|
||||||
|
android:pathData="M5,54 A1,1 0 1,1 103,54 A1,1 0 1,1 5,54" />
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_foreground"
|
||||||
|
android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
18
android/app/src/main/res/drawable-v21/ic_shortcut_movie.xml
Normal file
18
android/app/src/main/res/drawable-v21/ic_shortcut_movie.xml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_background"
|
||||||
|
android:pathData="M5,54 A1,1 0 1,1 103,54 A1,1 0 1,1 5,54" />
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_foreground"
|
||||||
|
android:pathData="M4,6.47L5.76,10H20v8H4V6.47M22,4h-4l2,4h-3l-2,-4h-2l2,4h-3l-2,-4H8l2,4H7L5,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
18
android/app/src/main/res/drawable-v21/ic_shortcut_search.xml
Normal file
18
android/app/src/main/res/drawable-v21/ic_shortcut_search.xml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_background"
|
||||||
|
android:pathData="M5,54 A1,1 0 1,1 103,54 A1,1 0 1,1 5,54" />
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/ic_shortcut_foreground"
|
||||||
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_shortcut_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_shortcut_collection_foreground" />
|
||||||
|
</adaptive-icon>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_shortcut_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_shortcut_movie_foreground" />
|
||||||
|
</adaptive-icon>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M4,6.47L5.76,10H20v8H4V6.47M22,4h-4l2,4h-3l-2,-4h-2l2,4h-3l-2,-4H8l2,4H7L5,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_shortcut_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_shortcut_search_foreground" />
|
||||||
|
</adaptive-icon>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@color/ic_shortcut_background"/>
|
<background android:drawable="@color/ic_shortcut_background" />
|
||||||
<foreground android:drawable="@drawable/ic_shortcut_collection_foreground"/>
|
<foreground android:drawable="@drawable/ic_shortcut_collection_foreground" />
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M20,4v12L8,16L8,4h12m0,-2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM11.5,11.67l1.69,2.26 2.48,-3.1L19,15L9,15zM2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6L2,6z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@color/ic_shortcut_background"/>
|
<background android:drawable="@color/ic_shortcut_background" />
|
||||||
<foreground android:drawable="@drawable/ic_shortcut_movie_foreground"/>
|
<foreground android:drawable="@drawable/ic_shortcut_movie_foreground" />
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M4,6.47L5.76,10H20v8H4V6.47M22,4h-4l2,4h-3l-2,-4h-2l2,4h-3l-2,-4H8l2,4H7L5,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V4z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@color/ic_shortcut_background"/>
|
<background android:drawable="@color/ic_shortcut_background" />
|
||||||
<foreground android:drawable="@drawable/ic_shortcut_search_foreground"/>
|
<foreground android:drawable="@drawable/ic_shortcut_search_foreground" />
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:tint="@color/ic_shortcut_foreground"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<group
|
||||||
|
android:scaleX="1.7226"
|
||||||
|
android:scaleY="1.7226"
|
||||||
|
android:translateX="33.3288"
|
||||||
|
android:translateY="33.3288">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -2,5 +2,6 @@
|
||||||
<resources>
|
<resources>
|
||||||
<color name="ic_launcher_background">#FFFFFF</color>
|
<color name="ic_launcher_background">#FFFFFF</color>
|
||||||
<color name="ic_shortcut_background">#FFFFFF</color>
|
<color name="ic_shortcut_background">#FFFFFF</color>
|
||||||
|
<color name="ic_shortcut_foreground">#455A64</color>
|
||||||
<color name="ic_launcher_flavour">#3f51b5</color>
|
<color name="ic_launcher_flavour">#3f51b5</color>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in a new issue