From 24414c316591e5029f2637db9099d5e885f29c00 Mon Sep 17 00:00:00 2001
From: Chris Banes <chris@banes.me>
Date: Fri, 15 Jan 2021 09:44:29 +0000
Subject: [PATCH] Disable window insets animations on API < 30

There are currently issues in WindowInsetsAnimationCompat
(likely https://issuetracker.google.com/175391720).
We'll re-enable at a later date once the issues are ironed out.
---
 .../compose/jetchat/conversation/ConversationFragment.kt     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/ConversationFragment.kt b/Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/ConversationFragment.kt
index af9a7ba557..de3a431330 100644
--- a/Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/ConversationFragment.kt
+++ b/Jetchat/app/src/main/java/com/example/compose/jetchat/conversation/ConversationFragment.kt
@@ -16,6 +16,7 @@
 
 package com.example.compose.jetchat.conversation
 
+import android.os.Build
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
@@ -55,7 +56,9 @@ class ConversationFragment : Fragment() {
             // We use the `windowInsetsAnimationsEnabled` parameter to enable animated
             // insets support. This allows our `ConversationContent` to animate with the
             // on-screen keyboard (IME) as it enters/exits the screen.
-            .start(windowInsetsAnimationsEnabled = true)
+            // We only enable this on API 30+ (for now), due to
+            // https://issuetracker.google.com/175391720. Hopefully fixed in Core 1.5.0-beta02
+            .start(windowInsetsAnimationsEnabled = Build.VERSION.SDK_INT >= 30)
 
         setContent {
             Providers(