From 27681db40844ce34975f8e2f6bb7380a4862c9d6 Mon Sep 17 00:00:00 2001 From: Felipe Teixeira Date: Wed, 11 Dec 2024 16:31:37 -0300 Subject: [PATCH] fix: insets of card content in editor activity --- .../activities/editor/BaseEditorActivity.kt | 16 +++++++++++----- .../activities/editor/ProjectHandlerActivity.kt | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt b/core/app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt index 25a6622ed3..f99478ecc4 100644 --- a/core/app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt +++ b/core/app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt @@ -280,12 +280,14 @@ abstract class BaseEditorActivity : override fun onApplyWindowInsets(insets: WindowInsetsCompat) { super.onApplyWindowInsets(insets) - val height = _binding?.swipeReveal?.height ?: return + val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime()) - _binding?.content?.bottomSheet?.setImeVisible(imeInsets.bottom > 0) - _binding?.contentCard?.updateLayoutParams { - this.height = height - imeInsets.bottom + this._binding?.apply { + content.bottomSheet.setImeVisible(imeInsets.bottom > 0) + contentCard.updateLayoutParams { + this.height = swipeReveal.height - imeInsets.bottom + } } val isImeVisible = imeInsets.bottom > 0 @@ -302,6 +304,10 @@ abstract class BaseEditorActivity : .getFragment() .onApplyWindowInsets(insets) + contentCard.updateLayoutParams { + this.height = swipeReveal.height + } + content.apply { editorAppBarLayout.updatePadding(top = insets.top) editorToolbar.updatePaddingRelative( @@ -869,7 +875,7 @@ abstract class BaseEditorActivity : IntentUtils.launchApp(this, packageName) it.dismiss() } - .negativeActionText(string.cancel) + .negativeActionText(string.no) .negativeActionTapListener(Flashbar::dismiss) .build() this.tempFlashbar?.showOnUiThread() diff --git a/core/app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt b/core/app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt index 64b6176853..a33a21a996 100644 --- a/core/app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt +++ b/core/app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt @@ -25,6 +25,7 @@ import android.widget.CheckBox import androidx.activity.viewModels import androidx.annotation.GravityInt import androidx.appcompat.app.AlertDialog +import androidx.lifecycle.lifecycleScope import com.blankj.utilcode.util.SizeUtils import com.blankj.utilcode.util.ThreadUtils import com.itsaky.androidide.R