diff options
Diffstat (limited to 'library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt')
-rw-r--r-- | library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt b/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt index 1ba54e0..629dfb2 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt @@ -22,12 +22,6 @@ val Int.dpToPx: Int val Int.pxToDp: Int get() = (this / Resources.getSystem().displayMetrics.density).toInt() -val buildIsLollipopAndUp: Boolean - get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP - -val buildIsMarshmallowAndUp: Boolean - get() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M - /** * Log whether current state is in the main thread */ @@ -37,23 +31,6 @@ fun checkThread(id: Int) { } /** - * Checks if a given package is installed - * @param packageName packageId - * @return true if installed with activity, false otherwise - */ -fun Context.isAppInstalled(packageName: String): Boolean { - val pm = packageManager - var installed: Boolean - try { - pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES) - installed = true - } catch (e: PackageManager.NameNotFoundException) { - installed = false - } - return installed -} - -/** * Converts minute value to string * Whole hours and days will be converted as such, otherwise it will default to x minutes */ |