Write blocks with XML

Hello there, I know that the download blocks as image is using XML for the blocks data. Just curious if we can write blocks in XML with Kodular format and upload to creator?

<xml xmlns="http://www.w3.org/1999/xhtml"><block type="component_event"><mutation component_type="Button" is_generic="false" instance_name="Button1" event_name="Click"></mutation><field name="COMPONENT_SELECTOR">Button1</field><statement name="DO"><block type="component_set_get"><mutation component_type="Label" set_or_get="set" property_name="Text" is_generic="false" instance_name="Label1"></mutation><field name="COMPONENT_SELECTOR">Label1</field><field name="PROP">Text</field><value name="VALUE"><block type="text"><field name="TEXT">Hello World!</field></block></value></block></statement></block></xml>

Extracted from a image

3 Likes

Maybe this was possible :sob: Then I would create amazing ui

2 Likes

Really.
I read a blog post that Android studio introduces GUI for app ui builder than it gains more popularity and 40% of users from intellijidea.
So conclusion is user preferred GUI coding over writing xml.
You want to go GUI to xml coding.

1 Like

Yes you can.
Just edit an image’s metadata and upload that to creator.
Btw, I wonder that why you want to use XML instead of Blockly?

1 Like

Just curious :stuck_out_tongue_winking_eye:

How can we do that?

It’s not possible what you want. I think you want XML code editor like we have in the Android Studio. :sweat_smile:

Since, Kodular works in a different way, so it’s not possible to create a whole UI by using XML. :slightly_smiling_face:

1 Like

Soo we can create anything extra by xml code?

If you really want to do it then just pickup an AIA file and edit .bky file
But remember that it is not Android Layout XML Code, It is just the XML code of blocks in AIA

2 Likes

I once opened the .bky file and I am shocked

1 Like

Right now, I think it is not possible. We can’t even change our Manifest file for now, how can we expect to create components using XML code. Let’s hope for the best. :wink:

1 Like

Can we change elevation color of a cardview using xml code?

No. Not for now. :sweat_smile:

1 Like

Android doesn’t support color shadow in card view.
It’s default color is grey.

1 Like