Hi,
I made a tab using horizontalManager. I want To change the background and text color and font of tab on focus and also i have to out focus change the colors and font back to normal.
Also, i need to keep a data in cache which will tell me the last screen from which user is coming while going through various screens. How i can achieve it.
please let me know.
As i am new to mobile domain, if posible please show me some sample or code change.
Following is code sample
Code:
public class LandingScreen extends MainScreen
{
//LabelField mostPopular = new LabelField("Most Popular",Field.FOCUSABLE|Field.FIELD_LEFT|Field.HIGHLIGHT_FOCUS);
private LabelField mostPopular;
private LabelField newlyAdded;
private LabelField allCategories;
private LabelField spacer1;
private LabelField spacer2;
public LandingScreen()
{
HorizontalFieldManager topTabManager = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL);
mostPopular = new LabelField("Most Popular",LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT);
newlyAdded = new LabelField("Newly Added",LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT);
allCategories = new LabelField("All Categories",LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT);
spacer1 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
spacer2 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
topTabManager.add(mostPopular);
topTabManager.add(spacer1);
topTabManager.add(newlyAdded);
topTabManager.add(spacer2);
topTabManager.add(allCategories);
add(topTabManager);
}
public boolean onClose()
{
Dialog.alert("Goodbye!");
//NewScreen pScreen = new NewScreen();
//UiApplication.getUiApplication().pushScreen(pScreen);
System.exit(0);
return true;
}
}