mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-20 05:50:03 +03:00
Only set SHORTCUT_CATEGORY_CONVERSATION above API 25
This commit is contained in:
parent
2004d357d5
commit
15217d98ac
1 changed files with 7 additions and 5 deletions
|
@ -65,17 +65,19 @@ class ShortcutCreator @Inject constructor(
|
||||||
} catch (failure: Throwable) {
|
} catch (failure: Throwable) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
val categories = if (Build.VERSION.SDK_INT >= 25) {
|
||||||
|
setOf(directShareCategory, ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION)
|
||||||
|
} else {
|
||||||
|
setOf(directShareCategory)
|
||||||
|
}
|
||||||
|
|
||||||
return ShortcutInfoCompat.Builder(context, roomSummary.roomId)
|
return ShortcutInfoCompat.Builder(context, roomSummary.roomId)
|
||||||
.setShortLabel(roomSummary.displayName)
|
.setShortLabel(roomSummary.displayName)
|
||||||
.setIcon(bitmap?.toProfileImageIcon())
|
.setIcon(bitmap?.toProfileImageIcon())
|
||||||
.setIntent(intent)
|
.setIntent(intent)
|
||||||
.setLongLived(true)
|
.setLongLived(true)
|
||||||
.setRank(rank)
|
.setRank(rank)
|
||||||
|
.setCategories(categories)
|
||||||
// Make it show up in the direct share menu
|
|
||||||
.setCategories(setOf(
|
|
||||||
directShareCategory,
|
|
||||||
ShortcutInfo.SHORTCUT_CATEGORY_CONVERSATION))
|
|
||||||
|
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue