Update compileSDK and targetSDK to 36 (#2652)
diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml
new file mode 100644
index 0000000..4a53bee
--- /dev/null
+++ b/.idea/AndroidProjectSystem.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="AndroidProjectSystem">
+ <option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
+ </component>
+</project>
\ No newline at end of file
diff --git a/app-benchmark/build.gradle b/app-benchmark/build.gradle
index a06f954..60b2173 100755
--- a/app-benchmark/build.gradle
+++ b/app-benchmark/build.gradle
@@ -8,11 +8,11 @@
android {
namespace 'com.airbnb.lottie.benchmark.app'
- compileSdk 34
+ compileSdk 36
defaultConfig {
applicationId "com.airbnb.lottie.benchmark.app"
minSdk 21
- targetSdk 34
+ targetSdk 36
versionCode 1
versionName "1.0"
}
diff --git a/baselineprofile/build.gradle b/baselineprofile/build.gradle
index bd34c21..75d33a6 100644
--- a/baselineprofile/build.gradle
+++ b/baselineprofile/build.gradle
@@ -8,11 +8,11 @@
android {
namespace 'com.airbnb.lottie.baselineprofile'
- compileSdk 34
+ compileSdk 36
defaultConfig {
minSdk 28
- targetSdk 34
+ targetSdk 36
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR"
diff --git a/benchmark/build.gradle b/benchmark/build.gradle
index 4ce7907..4645a9b 100644
--- a/benchmark/build.gradle
+++ b/benchmark/build.gradle
@@ -6,7 +6,7 @@
android {
namespace 'com.airbnb.lottie.benchmark'
- compileSdk 34
+ compileSdk 36
kotlinOptions {
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
@@ -14,7 +14,7 @@
defaultConfig {
minSdk 30
- targetSdk 34
+ targetSdk 36
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/issue-repro-compose/build.gradle b/issue-repro-compose/build.gradle
index ff49721..6f2d6b4 100755
--- a/issue-repro-compose/build.gradle
+++ b/issue-repro-compose/build.gradle
@@ -7,11 +7,11 @@
android {
namespace 'com.airbnb.lottie.issues.compose'
- compileSdk 34
+ compileSdk 36
defaultConfig {
applicationId "com.airbnb.lottie.issues.compose"
minSdk 21
- targetSdk 34
+ targetSdk 36
versionCode 1
versionName "1.0"
}
diff --git a/issue-repro-compose/src/main/kotlin/com/airbnb/lottie/issues/compose/ComposeIssueReproActivity.kt b/issue-repro-compose/src/main/kotlin/com/airbnb/lottie/issues/compose/ComposeIssueReproActivity.kt
index abf6dc2..ea21f9e 100755
--- a/issue-repro-compose/src/main/kotlin/com/airbnb/lottie/issues/compose/ComposeIssueReproActivity.kt
+++ b/issue-repro-compose/src/main/kotlin/com/airbnb/lottie/issues/compose/ComposeIssueReproActivity.kt
@@ -3,8 +3,12 @@
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.LottieConstants
@@ -23,6 +27,8 @@
fun Content() {
val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.heart))
val progress by animateLottieCompositionAsState(composition, iterations = LottieConstants.IterateForever)
- LottieAnimation(composition, { progress })
+ Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
+ LottieAnimation(composition, { progress })
+ }
}
}
diff --git a/issue-repro/build.gradle b/issue-repro/build.gradle
index 73c77a0..dfdef2e 100755
--- a/issue-repro/build.gradle
+++ b/issue-repro/build.gradle
@@ -5,11 +5,11 @@
android {
namespace 'com.airbnb.lottie.issues'
- compileSdk 34
+ compileSdk 36
defaultConfig {
applicationId "com.airbnb.lottie.issues"
minSdk 16
- targetSdk 34
+ targetSdk 36
versionCode 1
versionName "1.0"
}
diff --git a/lottie-compose/build.gradle b/lottie-compose/build.gradle
index fc7aa0d..289e53f 100644
--- a/lottie-compose/build.gradle
+++ b/lottie-compose/build.gradle
@@ -11,10 +11,10 @@
android {
namespace 'com.airbnb.lottie.compose'
- compileSdk 34
+ compileSdk 36
defaultConfig {
minSdk 21
- targetSdk 34
+ targetSdk 36
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
diff --git a/lottie/build.gradle b/lottie/build.gradle
index a766f37..1e27185 100644
--- a/lottie/build.gradle
+++ b/lottie/build.gradle
@@ -11,10 +11,10 @@
android {
namespace 'com.airbnb.lottie'
resourcePrefix 'lottie_'
- compileSdk 34
+ compileSdk 36
defaultConfig {
minSdk 16
- targetSdk 34
+ targetSdk 36
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
diff --git a/sample-compose/build.gradle b/sample-compose/build.gradle
index 279dd7e..6fe7d63 100644
--- a/sample-compose/build.gradle
+++ b/sample-compose/build.gradle
@@ -8,11 +8,11 @@
android {
namespace 'com.airbnb.lottie.sample.compose'
- compileSdk 34
+ compileSdk 36
defaultConfig {
applicationId "com.airbnb.lottie.sample.compose"
minSdk 21
- targetSdk 34
+ targetSdk 36
versionCode 1
versionName VERSION_NAME
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/sample-compose/src/main/java/com/airbnb/lottie/sample/compose/ComposeActivity.kt b/sample-compose/src/main/java/com/airbnb/lottie/sample/compose/ComposeActivity.kt
index bb7ab55..d7b9ace 100644
--- a/sample-compose/src/main/java/com/airbnb/lottie/sample/compose/ComposeActivity.kt
+++ b/sample-compose/src/main/java/com/airbnb/lottie/sample/compose/ComposeActivity.kt
@@ -6,7 +6,16 @@
import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.WindowInsetsSides
+import androidx.compose.foundation.layout.exclude
+import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.safeDrawing
+import androidx.compose.foundation.layout.systemBars
+import androidx.compose.foundation.layout.union
+import androidx.compose.foundation.layout.windowInsetsPadding
+import androidx.compose.foundation.layout.windowInsetsTopHeight
import androidx.compose.material.BottomNavigation
import androidx.compose.material.BottomNavigationItem
import androidx.compose.material.Icon
@@ -59,8 +68,11 @@
LottieTheme {
Scaffold(
+ // Omit bottom inset padding for the scaffold to allow the BottomNavigation to extend to the edge of the screen.
+ modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Top)),
bottomBar = {
BottomNavigation(
+ windowInsets = WindowInsets.safeDrawing.only(WindowInsetsSides.Bottom),
backgroundColor = Color(0xFFF7F7F7),
elevation = 8.dp,
contentColor = Teal,
@@ -68,7 +80,7 @@
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination?.route
- BottomNavItemData.values().forEach { item ->
+ BottomNavItemData.entries.forEach { item ->
BottomNavigationItem(
icon = {
Icon(
diff --git a/sample/build.gradle b/sample/build.gradle
index db16d97..db4ecef 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -9,11 +9,11 @@
android {
namespace 'com.airbnb.lottie.samples'
- compileSdk 34
+ compileSdk 36
defaultConfig {
applicationId "com.airbnb.lottie"
minSdk 16
- targetSdk 34
+ targetSdk 36
versionCode 71
versionName VERSION_NAME
multiDexEnabled true
diff --git a/sample/src/main/kotlin/com/airbnb/lottie/samples/MainActivity.kt b/sample/src/main/kotlin/com/airbnb/lottie/samples/MainActivity.kt
index 51b489b..6f4582c 100644
--- a/sample/src/main/kotlin/com/airbnb/lottie/samples/MainActivity.kt
+++ b/sample/src/main/kotlin/com/airbnb/lottie/samples/MainActivity.kt
@@ -5,6 +5,9 @@
import androidx.appcompat.app.AppCompatDelegate
import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.net.toUri
+import androidx.core.view.ViewCompat
+import androidx.core.view.WindowInsetsCompat
+import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
import androidx.fragment.app.commit
import com.airbnb.lottie.samples.databinding.MainActivityBinding
@@ -26,11 +29,29 @@
}
binding.bottomNavigation.itemIconTintList = null
+ updateContentPaddingForSystemWindowInsets()
+
if (savedInstanceState == null) {
showFragment(PreviewFragment())
}
}
+ private fun updateContentPaddingForSystemWindowInsets() {
+ ViewCompat.setOnApplyWindowInsetsListener(binding.content) { v, insets ->
+ val bars = insets.getInsets(
+ WindowInsetsCompat.Type.systemBars()
+ or WindowInsetsCompat.Type.displayCutout(),
+ )
+ v.updatePadding(
+ left = bars.left,
+ top = bars.top,
+ right = bars.right,
+ bottom = bars.bottom,
+ )
+ WindowInsetsCompat.CONSUMED
+ }
+ }
+
private fun showShowcase() {
val intent = CustomTabsIntent.Builder().build()
intent.launchUrl(this, "http://airbnb.io/lottie/#/android".toUri())
diff --git a/sample/src/main/res/layout/main_activity.xml b/sample/src/main/res/layout/main_activity.xml
index e65528f..fb9b5c4 100644
--- a/sample/src/main/res/layout/main_activity.xml
+++ b/sample/src/main/res/layout/main_activity.xml
@@ -14,11 +14,11 @@
android:layout_height="0dp"
android:layout_weight="1" />
-
+ <!--Wrap content height to allow for bottom window insets to be included-->
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigation"
android:layout_width="match_parent"
- android:layout_height="56dp"
+ android:layout_height="wrap_content"
android:background="#F7F7F7"
android:elevation="8dp"
app:itemIconTint="@drawable/bottom_bar_tint_list"
diff --git a/snapshot-tests/build.gradle b/snapshot-tests/build.gradle
index adde4e3..64c5acf 100644
--- a/snapshot-tests/build.gradle
+++ b/snapshot-tests/build.gradle
@@ -7,11 +7,11 @@
android {
namespace 'com.airbnb.lottie.snapshots'
- compileSdk 34
+ compileSdk 36
defaultConfig {
applicationId "com.airbnb.lottie.snapshots"
minSdk 21
- targetSdk 34
+ targetSdk 36
versionCode 1
versionName VERSION_NAME
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"