On Thu, Dec 3, 2009 at 3:48 PM, Mark Wyszomierski <[email protected]> wrote:
> Hi Justin,
>
> I was contemplating writing my own layout manager for this task, but
> don't know if it's necessary. I have a list of 8 panels to show,
> whether they all fit on screen or not (they're housed in a ListView).
> This is like a default set of buttons:
>
>  "Apple"
>  "Orange"
>  ...
>  "Grape"
>
> If I can see that the screen is tall enough to hold a few additional
> items, I'd like to add one or two additional panels:
>
>  +=
>  "Lemon"
>  "Pear"
>
> so it's not critical, but would be nice if I could maximize the number
> of elements in the list (without scrolling) before the UI is displayed
> for the first time,
>
> Thanks

I handle the different resolutions like this:

private Display defaultDisplay;
private int displayHeight;
private boolean extraTall;

[...]

defaultDisplay = getWindow().getWindowManager().getDefaultDisplay();
displayHeight = defaultDisplay.getHeight();

extraTall = displayHeight > 480;

if( extraTall )
{
  // make layout changes here

}

The same can be done with regards to landscape mode and width.


-- 
Greg Donald
http://destiney.com/

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

Reply via email to