android-layout icon indicating copy to clipboard operation
android-layout copied to clipboard

Any up-to-date alternatives of this?

Open Aditya94A opened this issue 5 years ago • 4 comments

Are there any alternatives of this repo? Or something else that accomplishes android xml layout rendering in the browser?

Aditya94A avatar Aug 26 '20 06:08 Aditya94A

Nothing that I've worked on, but maybe others have tackled this. It's a thorny problem once you get deeper into it. O_O

Good luck!

phoebejaffe avatar Aug 26 '20 15:08 phoebejaffe

Indeed! Even more so with all the fancy new stuff (which keeps updating frequently).

Can you share more about you general experience building this? Would love to learn more. Might also help those (like me) looking to find/build something similar.

Like, what was your use case for building this? What were the biggest challenges? Do you think any use-cases for such a project still exist?

Aditya94A avatar Aug 26 '20 15:08 Aditya94A

Sure -- I built it for an Android course when I worked at Udacity. Usually, lesson 1 of Android courses is "Install Android Studio", and then everyone gives up. The goal with this was to get students doing something and seeing visual results before they had to go through the pain of installing Android Studio, so they'd be more invested and more likely to not give up during the install.

Challenges... reconciling layout systems is really hard. Like, you have to more deeply understand why things are they way they are in both worlds, how they are different, the common (and uncommon) edge cases, and then build something that somehow bridges that divide. But sometimes it isn't actually bridgeable.

For example, Android lets you position an element with respect to another element, and that doesn't exist in CSS. So I had to do a layout pass myself with JS, but then I had to detect infinite loops in that hierarchy. I don't remember why, but there was an edge case that necessitated a second layout pass... anyway, it gets deep and difficult quickly.

If you have a use case, try and definine it very specifically. What does your project need, and more importantly, what does it not need to support. That's how you'll land in a spot where your problem is possible, maybe even tractable.

I'm sure there are use cases... but your thoughts are as valid as mine. I haven't thought of this project in at least a year, and haven't contributed to it in over 5 years. But absolutely feel free to fork it, rip it apart, steal from it... whatever you want to do. That's one of the delightful aspects to open source. If you build something cool with it, LMK :D

What's your project or vision? How'd you come across this repo, and what are you looking to build or find?

phoebejaffe avatar Aug 26 '20 19:08 phoebejaffe

Side note, I just clicked through to your github profile. You've worked on several chrome extensions! I've built too many of those too. It's a both delightful and terrible world. 🤣😂😭

phoebejaffe avatar Aug 26 '20 19:08 phoebejaffe