Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix(uidesigner): IllegalStateException due to commit 1133347 (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsaky committed Aug 7, 2023
1 parent cd1d092 commit a29df43
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import com.blankj.utilcode.util.SizeUtils
import com.itsaky.androidide.fragments.BaseFragment
import com.itsaky.androidide.inflater.IView
import com.itsaky.androidide.inflater.internal.LayoutFile
import com.itsaky.androidide.inflater.utils.endParse
import com.itsaky.androidide.inflater.utils.startParse
import com.itsaky.androidide.uidesigner.R
import com.itsaky.androidide.uidesigner.UIDesignerActivity
import com.itsaky.androidide.uidesigner.databinding.FragmentDesignerWorkspaceBinding
Expand Down Expand Up @@ -117,6 +119,7 @@ class DesignerWorkspaceFragment : BaseFragment() {

val inflated =
try {
startParse(viewModel.file)
inflater.inflate(viewModel.file, workspaceView).also {
viewModel.layoutHasError = false
}
Expand Down Expand Up @@ -144,6 +147,8 @@ class DesignerWorkspaceFragment : BaseFragment() {
this.binding = null
this.hierarchyHandler.release()
this.attrHandler.release()

endParse()

if (!childFragmentManager.isDestroyed) {
val viewInfo = childFragmentManager.findFragmentByTag(ViewInfoSheet.TAG) as? ViewInfoSheet?
Expand Down

0 comments on commit a29df43

Please sign in to comment.