Created
June 30, 2011 21:59
-
-
Save jophde/1057372 to your computer and use it in GitHub Desktop.
nast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void fillShelves() { | |
setContentView(R.layout.records); | |
LayoutInflater mLayoutInflater = getLayoutInflater(); | |
int i = 0; | |
while (i != Records.this.aData.length()) { | |
LinearLayout recordShelves = (LinearLayout) mLayoutInflater.inflate(R.layout.record_shelf, | |
(ViewGroup) findViewById(R.id.records)); | |
LinearLayout recordShelf = (LinearLayout) recordShelves.getChildAt(recordShelves.getChildCount() - 1); | |
ImageButton record; | |
for (int j = 0; j < recordShelf.getChildCount(); j++) { | |
record = (ImageButton) recordShelf.getChildAt(j); | |
try { | |
record.setTag(Records.this.aData.getJSONObject(i) | |
.getString("sImageUrl-small")); | |
// switch(display.densityDpi) { | |
// case DisplayMetrics.DENSITY_HIGH: | |
// record.setTag(Records.this.aData.getJSONObject(i) | |
// .getString("sImageUrl-med")); | |
// break; | |
// default: | |
// record.setTag(Records.this.aData.getJSONObject(i) | |
// .getString("sImageUrl-small")); | |
// } | |
record.setImageResource(R.drawable.default_artwork); | |
i++; | |
} catch (JSONException e) { | |
e.printStackTrace(); | |
} | |
new API.DownloadImagesTask().execute(record); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment