Parsing Plugin and Desktop app for parsing layout xml into Composable code Sep 10, 2021 1 min read composed-xml Inspired by - Recompose composed-xml is a tool for parsing Android layouts into Jetpack Compose code. It can work as both Desktop app or Intelij/Android Studio plugin. Docs Supported View Types Desktop App Screens Examples <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Current Number: 0" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"/> <Button android:id="@+id/btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Increase" app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toEndOf="@id/text"/> </androidx.constraintlayout.widget.ConstraintLayout> XML ===> package temp import androidx.compose.foundation.layout.ConstrainedLayoutReference import androidx.compose.foundation.layout.ConstraintLayout import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.sp import kotlin.Unit @Composable public fun Content(): Unit { ConstraintLayout (modifier = Modifier.fillMaxWidth().fillMaxHeight()) { val textRef = ConstrainedLayoutReference(Any()) val btnRef = ConstrainedLayoutReference(Any()) Text("Current Number: 0", modifier = Modifier.wrapContentWidth().wrapContentHeight().constrainAs(textRef, { top.linkTo(parent.top) start.linkTo(parent.start) } )) Button(onClick = {}, modifier = Modifier.wrapContentWidth().wrapContentHeight().constrainAs(btnRef, { top.linkTo(parent.top) start.linkTo(textRef.end) } )) { Text("Increase", modifier = Modifier.wrapContentWidth().wrapContentHeight()) } } } Kotlin GitHub https://github.com/kacmacuna/composed-xml ParsingXML
Tool A tool to assist in your migration from classic Android XML layouts to Jetpack Compose A tool to assist in your migration from classic Android XML layouts to Jetpack Compose 29 August 2023
Parser A lightweight Kotlin library for parsing HTML, extracting HTML tags A lightweight Kotlin library for parsing HTML, extracting HTML tags 15 May 2023