Skip to content

Commit

Permalink
fix: insets of card content in editor activity
Browse files Browse the repository at this point in the history
  • Loading branch information
teixeira0x committed Dec 11, 2024
1 parent 2d89eb8 commit 27681db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ViewGroup.LayoutParams> {
this.height = height - imeInsets.bottom
this._binding?.apply {
content.bottomSheet.setImeVisible(imeInsets.bottom > 0)
contentCard.updateLayoutParams<ViewGroup.LayoutParams> {
this.height = swipeReveal.height - imeInsets.bottom
}
}

val isImeVisible = imeInsets.bottom > 0
Expand All @@ -302,6 +304,10 @@ abstract class BaseEditorActivity :
.getFragment<EditorSidebarFragment>()
.onApplyWindowInsets(insets)

contentCard.updateLayoutParams<ViewGroup.LayoutParams> {
this.height = swipeReveal.height
}

content.apply {
editorAppBarLayout.updatePadding(top = insets.top)
editorToolbar.updatePaddingRelative(
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27681db

Please sign in to comment.