Overflow Menu commands render differently on device and simulator

30 views
Skip to first unread message

Bryan Buchanan

unread,
May 23, 2016, 6:21:09 PM5/23/16
to CodenameOne Discussions
The "device" screenshot is on an Android 5.1 device.

I don't have any platform overrides in the theme, so it should be rendering identically on a device and simulator.

The crimson background is a "Menu" selector. (Only has an "Unselected" selector defined). The command items are "Command" selectors, with Unselected, Selected and Pressed versions. They have Foreground Color and Transparency set.
device-2016-05-24-081004.png
Screenshot - 240516 - 08:10:46.png

Shai Almog

unread,
May 24, 2016, 12:00:07 AM5/24/16
to CodenameOne Discussions
That's an Android 2.x simulator and I'm guessing an Android 4+ device. Try the Xoom skin to reproduce this as closely as possible.

Bryan Buchanan

unread,
May 24, 2016, 12:25:48 AM5/24/16
to CodenameOne Discussions
You are correct - using a different device skin gives same behaviour on device and simulator.

Question now is: how to make background of commands same as background of popup. The popup seems to be composed of a Menu, CommandList and Commands and try as I might, I can't get them to play nice.
Screenshot - 240516 - 14:16:22.png

Chen Fishbein

unread,
May 24, 2016, 1:30:12 AM5/24/16
to CodenameOne Discussions
This is probably the border of the "Command" try to put an empty border on the "Command" style

Bryan Buchanan

unread,
May 24, 2016, 3:33:03 AM5/24/16
to CodenameOne Discussions
Thanks -  but I still can't get the selected/pressed style to work.

I have

Menu -> Image Border to get crimson background (Unselected)
CommandList -> Empty Border, Background None (Unselected and Selected)
Command -> Empty Border, Background None, Foreground Color, Tansparency (0) (Unselected and Selected) - tried Pressed also but had no effect.
Screenshot - 240516 - 17:17:59.png
Screenshot - 240516 - 17:24:57.png

Chen Fishbein

unread,
May 24, 2016, 3:37:49 AM5/24/16
to CodenameOne Discussions
Try the  "CommandFocus" style

Bryan Buchanan

unread,
May 24, 2016, 3:50:40 AM5/24/16
to CodenameOne Discussions
Champion - thanks Chen, works fine.

For anyone else interested, this is the recipe I used:


Menu -> Image Border to get crimson background (Unselected)
CommandList -> Empty Border, Background None, Margin 0, Padding 0 (Unselected and Selected)
CommandFocus -> Transparency 0 (Unselected)

Command -> Empty Border, Background None, Foreground Color, Tansparency (0) (Unselected and Selected)


On Tuesday, May 24, 2016 at 5:37:49 PM UTC+10, Chen Fishbein wrote:
Try the  "CommandFocus" style
Reply all
Reply to author
Forward
0 new messages