Is it possible to enable hover in the simulator? - codenameone

I was thinking about creating sort of animated screenshots of my app running in the simulator and created some code which is able to record an animated GIF image where I am also able to draw the current pointer as a gloved hand on top.
Then I realised it woud be much better if the pointer was shown even if it is not down.
Therefore - is it possible to enable hover in the simulator?

We have the ability to show it in the JavaSE port but that isn't exposed in the simulator. If you change the compile path to the project you can use:
JavaSEPort.setInvokePointerHover(true);

Related

CodenameOne GUI Builder Button Image Problem

The CodenameOne GUI Builder seems to have a mind of its own..
I created a simple form with a button that has a green image when it is enabled and red when disabled. In my code I use another button to call an event function that enables and disables the button.
This seems pretty simple, yet it doesn't work reliably. The button's image changes between green and transparent as it toggles. Other times it works correctly. After I make a change I always do a 'save' and a 'regen' in the GUI Builder and then 'Clean and Build' in NetBeans.
Also, the size of my image is much smaller in the simulator than in the GUI Builder.
GUI Builder is sooo frustrating; I wish I could just code the for using html and css :(
Any suggestions would be appreciated.
Please see my video capture (https://siscocircuits.com/cno_gui_builder_problem.wmv) which shows the problem in action.
You can write code in Java to represent the GUI. In fact that's what the GUI builder does under the surface and that's what most of our demos do. We also support a form of CSS.
The problem with the image sizes is probably due to the fact that you used regular images instead of multi-images to adapt to the various DPIs. I suggest reviewing the generated code to see what went wrong it's a bit difficult to see in the video but you can put a breakpoint in the debugger and step over the generated code.

Tips to make Codename One PeerComponents z-ordering working

I created a PeerComponent, that is a port in Codename One of the Horizon Camera SDKs. At the moment, it simply shows a live-preview of the camera.
I tried to add a Label over the PeerComponent: the Label is on top only in Android. On iOS, the Label is on bottom (that means invisible).
I've done a lot of trials to get a correct z-ording on iOS, without success.
My question is which tips, suggestions or checks can I do to make z-ordering working properly on iOS also. Thanks.
Normally it should "just work", there is no special treatment. I think horizon paints in an area we rely on and doesn't paint when we expect it to. Looking at their sample code I see that they reference top and bottom elements which might allow working around this.

Change of orientation performance issue - codenameone

when orientation changes in android, native android call the destroy method and total new layout is to be made as far as I know. But I think codenameone doesn't do that which is a great thing. But when I checked the cn1 app in devices while changing from portrait to landscape a blank screen is seen for a while and then the orientation changes.
My Problem is that when I have many more components displayed in a form,
the blank screen appears for a longer duration and sometime it hangs. Does it
happen as I don't use Orientation listener methods etc or is there anything I
can do to solve this issue?
I just tried this on my device and it worked fine for the latest build on my Android 6 device. There was the rotation animation from Android where the screen rotated into its new place.
I'm guessing the rendering of your screen is so slow that Android takes too long to draw it and ends up drawing a black screen instead so it can proceed with the animation.
I can't benchmark an application remotely but I suggest going over the performance of your app and making sure it is truly optimized.

Simulator options won't show in Xcode 6.4

I don't get the option to run my app on a certain simulator or anything. I'm trying to upload my app to iTunes Connect but it won't even let me.
Try increasing your screen resolution, or making the Xcode window wider. Then it will reappear.
If you can't do either of those (do to screen resolution constraints), then use the Product menu and then the Destination sub-menu as a workaround.
And by the way, this looks like a duplicate Question #31318316

How to force landscape on a Flash builder mobile app

I am building a mobile application using Flash Builder. I am testing on a Motorola Xoom. When the app opens on the attached Xoom it opens with the correct orientation (landscape), but when it opens on the computer in the emulator it is backwards (Portrait).
I have specified the ratio and orientation in the *-app.xml:
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
I'm assuming it is a bug but it is possible that I am missing something or that there may be a fix.
In my case, neither was working. So, for the desktop version, I've made an ugly thing: duplicated the aspectRatio property above the others, after title property. I don't know if the position of the property matters, but that way it worked.
There is just one problem with this approach: when building the debug version of your application all works fine (including in mobile), but when you build the release version, an error occurs saying that the aspectRation property is unexpected. Just remove one of them and the build will work.
Just for the register, to make it work in mobile, I had to set the property aspectRatio in the code too, like this:
stage.setAspectRatio(StageAspectRatio.LANDSCAPE);

Resources