I am currently working on a Kodular extension and trying to access the layout XML files of different screens. Could anyone confirm what the exact layout file name for Screen is? Is it something like screen_layout.xml or activity_screen.xml, or does it have a different name?
If i am correct, If you are developing a extension using Niotron you won’t find standard XML layout files like activity_screen.xml. Kodular screens are dynamically created, so there’s no direct XML layout file associated with a screen.
However, if u r trying to programmatically add views inside an extension, you should use:
ComponentContainer to get the screen’s root layout.
Form class to access the current screen.
If you still wants to reference a layout file, u may need to create a custom XML layout inside the extension itself and inflate it manually using LayoutInflater.
layout will be found after extension import in kodular before I need to build the extension. but it shows error. Is There any other way to connect layout with java code ?
I maybe wrong and strong with androud code but, Since you’re using Rush to build a Kodular extension, the issue arises because Rush does not support Android’s R resource system natively, May be.
Unlike Android Studio, where R.layout.layout_name is automatically generated, Rush compiles extensions without generating an R class for layouts, causing the R cannot be resolved error, in my view may be other extn devlopers may know mode deep and solution to your issue
May be this could help you,
Use LayoutInflater with an External XML File
Since R.layout.layout_name does not work in Rush, you need to manually load the layout from an XML file stored in assets and inflate it programmatically.
Steps to Fix:
Store your XML layout file in the assets folder inside your Rush project.