Skip to content

Commit 27681db

Browse files
committed
fix: insets of card content in editor activity
1 parent 2d89eb8 commit 27681db

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

core/app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt

+11-5
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,14 @@ abstract class BaseEditorActivity :
280280

281281
override fun onApplyWindowInsets(insets: WindowInsetsCompat) {
282282
super.onApplyWindowInsets(insets)
283-
val height = _binding?.swipeReveal?.height ?: return
283+
284284
val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime())
285285

286-
_binding?.content?.bottomSheet?.setImeVisible(imeInsets.bottom > 0)
287-
_binding?.contentCard?.updateLayoutParams<ViewGroup.LayoutParams> {
288-
this.height = height - imeInsets.bottom
286+
this._binding?.apply {
287+
content.bottomSheet.setImeVisible(imeInsets.bottom > 0)
288+
contentCard.updateLayoutParams<ViewGroup.LayoutParams> {
289+
this.height = swipeReveal.height - imeInsets.bottom
290+
}
289291
}
290292

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

307+
contentCard.updateLayoutParams<ViewGroup.LayoutParams> {
308+
this.height = swipeReveal.height
309+
}
310+
305311
content.apply {
306312
editorAppBarLayout.updatePadding(top = insets.top)
307313
editorToolbar.updatePaddingRelative(
@@ -869,7 +875,7 @@ abstract class BaseEditorActivity :
869875
IntentUtils.launchApp(this, packageName)
870876
it.dismiss()
871877
}
872-
.negativeActionText(string.cancel)
878+
.negativeActionText(string.no)
873879
.negativeActionTapListener(Flashbar::dismiss)
874880
.build()
875881
this.tempFlashbar?.showOnUiThread()

core/app/src/main/java/com/itsaky/androidide/activities/editor/ProjectHandlerActivity.kt

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import android.widget.CheckBox
2525
import androidx.activity.viewModels
2626
import androidx.annotation.GravityInt
2727
import androidx.appcompat.app.AlertDialog
28+
import androidx.lifecycle.lifecycleScope
2829
import com.blankj.utilcode.util.SizeUtils
2930
import com.blankj.utilcode.util.ThreadUtils
3031
import com.itsaky.androidide.R

0 commit comments

Comments
 (0)