XML to Jetpack Compose Converter
Link to open source: https://github.com/bhoomi0104/XML-To-Compose
XML to Compose Converter is a tool that assists you in transitioning from classic Android XML layouts to Jetpack Compose UI components effortlessly. It provides a user-friendly interface where you can select a classic Android widget, and the converter will display the equivalent Jetpack Compose composable name.
3
<com.harrysoft.joystickview.JoystickView android:layout_width="match_parent" android:layout_height="@dimen/joystick_height" android:id="@+id/left_joystick" />
xml to compose:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="20dp" android:layout_gravity="center" android:id="@+id/f_container"> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="30dp" android:src="@drawable/ic_launcher_background" /> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- TEXTO CORREO --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:text="@string/correo" android:textAlignment="center" android:textColor="@color/black" android:textSize="17sp" android:textStyle="bold" /> <!-- EDIT TEXT CORREO --> <EditText android:id="@+id/etCorreoElectronico" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="40dp" android:background="@drawable/edit_text_border" android:hint="@string/escribe_tu_correo" android:inputType="textEmailAddress" android:padding="12dp" android:textColor="@color/black" android:textSize="16sp" /> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- TEXTO CONTRASEÑA --> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:text="@string/contrasena" android:textAlignment="center" android:textColor="@color/black" android:textSize="17sp" android:textStyle="bold" /> <!-- EDIT TEXT CONTRASEÑA --> <EditText android:id="@+id/etContrasena" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="30dp" android:background="@drawable/edit_text_border" android:hint="@string/escribe_tu_contrasena" android:inputType="textPassword" android:padding="12dp" android:textColor="@color/black" android:textSize="16sp" /> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <!-- ||||||||||||||||||||||||||||||||||||||||||||||||||| --> <Button android:id="@+id/btnIniciarSesion" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/iniciar_sesion" android:textSize="20sp" android:textStyle="bold" /> <Button android:id="@+id/btnLimpiarCampos" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="@string/limpiar_campos" android:textSize="17sp" android:textStyle="bold" /> </LinearLayout>