StkMenuAdapterpublic class StkMenuAdapter extends android.widget.ArrayAdapter Icon list view adapter to show the list of STK items. |
Fields Summary |
---|
private final android.view.LayoutInflater | mInflater | private boolean | mIcosSelfExplanatory |
Constructors Summary |
---|
public StkMenuAdapter(android.content.Context context, List items, boolean icosSelfExplanatory)
super(context, 0, items);
mInflater = LayoutInflater.from(context);
mIcosSelfExplanatory = icosSelfExplanatory;
|
Methods Summary |
---|
public android.view.View | getView(int position, android.view.View convertView, android.view.ViewGroup parent)
final Item item = getItem(position);
if (convertView == null) {
convertView = mInflater.inflate(R.layout.stk_menu_item, parent,
false);
}
if (!mIcosSelfExplanatory || (mIcosSelfExplanatory && item.icon == null)) {
((TextView) convertView.findViewById(R.id.text)).setText(item.text);
}
ImageView imageView = ((ImageView) convertView.findViewById(R.id.icon));
if (item.icon == null) {
imageView.setVisibility(View.GONE);
} else {
imageView.setImageBitmap(item.icon);
imageView.setVisibility(View.VISIBLE);
}
return convertView;
|
|