From dd8cd61450f5dc8c146fbc8aad021c8cc308013d Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 6 Dec 2021 01:32:45 +0330 Subject: [PATCH] Apply project's code style to api version checks --- .../gallery/pro/activities/ViewPagerActivity.kt | 4 +++- .../gallery/pro/adapters/DirectoryAdapter.kt | 4 +++- .../simplemobiletools/gallery/pro/adapters/MediaAdapter.kt | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 31c46723f..94e62b028 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index b54c3c2bd..914150121 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -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 diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index 65e409dca..059cfcf23 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -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()