i tried to do int screenWidth=getWindowManager().getDefaultDisplay().getWidth(); gallery.scrollBy(width/2,0);
logically i assumed that this will scroll gallery half a screen away so it will fill width of screen completely - but it scrolled too much. in fact almost to the end of gallery. any idea why? for 320x240 resolution it seems i must divide by 4 and not by 2 to make it work *almost* as it should, but its such strange constant i don't like it.... so anyone knows how can i calculate how much to scroll? On Apr 1, 2:46 am, Selmi <[EMAIL PROTECTED]> wrote: > my problem is that when activity which containsgalleryis shown then > first item is in middle of screen. i want to move it to left such way > that it would be fully visible but on the edge ofgalleryview > > i can do it usinggallery.scrollBy(x,0); where x is calculated from > width of rectangle occupied bygalleryon screen and width of item > > problem is that so far i must have x as constant different for all > screen sizes. i would like to make it completely dynamic, but i don't > know how to calculate this number - returnedgallerywidth is always > 0, its hit rectangle is filled with zeros etc.... > > any idea? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---