Refactor search, favorites and calendar widget
This commit is contained in:
@@ -19,9 +19,11 @@ class AddItemActivity : Activity() {
|
||||
val launcherApps = getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
|
||||
val pinRequest = launcherApps.getPinItemRequest(intent) ?: return run { finish() }
|
||||
val shortcutInfo = pinRequest.shortcutInfo ?: return run { finish() }
|
||||
val shortcut = AppShortcut(this.applicationContext, shortcutInfo,
|
||||
packageManager.getApplicationInfo(shortcutInfo.`package`, 0)
|
||||
.loadLabel(packageManager).toString())
|
||||
val shortcut = AppShortcut(
|
||||
this.applicationContext, shortcutInfo,
|
||||
packageManager.getApplicationInfo(shortcutInfo.`package`, 0)
|
||||
.loadLabel(packageManager).toString()
|
||||
)
|
||||
if (pinRequest.accept()) {
|
||||
favoritesRepository.pinItem(shortcut)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user