Skip to content

Commit

Permalink
Use 100000 as start key for album images
Browse files Browse the repository at this point in the history
  • Loading branch information
bduncavage committed May 31, 2015
1 parent 3f0c1c9 commit 5efa410
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void load() {
vm.primary = "Primary " + i;
vm.secondary = "Secondary " + i;
vm.tertiary = "Tertiary " + i;
vm.imageUrl = "http://rdiodynimages0-a.akamaihd.net/?l=a" + (i + 100) + "-0";
vm.imageUrl = "http://rdiodynimages0-a.akamaihd.net/?l=a" + (i + 100000) + "-0";
}
viewModels.add(vm);
if (vm.layout == R.layout.list_group_heading) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ protected void onItemAdded(ListItemViewModel viewModel, int position) {
if (position > 0) {
int rand = new Random().nextInt() % 3;
// 33% chance of adding a span.
boolean wonRandom = rand == 2;
// Don't put spannable items next to each other, it doesn't look good.
if ((lastSpannableItemAddedPosition == NO_POSITION
|| lastSpannableItemAddedPosition != position - 1) && rand == 2) {
boolean notAdjacent = lastSpannableItemAddedPosition == NO_POSITION ||
lastSpannableItemAddedPosition != position - 1;
// Don't put in last column
boolean notInLastColumn = (position + 1) % getSpanCount() != 0;
if (wonRandom && notAdjacent && notInLastColumn) {
viewModel.spanCount = getSpanCount() - 1;
viewModel.layout = R.layout.grid_item_large;
lastSpannableItemAddedPosition = position;
Expand Down

0 comments on commit 5efa410

Please sign in to comment.