3

This is driving me insane at times, why don't they just provide XML snippets of what they are showing?

Example: http://developer.android.com/design/building-blocks/lists.html

It'd be nice to just know how they are using for the 2 lined list item layout.

Peter Fox
  • 1,809
  • 2
  • 20
  • 34

1 Answers1

0

SDK sources.

There are many examples, metrics and everything you need. Including drawables. Shamelessly copy them to your project keeping the copyright notice and that's all.

But of course, you'll need to study the code just a bit...

By the way, the 2 line list item seems to be a medium and small text, 4dp (or 8) between them, and 16 do margins on top and bottom. The left margin I think is 8dp.

There is also a standard R.layout including a two_line_list_item, but To put stuff on the sides you'll need to go custom. The header is the standard list header which is also available under R.layout.*

It follows the design guides. Nothing fancy.

davidcesarino
  • 16,160
  • 16
  • 68
  • 109
  • I tried the two line list item from the Android.R.layout namespace, appeared to be totally different then the example they use. The problem with Diving through the SDK examples tho is I'd have to go start building and deploying all the APKs which seems overkill. – Peter Fox May 20 '13 at 14:39
  • Deploy all apks?? All I suggested was looking at sources, copying the layout that better suits you and change a few details to fine tune it for your needs. The android.R entity would work here. I even guessed margins just by looking, now you need to experiment yourself. If you don't understand the layout by simply looking at the code or don't know how to copy a file to your project, then you should be doing your homework. You are basically asking for us to do this "overkill" (I.e., an euphemism for "homework") for you. – davidcesarino May 20 '13 at 16:29
  • Yeah but there's not a great deal of emphasis in the SDKs on layouts sometimes in my opinion, plus can't see what it will look like until it's rendered, ok Android Studio does it well enough now but it's just a bit annoying, why create a screen shot in an example that doesn't exist in the SDK and if it does or doesn't exist state so with reference to what it is? or maybe use something like gist to share those layouts in the site documentation when they're custom. I just wanted to know the layout and text colour choices etc. so I could match the operating system as best a possible. – Peter Fox Jun 10 '13 at 11:40
  • "Been there, done that." See [one of my previous questions](http://stackoverflow.com/q/9678236/4896070), with a more restricted scope. While a layout repository (or better, SDK integration for fast delivery of those typical "recipes", so you don't create all "by hand") would be nice, point is the layouts and every color combination that is used in the system are readily available in the SDK sources. There is also the `./samples` folder. Better than that and you start to enter the [book](http://www.amazon.com/dp/1118387287/?tag=stackoverfl08-20) and tutorials area. – davidcesarino Jun 13 '13 at 03:05