diff --git a/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginFragment.kt b/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginFragment.kt index 71a298a..96883ba 100644 --- a/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginFragment.kt +++ b/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginFragment.kt @@ -73,7 +73,10 @@ class LoginFragment : Fragment() { ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets -> val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.updatePadding(top = bars.top, bottom = bars.bottom) + // NOTE: ime() is required since targetSdk 35+ / edge-to-edge, otherwise the + // keyboard covers content. maxOf avoids double-padding when both are visible. + val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) + v.updatePadding(top = bars.top, bottom = maxOf(bars.bottom, ime.bottom)) insets } diff --git a/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginTwoFragment.kt b/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginTwoFragment.kt index 292af1c..628b62d 100644 --- a/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginTwoFragment.kt +++ b/app/src/main/java/com/djangofiles/djangofiles/ui/login/LoginTwoFragment.kt @@ -88,7 +88,10 @@ class LoginTwoFragment : Fragment() { ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets -> val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.updatePadding(top = bars.top, bottom = bars.bottom) + // NOTE: ime() is required since targetSdk 35+ / edge-to-edge, otherwise the + // keyboard covers content. maxOf avoids double-padding when both are visible. + val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) + v.updatePadding(top = bars.top, bottom = maxOf(bars.bottom, ime.bottom)) insets } diff --git a/app/src/main/java/com/djangofiles/djangofiles/ui/upload/ShortFragment.kt b/app/src/main/java/com/djangofiles/djangofiles/ui/upload/ShortFragment.kt index 127b92a..0cc02ca 100644 --- a/app/src/main/java/com/djangofiles/djangofiles/ui/upload/ShortFragment.kt +++ b/app/src/main/java/com/djangofiles/djangofiles/ui/upload/ShortFragment.kt @@ -71,7 +71,10 @@ class ShortFragment : Fragment() { ViewCompat.setOnApplyWindowInsetsListener(view) { v, insets -> val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.updatePadding(top = bars.top, bottom = bars.bottom) + // NOTE: ime() is required since targetSdk 35+ / edge-to-edge, otherwise the + // keyboard covers content. maxOf avoids double-padding when both are visible. + val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) + v.updatePadding(top = bars.top, bottom = maxOf(bars.bottom, ime.bottom)) insets } diff --git a/app/src/main/java/com/djangofiles/djangofiles/ui/upload/TextFragment.kt b/app/src/main/java/com/djangofiles/djangofiles/ui/upload/TextFragment.kt index 4bea8c0..c15c068 100644 --- a/app/src/main/java/com/djangofiles/djangofiles/ui/upload/TextFragment.kt +++ b/app/src/main/java/com/djangofiles/djangofiles/ui/upload/TextFragment.kt @@ -71,7 +71,10 @@ class TextFragment : Fragment() { ViewCompat.setOnApplyWindowInsetsListener(view) { v, insets -> val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.updatePadding(top = bars.top, bottom = bars.bottom) + // NOTE: ime() is required since targetSdk 35+ / edge-to-edge, otherwise the + // keyboard covers content. maxOf avoids double-padding when both are visible. + val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) + v.updatePadding(top = bars.top, bottom = maxOf(bars.bottom, ime.bottom)) insets } diff --git a/app/src/main/java/com/djangofiles/djangofiles/ui/upload/UploadFragment.kt b/app/src/main/java/com/djangofiles/djangofiles/ui/upload/UploadFragment.kt index a8b6fb6..87448db 100644 --- a/app/src/main/java/com/djangofiles/djangofiles/ui/upload/UploadFragment.kt +++ b/app/src/main/java/com/djangofiles/djangofiles/ui/upload/UploadFragment.kt @@ -123,7 +123,10 @@ class UploadFragment : Fragment() { ViewCompat.setOnApplyWindowInsetsListener(view) { v, insets -> val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.updatePadding(top = bars.top, bottom = bars.bottom) + // NOTE: ime() is required since targetSdk 35+ / edge-to-edge, otherwise the + // keyboard covers content. maxOf avoids double-padding when both are visible. + val ime = insets.getInsets(WindowInsetsCompat.Type.ime()) + v.updatePadding(top = bars.top, bottom = maxOf(bars.bottom, ime.bottom)) insets }