pkdevbox / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

iPhoney specific tweaks (w/ patches) #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Not having access to an iPhone or iPod touch until yesterday, yet having
been developing for the platform for a while now (...), I've found myself
relying on Marketcircle's iPhoney app to get a "preview" of how the app
will look natively. Not the best, but better than Safari on a few specific
points (eg: Safari [mac] won't let us resize the window to less than 393
pixels wide manually...).

Anyway, there is a tiny contextual thing that made it a nightmare to use
until I tweaked iUI slightly.

Because iPhoney has the regular desktop safari scrollbar, loading an iUI
app in it that required vertical scrolling made the window's inner width
305 pixels instead of 320 pixels.

Because of this, and the fact that checkOrientAndLocation() is called every
300 milliseconds while checking for an exact width of 320 pixels, the
behavior went like this:

 * onload: iUI sees width as 305px so switches to landscape mode, which
makes the scrollbar disappear (though the "device is still in
portrait/profile mode)
 * now that scrollbar is gone, the inner width is seen as 320 px, which
makes iUI switch back to portrait/profile mode, and makes the scrollbar
reappear.
 * and so on, every 300ms, which creates a *dancing* effect (scrollbar
shows/hides). :p

The simple fixes I implemented, and do not seem to break the intended
logic, can be found in the attached patches.
I submitted one for iui.css and one for iui.js separately (both against
rev7 in /trunk) in case you find that the css-level tweaks are not
appropriate for general consumption.

On another note, this will also help with other [future] devices
potentially supporting iUI, with a different portrait screen width, which
echo's mobile safari HTML warning to use the "device-width" constant,
instead of a physical pixel width, in the viewport meta tag for "future
compatibility".

Hoping it'll make sense. :-)

Cheers,

Stephane Daury
http://tekartist.org/

Original issue reported on code.google.com by stephane...@gmail.com on 13 Oct 2007 at 1:56

Attachments:

GoogleCodeExporter commented 9 years ago
Note: The JS patch works well on its own, but ignore the CSS patch after all.

It has the side effect of messing with the scrollTo(0,1) to hide the location 
bar if
the page does not have enough content to allow for scrolling.

Original comment by stephane...@gmail.com on 14 Oct 2007 at 12:25

GoogleCodeExporter commented 9 years ago
Stephanie,
I cannot even start to understand your info.
can you tell me how I can change the HTML to "device width" constant??
I do not know where to go to make this change. Thanks, Trent
e-mail: trent.toensing@verizon.net

Original comment by toensing...@gmail.com on 7 Nov 2008 at 3:08