Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using the layout XML directly instead of converting to JSON? #17

Closed
curioustechizen opened this issue Jan 30, 2015 · 12 comments
Closed
Labels

Comments

@curioustechizen
Copy link

One more advantage I can think of this is you already have an inflater provided by the Android system that understands XML.

@giorgosera
Copy link
Member

+1

1 similar comment
@vbauer
Copy link

vbauer commented Jan 30, 2015

👍

@placeybordeaux
Copy link

I just stumbled upon this repo and have nothing invested, but I am a bit confused why json is being used at all, why isn't this just pure xml?

Only idle curiosity, I honestly don't know.

@giorgosera
Copy link
Member

We started developing in JSON format because we needed it for our team purposes at Avocarrot. Having said that, we are open to seeing this working for XML too.

@ragunathjawahar
Copy link

Yeah, why not use the same XML document? That would mean even less work 😉

@giorgosera
Copy link
Member

We needed JSON for other purposes too so are stuck with it I guess:)

@ragunathjawahar
Copy link

@giorgosera If that's the case, thank you for sharing this out in the open 👍

@gaara87
Copy link

gaara87 commented Mar 4, 2015

One of the main reasons why XML cannot be used "directly" is because LayoutInflater does not support this :-

For performance reasons, view inflation relies heavily on pre-processing of XML files that is done at build time. 
Therefore, it is not currently possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; 
it only works with an XmlPullParser returned from a compiled resource (R.something file.)

On the other hand, if you want to parse through the XML and create the view manually like what is being created, you can :) As much as i'd LOVE for android to accept XML directly, it doesn't, so it doesn't matter if it is JSON or XML, there is an intermediate step which is compulsory.

@ragunathjawahar
Copy link

@gaara87, I understand that LayoutInflater requires pre-compiled layout resources. However having the library to accept XML would make developers' lives easier.

@joddiy
Copy link

joddiy commented Dec 2, 2015

maybe you can try react-native

@hadidez
Copy link

hadidez commented Jun 18, 2016

👍

@mostafabarmshory
Copy link

Actually, it is not matter to use json or xml (there are the same). If the view description data (which is created with xml or json) is independent of special framework then it is possible to cover others too.

For example, it is possible to support IOS (see #24)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests