You are not logged in.

1

Friday, November 16th 2012, 11:51am

icon sizes on mobile devices

I've built a UI that looks fine on iPhone4, iPad 3, PC etc. When viewed on Android (HTC Desire C, ICS 320x480 screen). All the icons are too large. see screenshot.

the same xml is being used for all the devices. For example the logo in the top right is 150x45 pix and the xml is:

<plugin name="tr-1"
align="topright" x="35" y="35"
url="../hotspots/trek-logo.png"
alpha="0.8"
keep="true"
onhover="showtext('Virtual Tour created by Trek Wireless ',hotspottextstyle);"
onclick="openurl(links/trekwireless.htm)"
/>


Problem seems to be that all the icons are simply too big for the screen. Is there a simple way to rescale other than trying to detect the actual screen size (I'm currently using the desktop, tablet and mobile tags) and the scaling all the icons down?

Thanks in advance.

Tim
trek has attached the following image:
  • photo.JPG

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Friday, November 16th 2012, 2:44pm

Like:
Onloaded="If(isandroid, mul(scale,0.5));"

?

Tuur
http://www.virtualtuur.com
Skype:studiotuur

3

Friday, November 16th 2012, 3:45pm

Thanks Tuur

I'll try it, but wonder what happens on Android tablet when I dont want the icons to resize?

cheers
Tim

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Friday, November 16th 2012, 3:49pm

Make a choice or a chain of choices ...

http://www.krpano.com/docu/actions/#device

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

5

Monday, November 19th 2012, 1:40pm

Thanks Tuur

did some more testing...

altonloaded="if(isphone, mul(scale,0.5))); onloaded();" - works fine on iphone 4

altonloaded="if(device.html5, mul(scale,0.5))); onloaded();" - does not work on iphone or ipad

altonloaded="if(isandroid, mul(scale,0.5))); onloaded();" - does not work on HTC Desire C

altonloaded="if(device.android, mul(scale,0.5))); onloaded();" - does not work on HTC Desire C

Here is the button script:

<plugin name="tr-1"
align="topright" x="35" y="35"
url="../hotspots/trek-logo.png"
alpha="0.8"
keep="true"
altonloaded="if(isandroid, mul(scale,0.5))); onloaded();"
onhover="showtext('Virtual Tour created by Trek Wireless ',hotspottextstyle);"
onclick="openurl(links/trekwireless.htm)"
/>


using krpano 1.0.8.15 (build 2012-08-10)



any ideas? *huh*

cheers

Tim

6

Monday, November 19th 2012, 3:21pm

Hi,

Quoted

HTC Desire C, ICS 320x480 screen
Wow that's an Android device with a low resolution!
In this case it might be necessary to check also the screensize and apply a suitable scaling...

e.g. try:

Source code

1
onloaded="if(device.android, min(minscreen,stagewidth,stageheight); if(minscreen LT 400, set(scale,0.5));"


using krpano 1.0.8.15 (build 2012-08-10)
The device object was introduced in build 2012-10-05:
http://krpano.com/news/#releasenotes10815-2012-10-05

Best regards,
Klaus

7

Monday, November 19th 2012, 4:47pm

Thanks Klaus

I upgraded and retested. Could not get it to work with my android phone, I think the code is ok as I changed it to device.mobile and the icons were correctly 'shrunk' on my iphone. I suspect the HTC phone is somehow not identifying itself as an android device. Looks like I need to buy some more android devices to test on *sad* .

BTW after upgrading to krpano-v3-Build 2012-10-05 text created with textfield plugin appears on centre left of screen, once i select another view text returns to bottom left (where it is supposed to be)? any ideas. do not see the problem with 2012-08-10.

cheers
Tim

8

Wednesday, November 21st 2012, 9:09pm

Hi,
I suspect the HTC phone is somehow not identifying itself as an android device. Looks like I need to buy some more android devices to test on *sad* .
hmm... that might be possible, but would be a bit strange...
Are you testing the Flash or the HTML5 viewer?



BTW after upgrading to krpano-v3-Build 2012-10-05 text created with textfield plugin appears on centre left of screen, once i select another view text returns to bottom left (where it is supposed to be)? any ideas. do not see the problem with 2012-08-10.
No sorry, currently not...
Do you have a link to an example?

Best regards,
Klaus

9

Monday, December 10th 2012, 5:50pm

textfield bug in Build 2012-10-05

Hi Klaus

Sorry for the delay in getting back to you, re textfield bug, you can see the problem here:

http://www.trekwireless.co.uk/krpano-tes…d-bug/index.htm

If you view in safari text appears in correct place, switch to html5 (ie iPad) text is displayed in left centre.

Here is the xml I'm using:

<plugin name="titletext"
url="../plugins/textfield.swf"
keep="true"
align="bottomleft"
x="35" y="30"
autosize="left"
wordwrap="true"
background="false"
zorder="-1"
children="true"
html="TEST"
css="p{color:#FFFFFF; font-family:arial; font-style: regular; font-size:20;text-align:left; }"
effect="dropshadow(4,45,0x000000,4,1);"
/>



<action name="showname">
txtadd(plugin[titletext].html,[p],get(scene[get(xml.scene)].title),[p]);
</action>


Problem did not occur in previous release.

Thanks in advance *smile*

Cheers Tim