How to change Nokia full touch lwuit form header color - java-me

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.

Related

How to display the restricted rows in ListView

I have taken the horizontal list view.I am able to display the images in list view.It is displaying all the images horizontally.But my requirement is i need to show only 4 images in a row.If there is 5th image then it should come in the second row(for each row there should me only 4 images).How can i do this.Actually i am struck up here.I think you are able to understand my problem.Thank You.
I am using JavaFX 2.x
As far as I understand, if you need to allocate only 4 images in a row, and the 5th+ images transfer on the next row, you will be able to use a GridPane :
http://docs.oracle.com/javafx/2/layout/builtin_layouts.htm
where you could obviously set position of ImageView. Seems, it works so : you determine your own ListCell, and set its graphic node to be a gridpane, and configure grid pane as you wish.
Also, take a look on a flow pane, possibly, it will help you.
If I'm wrong with a recipe, please, try to describe your trouble again (code/screenshot). I'm not comletely sure about it.

Show alert with Indeterminate progress indicator Nokia Full Touch j2me

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!

how to set lwuit textarea scrolling false

I want to add large string content to a container dynamically.
There are 60 different contents(strings) to be displayed in this container.
To add the string to container, I am adding a TextArea(empty border with 100% transparency).
The problem is that TextArea offers scroll and I do not want it to scroll. Instead I want to grow(increase height) according to content. I am unable to achieve this.
Can you help me out with this?
Or can I use any other component for the purpose?
I am using LWUIT with J2ME.
You can derive text area and return false for isScrollableY() although it should generally work seamlessly even if you don't do that (since your parent layout is scrollable). Is it possible you changed the text area and don't revalidate the parent form on the EDT?
There are problems with text area layout when it is modified by a separate thread (race condition with the layout code).
First put the TextArea.setSingleLineTextArea(false) , and grow by content true.

How can a graphic be placed in the OneUI .lotusBanner area using the Application Layout Control

I am using the Extension Libraries Application Layout Control and need to have a banner graphic placed in the .lotusBanner div on the right. How can this be done as it seems that the Application Layout Control can't be modified.
You could use the utilityLinksFacet on the extended control that Steve Pridemore did.
http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&documentId=CED2E61A75526CD086257997006DA95B
or you could use onload javascript to add it.
I was able to place a graphic in the upper right of the Application Layout Control in the Banner area by doing the following:
In the control under the Banner > Utility links I added a Basic node. For the node I specified the href and image. This worked and placed the image n the correct spot.
Artifacts of this were the location of the Banner Application links. To remedy this I used some CSS for the .lotusBanner ul.lotusLinks {margin-top: 45px;position:absolute;}
The margin-top was to push the links down so I could enlarge the logo that is used by the Application Layout Control.
The applicationLayout control in ExtLib is, as you have found out, locked down to only allow certain aspects of the configuration to be changed by the developer. You can add links to different sections of the applicationLayout but nothing beyond that.
One possible alternative is to NOT use the applictionLayout control itself but create your own approximation of it in a custom control, You would need to add all the necessary panels/divs with the special oneUI2 classes in all the correct places and then add editable areas and callbacks within these panels for the parts that you would want to customize throughout the application. All of the other sections in the applicationLayout control, like the bannerUtilityLinks are created using the ListofLinks control that is also found in the Extension Library.

How do I theme a MonoTouch application?

I'm doing an MonoTouch application and I would like to apply a theme. (So I don't have to have go around and apply a custom color and style to each view background and button.)
Is there any easy way to do this? So should I be setting the color manually, and use a helper class to determine which color?
e.g.
_myButton.Color = ThemeHelper.GetButtonColor();
You may want to take a look at UIAppearance in iOS 5+. It allows devs to set styles for UI elements globally as in the following example:
UIButton.Appearance.BackgroundColor = UIColor.Blue;
For more info, here's a good blog post: http://tirania.org/monomac/archive/2011/Oct-14.html

Resources