Having developed for Android since the launch of the G1, and having
spent the last 10-11 months writing Android apps full-time, the
layouts aren't actually that bad.

Actually, RelativeLayout isn't that bad. I've never had a layout
simple enough for LinearLayout or FrameLayout, and having spent a
decent amount of time in HTML-land, just the name TableLayout gives me
the willies.

The API itself still needs polishing. Bugs like TextView not being
able to ellipsize anything other than 2 lines, and cutting descenders
off if you mess with the line height are two glaring examples of
things that make Android look beta-ish, but neither one of those have
anything to do with the concept of a layout.

The tools are tolerable, but I wish there was a good way of pulling
them out of Eclipse. (Which would probably be difficult, since a
layout editor not only needs to know where all the project's bitmaps
are, but also has to deal with custom View subclasses and whatnot,
which implies a compiler and virtual machine at the very least)

Truthfully, without the concept of a layout, Android would be much
more of a pain to code for, since differing screen sizes and aspect
ratios would introduce all sorts of complications to even the simplest
UI.

HTML and Android's layouts exist as they do because of the constraints
of not knowing exactly what kind of container you're going to have to
fit your UI into. It means you'll have to wrap your head around
exactly how they abstract things away, but they exist as they do for a
good reason.

On Apr 5, 2:07 pm, Dianne Hackborn <hack...@android.com> wrote:
> On Tue, Apr 5, 2011 at 10:15 AM, Leo <allway...@gmail.com> wrote:
> > It is not just a matter of learning xml. I know xml fully well, and
> > haven't used the gui tool yet. I only create layouts with handwritten
> > xml. But when you encounter two attributes like "gravity" and
> > "layout_gravity" you scratch your head and  question why the names are
> > not more intuitive (for something that sound so close).
>
> This isn't really related to UI builder tools or the IDE, it is just an
> aspect of the platform APIs.  By convention, attributes with a "layout_"
> prefix are parsed by the parent layout manager.  So "layout_gravity" applies
> to the view's layout manager if it supports the gravity attribute,
> controlling how the layout of it happens.  "gravity" is just a regular
> attribute for the view, controlling its internal behavior; for example it
> tells TextView how to position the text inside itself.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to