[Android] Tiny cleanup regarding method indentation in GameListAdapter.

getItem() and getView were a little off-kilter with the rest of the class. Keeps things more consistent, etc.
This commit is contained in:
lioncash 2013-07-18 09:00:20 -04:00
parent a3e289e802
commit 2e92e3814e
1 changed files with 36 additions and 38 deletions

View File

@ -16,17 +16,18 @@ public class GameListAdapter extends ArrayAdapter<GameListItem>{
private int id; private int id;
private List<GameListItem>items; private List<GameListItem>items;
public GameListAdapter(Context context, int textViewResourceId, public GameListAdapter(Context context, int textViewResourceId, List<GameListItem> objects) {
List<GameListItem> objects) {
super(context, textViewResourceId, objects); super(context, textViewResourceId, objects);
c = context; c = context;
id = textViewResourceId; id = textViewResourceId;
items = objects; items = objects;
} }
public GameListItem getItem(int i) public GameListItem getItem(int i)
{ {
return items.get(i); return items.get(i);
} }
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView; View v = convertView;
@ -34,6 +35,7 @@ public class GameListAdapter extends ArrayAdapter<GameListItem>{
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null); v = vi.inflate(id, null);
} }
final GameListItem o = items.get(position); final GameListItem o = items.get(position);
if (o != null) { if (o != null) {
TextView t1 = (TextView) v.findViewById(R.id.GameItemTitle); TextView t1 = (TextView) v.findViewById(R.id.GameItemTitle);
@ -46,12 +48,8 @@ public class GameListAdapter extends ArrayAdapter<GameListItem>{
t2.setText(o.getData()); t2.setText(o.getData());
if(v1!=null) if(v1!=null)
v1.setImageBitmap(o.getImage()); v1.setImageBitmap(o.getImage());
} }
return v; return v;
} }
} }