-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor]: delete @SuppressLint("NewApi")
- Loading branch information
Showing
3 changed files
with
18 additions
and
14 deletions.
There are no files selected for viewing
25 changes: 14 additions & 11 deletions
25
app/src/main/java/com/f0x1d/logfox/extensions/APIExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
package com.f0x1d.logfox.extensions | ||
|
||
import android.os.Build | ||
import android.os.Build.VERSION.* | ||
import android.os.Build.VERSION_CODES.* | ||
import androidx.annotation.ChecksSdkIntAtLeast | ||
|
||
val isAtLeastAndroid13 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU | ||
@get:ChecksSdkIntAtLeast(api = TIRAMISU) val isAtLeastAndroid13 = SDK_INT >= TIRAMISU | ||
|
||
val gesturesAvailable = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q | ||
val contrastedNavBarAvailable = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 | ||
@get:ChecksSdkIntAtLeast(api = Q) val gesturesAvailable = SDK_INT >= Q | ||
/* Huawei devices will return true regardless of the SDK version */ | ||
val contrastedNavBarAvailable = SDK_INT >= O_MR1 | ||
|
||
val notificationsDynamicColorAvailable = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S | ||
val notificationsChannelsAvailable = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O | ||
val shouldRequestNotificationsPermission = Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU | ||
val startForegroundServiceAvailable = notificationsChannelsAvailable | ||
@get:ChecksSdkIntAtLeast(api = S) val notificationsDynamicColorAvailable = SDK_INT >= S | ||
@get:ChecksSdkIntAtLeast(api = O) val notificationsChannelsAvailable = SDK_INT >= O | ||
@get:ChecksSdkIntAtLeast(api = TIRAMISU) val shouldRequestNotificationsPermission = SDK_INT >= TIRAMISU | ||
@get:ChecksSdkIntAtLeast(api = O) val startForegroundServiceAvailable = notificationsChannelsAvailable | ||
|
||
val canPickJSON = Build.VERSION.SDK_INT >= Build.VERSION_CODES.R | ||
@get:ChecksSdkIntAtLeast(api = R) val canPickJSON = SDK_INT >= R | ||
|
||
val uiModeManagerAvailable = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S | ||
val mutablePendingIntentAvailable = uiModeManagerAvailable | ||
@get:ChecksSdkIntAtLeast(api = S) val uiModeManagerAvailable = SDK_INT >= S | ||
@get:ChecksSdkIntAtLeast(api = S) val mutablePendingIntentAvailable = uiModeManagerAvailable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters