From 68107468bc0bd46a33995eed281d3b8112c8cd5c Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Wed, 23 Dec 2020 13:24:36 -0600 Subject: [PATCH] Support API 30 --- heifconverter/build.gradle | 4 ++-- .../main/java/linc/com/heifconverter/HeifConverter.kt | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/heifconverter/build.gradle b/heifconverter/build.gradle index 06f7af9..71a7a6e 100644 --- a/heifconverter/build.gradle +++ b/heifconverter/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 + compileSdkVersion 30 buildToolsVersion "29.0.3" defaultConfig { minSdkVersion 21 - targetSdkVersion 29 + targetSdkVersion 30 versionCode 1 versionName "1.0" diff --git a/heifconverter/src/main/java/linc/com/heifconverter/HeifConverter.kt b/heifconverter/src/main/java/linc/com/heifconverter/HeifConverter.kt index f2c07eb..749cb42 100644 --- a/heifconverter/src/main/java/linc/com/heifconverter/HeifConverter.kt +++ b/heifconverter/src/main/java/linc/com/heifconverter/HeifConverter.kt @@ -135,13 +135,13 @@ object HeifConverter{ bitmap = when (fromDataType) { InputDataType.FILE -> { when(Build.VERSION.SDK_INT) { - Build.VERSION_CODES.Q -> BitmapFactory.decodeFile(pathToHeicFile) + Build.VERSION_CODES.Q, Build.VERSION_CODES.R -> BitmapFactory.decodeFile(pathToHeicFile) else -> HeifReader.decodeFile(pathToHeicFile) } } InputDataType.URL -> { when(Build.VERSION.SDK_INT) { - Build.VERSION_CODES.Q -> { + Build.VERSION_CODES.Q, Build.VERSION_CODES.R -> { // Download image val url = URL(url) val connection = url @@ -156,19 +156,19 @@ object HeifConverter{ } InputDataType.RESOURCES -> { when(Build.VERSION.SDK_INT) { - Build.VERSION_CODES.Q -> BitmapFactory.decodeResource(context.resources, resId!!) + Build.VERSION_CODES.Q, Build.VERSION_CODES.R -> BitmapFactory.decodeResource(context.resources, resId!!) else -> HeifReader.decodeResource(context.resources, resId!!) } } InputDataType.INPUT_STREAM -> { when(Build.VERSION.SDK_INT) { - Build.VERSION_CODES.Q -> BitmapFactory.decodeStream(inputStream!!) + Build.VERSION_CODES.Q, Build.VERSION_CODES.R -> BitmapFactory.decodeStream(inputStream!!) else -> HeifReader.decodeStream(inputStream!!) } } InputDataType.BYTE_ARRAY -> { when(Build.VERSION.SDK_INT) { - Build.VERSION_CODES.Q -> BitmapFactory.decodeByteArray( + Build.VERSION_CODES.Q, Build.VERSION_CODES.R -> BitmapFactory.decodeByteArray( byteArray!!, 0, byteArray!!.size,