Show alert with Indeterminate progress indicator Nokia Full Touch j2me - java-me

Does anyone know how to show a spinner for progress bar in a j2me alert?
Here is my piece of code so far:
loadingDialog = new Alert("Please Wait","Please Wait.",null,AlertType.INFO);
Gauge gau = new Gauge( null, false,
Gauge.INDEFINITE,
Gauge.CONTINUOUS_RUNNING );
loadingDialog.setIndicator(gau);
loadingDialog.setTimeout(500000);
displays.setCurrent(loadingDialog);
I am getting a horizontal line (like a slider). What I want is a spinner in place of it.
http://www.developer.nokia.com/Resources/Library/Full_Touch/ui-components/progress-indication.html
The second image (labelled non interactive gauge) of the link is what I am looking for:

The way how you create Gauge looks about right, in accordance with instructions given at Nokia page you refer as well as with Gauge API javadocs (available online):
CONTINUOUS_RUNNING
The value representing the continuous-running state of a non-interactive Gauge with indefinite range.
...
INDEFINITE
A special value used for the maximum value in order to indicate that the Gauge has indefinite range.
Explanation at Nokia page (somewhat vague) suggests the most likely reason for the issue you describe is that Nokia shows spinner only in forms, not in alerts:
- Indefinite gauge in Java Form uses spinner.
- An Alert uses a "barber shop roll" (animated bar of fixed length).
The way to test above assumption is to put Gauge like yours into the Form instead of Alert and see how device / emulator displays it.
If Form shows spinner, then the most straightforward workaround is to use Form instead of Alert. In this case, since Form lack "dismissal" feature provided by Alert, you would have to implement it yourself - eg by using TimerTask to schedule form replacement with previous screen.

Hehehe, the clue is in the link you gave --
Java Alerts do not use spinners due to layout constraints.
So it's not possible!

Related

How to initiate customer value for screen in touchGFX

I have build an application using touchGFX and STM32 based on STM32F746 Disco kit.
My application have some screens with some value to display on screen. These value can setting and change by user. Every time when these value change I will save them to eeprom.
When I turn off power and turn on again, I have read these value before start display screen, but them can't to load to screen until I pressed some button on screen (pressed button I will fresh this screen).
So my question:
How can I initiate customer value for screen and display them when startup in touchGFX
Thanks.
This is simple, just load your data in presenter->activate().
I suggest you read the article on back-end-communication. It explains how to propagate values from your Model (e.g eeprom).
https://support.touchgfx.com/4.18/docs/development/ui-development/touchgfx-engine-features/backend-communication
From TouchGFX Designer you'll find several examples that do something similar from an F769-DISCO board (sample a button and propagate that value to the UI).

AEM touch ui dialog 6.3 - Validation Error Icon is overlapping Description icon

I have a title component(touch-ui) in my project and made the title field mandatory by setting required(boolean) – true at the title property level. Now, when we save the dialog with an empty title field, validation fires up, but the triangular icon overlaps the description icon in the component. See the screenshot attached. Is there any way to resolve this?
Seeing the same behavior in We.retail title component.
It's the same in AEM 6.4. I've kind of assumed this was by design, so that more attention is drawn to the error.
If you look at the JavaScript behind the validation logic, you'll notice that the description icon receives the u-coral-screenReaderOnly CSS class as soon as a validation error appears, which results in its disappearance. It's not that the error icon overlaps the info one. The latter is explicitly hidden from sight.
This appears to be part of the Coral UI 2 client library. This isn't something you could fix on your own (an attempt to do that would be tricky and not maintainable). If you need this behaviour changed, you could try your luck contacting Day Care. It does look like a deliberate feature though.

How to change Nokia full touch lwuit form header color

I want to to change the header color of nokia lwuit based full touch form and i have tried setTitleComponent method but it is not working. Please also check the following link
http://projects.developer.nokia.com/LWUIT_for_Series_40/wiki/UsingSeries40FullTouchFeatures
in which it is mentioned we cannot style the header but is it means we cannot change the bgcolor as well or put custom images in the header?
Note that when using LWUIT for Series 40 port, the default way of running LWUIT apps is a normal-size canvas in Series 40 full touch devices. Thus the Series 40 chrome shows on top of canvas. And there is no way of customising it (other than the title text).
If you want to provide branding elements to the title, the options are:
1. create an additional lable below the Series 40 headerbar
2. run the application in full-screen. We are planning to create a high-level API for this but currently it is already possible using the following trick:
((GameCanvas) (javax.microedition.lcdui.Display.getDisplay(this)).getCurrent()).setFullScreenMode(true);
In the latter option you will of course lose the Series 40 full touch layout.
Use lwuit source, you can change method visibility if required, this is example what i used to use gradient color
form.getTitleComponent().getStyle().setBackgroundType(Style.BACKGROUND_GRADIENT_LINEAR_VERTICAL);
form.getTitleComponent().getStyle().setBackgroundGradientEndColor(Color.GRADIENT_END);
form.getTitleComponent().getStyle().setBackgroundGradientStartColor(Color.GRADIENT_START);
form.getTitleComponent().getStyle().setFgColor(Color.WHITE);
form.getTitleComponent().getStyle().setPadding(10,10,0,0);
form.getTitleComponent().getStyle().setFont(font);
Here Color is my custom class that is used for color code, you can use your one.

LWUIT Wrong size of scrollbar recalculate?

I'm using LWUIT on a Nokia Device.
The Form which is displayed contains several different LayoutManagers(), Flow+Y_AXIS and many Labels. Those get added in a Class which parses an XML file. This class gets returned and is displayed by another Class.
The scrollbar is sometimes "too short", meaning there's still text on the form which is cutoff, or hidden under the soft buttons.
Is there a function to have the layout recalculated?
I tried form.getContentPane().layoutContainer(); and form.invalidate(); form.revalidate();
Thanks in advance
Revalidate is enough to layout, it is invoked implicitly when showing a form. If you are using the scrollbar in SVN should be pretty accurate for all lengths of data, if you have a compiling working test case where the scrollbar isn't accurately calculated you can use the LWUIT issue tracker ( http://java.net/jira/browse/LWUIT ) to submit a bug report and attach said test case.

Using multiple UIWebViews in a UIScrollView

I am using 5 UIWebViews in a UIScrollView to show the result of my game. Intention is to allow the user to scroll through the results screen. I had a problem where the UIWebViews won't load when scrolled to the next page. This means the first page will load successfully however when you scroll to Page 2, you will see a white blank page. Page is loaded as I can see the alert which was given in all the 5 pages, but it won't show.
I tried a workaround as mentioned here
inserting various views into UIScrollView
http://pinchzoom.com/blog/items/view/1386/one-of-the-problems-with-the-uikit-at-the-moment-is-an-issue-embedding-a-uiwebview-within-a-table
This fixed my problem, however when I submitted the app to iTunes, it got rejected with the following comment.
"3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs."
The non-public API that is included in your application is _documentView
I would like to fix this issue and resubmit. Can someone help please ?
Thanks
Jugs
Just use one WebView for all results (which will scroll if it doesn't fit into the screen).

Resources