02-09-2012 04:30 PM
Hello,
I really need help to draw a separators between the list items, and to add icon in the begining.
Im desperate please help
Thanks
Solved! Go to Solution.
02-09-2012 11:35 PM
What have you tried already?
Seems to me that if you are using ObjectListField, you have to implement the drawRow anyway, simply paint the bottom line on each row.
02-11-2012 08:28 AM
According to your requirement,
1. Download the AdvancdUI zip file from below link and extract it;
Advance UI Components from GITHUB
and take only ListStyleButtonField.java file from it and add to your application;
and
take this sample code: SanpleScreen.java
public class SampleScreen extends MainScreen implements FieldChangeListener
{
ListStyleButtonField listStyleButtonField[];
Bitmap bitmap=Bitmap.getBitmapResource("icon.png");
int size=0;
public SampleScreen()
{
size=10;
createGUI();
}
private void createGUI()
{
VerticalFieldManager vertical=new VerticalFieldManager(VERTICAL_SCROLL| VERTICAL_SCROLLBAR);
listStyleButtonField=new ListStyleButtonField[size];
for(int i=0;i<size;i++)
{
listStyleButtonField[i]=new ListStyleButtonField(bitmap, "ListField"+(i+1), null, Field.FIELD_VCENTER)//Parameters: leftIcon, label, rightIcon, style;
{
protected boolean navigationClick(int status, int time)
{
fieldChangeNotify(0);
return super.navigationClick(status, time);
}
};
listStyleButtonField[i].setChangeListener(this);
vertical.add(listStyleButtonField[i]);
vertical.add(new SeparatorField(SeparatorField.LINE_HORIZONTAL));
}
add(vertical);
}
public void fieldChanged(Field field, int context)
{
for(int i=0;i<size;i++)
{
if(field==listStyleButtonField[i])
{
Dialog.alert("You Clicked on "+(i+1)+"th Field.");
}
}
}
}
when I run this I got like this:
Try to run this sample;
==================================================
Feel free to click LIKE button if the solution is helps you;
02-14-2012 10:39 AM