pocmo / recompose

recompose is a tool for converting Android layouts in XML to Kotlin code using Jetpack Compose.
Apache License 2.0
794 stars 49 forks source link

Is this plugin no longer being worked on? #117

Open greate43 opened 1 year ago

greate43 commented 1 year ago

Every time i try and copy and paste it says. the xml is too complex.

crypto-zh commented 1 year ago

I have the same problem

nordfalk commented 1 year ago

I dont have that problem. Ive made some improvements, which might solve your problem - try https://github.com/nordfalk/recompose, it might work for you.

Ric-AB commented 1 year ago

@nordfalk I have the same issue even with your improvements. Please can you confirm if it still works for you?

nordfalk commented 1 year ago

@Ric-AB Ive just verified that my version can be installed as a plugin in Android Studio Hedgehog | 2023.1.1 Canary 6, using ./gradlew buildPlugin and then installing the plugin from recompose-idea/build/distributions. Ive copyed some XML files and pasted in Kotlin files and they were converted.

That said, Ive not used the IDEA plugin very much. Ive mostly used the Command-line interface to mass convert a lot of layouts. Ive disabled the plugin as it was interfering my workflow (sometimes trying to convert things I didnt want converted).

hamzabelhaj commented 7 months ago

do you guys know how the CLI works ? i installed it as a zip file, but then i don't know how to get the interface to show.

nordfalk commented 7 months ago

@hamzabelhaj Theres no GUI for the Command-line interface. The CLI works as described in https://github.com/pocmo/recompose?tab=readme-ov-file#command-line-interface-cli

I used it like this:

./gradlew recompose-cli:run --args="-h"

./gradlew recompose-cli:run --args="/home/j/dinero-android-app/base/src/main/res/layout/settings_companies_list_item.xml -o /home/j/dinero-android-app/base/src/main/java/dk/dinero/dinero/app/navigation -c"

to convert settings_companies_list_item.xml into Compose.

I havent tried to use the zip file as a CLI.

Perhaps you mean: How to display the UI in IntelliJ, after installing the ZIP file in IntelliJ ?

hamzabelhaj commented 7 months ago

Oh thanks this helps a lot, exactly i tried to install the UI in IntelliJ based on the created CLI zip file, which unfortunately didn't work, i think there is little information for this matter unlike for the plugin. also i had unclarity, which args i should use when running the CLI with Gradle, now it seems to work, only i would like to know what the "-c" option at the end of the args is used for, as it is not talked about in the documentation?

nordfalk commented 7 months ago

Ah sorry, the -c is only for my fork :-)

val complete by option("-c", "--complete", help="Generate complete file, with imports and preview (Dinero specific - you need to customize the source)").flag()
hamzabelhaj commented 6 months ago

Allright, thank you :)