createRow(parent, index, (MovieItem)get(index));
}
protected void createRow(BView parent, int index, MovieItem item) {
BSkin skin = getBApp().getSkin();
BSkin.Element element = null;
if (iconResource != null) {
element = skin.get(iconResource);
} else {
//get the icon based on the movie item status
if (item.isInQueue()) {
element = skin.get("dvdInQueue");
} else {
element = skin.get("dvd");
}
}
int iconWidth = 0;
if (element != null) {
iconWidth = element.getWidth();
BView icon = new BView(parent, 20, 0, element.getWidth(), parent.getHeight());
icon.setResource(element.getResource());
}
BText text = new BText(parent, iconWidth + 30, 0, parent.getWidth() - 70, parent.getHeight());
text.setFlags(RSRC_HALIGN_LEFT);
text.setShadow(true);
if (font != null) {
text.setFont(font);
}
int maxWidth = parent.getWidth() - 60;
if (showingRatings) {
BSkin.Element star = skin.get("starSmall");
BSkin.Element starGlow = skin.get("starGlowSmall");
int width = 5*(star.getWidth()+1);
maxWidth -= width;
RatingsView ratings = new RatingsView(parent,
maxWidth, 0, width, parent.getHeight(), star, starGlow, 1);