Skin for Samsung Galaxy S3

72 views
Skip to first unread message

aimee

unread,
Dec 23, 2013, 7:33:20 PM12/23/13
to codenameone...@googlegroups.com
Where do I get the skin for this phone? It is not under More...


Shai Almog

unread,
Dec 24, 2013, 1:06:45 AM12/24/13
to codenameone...@googlegroups.com
We don't have skins for all phones, in terms of resolution it should be roughly the equivalent of the HTCOne.

aimee

unread,
Dec 26, 2013, 6:38:01 PM12/26/13
to codenameone...@googlegroups.com
I tried HTCOne skin but the result on the actual Samsung phone is still different.
I have issue with the button height on Android only so I need to set the preferred height which works on HTCOne skin but still does not work on Samsung Galaxy S3. The button border is not set to null. Please see attached.

 if (ios) {
                btn.setPreferredW(335);
            } else {
                btn.setPreferredW(310);
                btn.setPreferredH(68);
iphone.png
htcone before.png
htc one after.png

Shai Almog

unread,
Dec 27, 2013, 1:39:47 AM12/27/13
to codenameone...@googlegroups.com
Using setPreferredW/H is HIGHLY discouraged. setPrefferedSize() is also problematic.
Testing for a specific device is usually a mistake, you should test for density or work with constraints.

If you need to do something like this try doing this:
Dimension d = btn.getPreferredSize();
d
.setWidth(Math.max(d.getWidth(), Display.getInstance().convertToPixels(10, true)));
btn
.setPreferredSize(d);

What I do here is two main things, I use the existing preferred size and never go below it.
I use millimeters instead of pixels in the preferred size which should give me a reasonable approximation across devices.

Notice there is no need for iOS/Android specific code.
Reply all
Reply to author
Forward
0 new messages