2
0
Fork 1
mirror of https://github.com/FossifyOrg/Gallery.git synced 2025-04-21 10:49:48 +02:00

Apply project's code style to api version checks

This commit is contained in:
Ebrahim Byagowi 2021-12-06 01:32:45 +03:30
parent 0e1a1cfb90
commit dd8cd61450
3 changed files with 9 additions and 3 deletions
app/src/main/kotlin/com/simplemobiletools/gallery/pro

View file

@ -716,7 +716,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
private fun createShortcut() {
if (!isOreoPlus()) return
if (!isOreoPlus()) {
return
}
val manager = getSystemService(ShortcutManager::class.java)
if (manager.isRequestPinShortcutSupported) {
val medium = getCurrentMedium() ?: return

View file

@ -549,7 +549,9 @@ class DirectoryAdapter(
}
private fun createShortcut() {
if (!isOreoPlus()) return
if (!isOreoPlus()) {
return
}
val manager = activity.getSystemService(ShortcutManager::class.java)
if (manager.isRequestPinShortcutSupported) {
val dir = getFirstSelectedItem() ?: return

View file

@ -386,7 +386,9 @@ class MediaAdapter(
}
private fun createShortcut() {
if (!isOreoPlus()) return
if (!isOreoPlus()) {
return
}
val manager = activity.getSystemService(ShortcutManager::class.java)
if (manager.isRequestPinShortcutSupported) {
val path = getSelectedPaths().first()