
i am developing an app in which i require custom lists as shown in above figure so that each list should hava a click event so when clicked it should navigate to other screen.and this should be displayed in middle of tab bar and status bar in the screen.
Each list should contain details of name of sender ,message,date and rating image in format as shown in figure.when i searched in google i got below code but this is not giving required formatted output.
MyScreen.java
public class MyScreen extends UiApplication
{
public static void main(String[] args)
{
ListFields theApp = new ListFields();
theApp.enterEventDispatcher();
}
public MyScreen()
{
pushScreen(new ListFieldScreen());
}
}
class ListFieldScreen extends MainScreen
{
private ListField _listField;
private Vector _listElements;
public ListFieldScreen()
{
setTitle("List Field Sample");
}
}
_listElements = new Vector();
_listField = new ListField();
ListCallback _callback = new ListCallback();
_listField.setCallback(_callback);
add(_listField);
initializeList();
private void initializeList()
{
String itemOne = "Name";
String itemTwo = "Message";
_listElements.addElement(itemOne);
_listElements.addElement(itemTwo);
reloadList();
}
private void reloadList()
{
_listField.setSize(_listElements.size());
}
listcallback.java
private class ListCallback implements ListFieldCallback
{
public void drawListRow(ListField list, Graphics g, int index, int y, int w)
{
String text = (String)_listElements.elementAt(index);
g.drawText(text, 0, y, 0, w);
}
public Object get(ListField list, int index)
{
return _listElements.elementAt(index);
}
public int indexOfList(ListField list, String prefix, int string)
{
return _listElements.indexOf(prefix, string);
}
public int getPreferredWidth(ListField list)
{
return Display.getWidth();
}
}
i came to know that i have to use table view.but i am not able to understand how to implement that to this format .please help me i am new to blackberry development,any samples or suggestions are appreciated.