Skip to content

Commit

Permalink
[snapshot release] of 2016-06-14
Browse files Browse the repository at this point in the history
  • Loading branch information
davideas committed Jun 14, 2016
1 parent 3ec71a6 commit dd96c16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
item.setTitle(R.string.mode_single);
Snackbar.make(findViewById(R.id.main_view), "Selection MODE_IDLE is enabled", Snackbar.LENGTH_SHORT).show();
}
} else if (id == R.id.action_reset || id == R.id.action_delete) {
showFab();
}
//TODO: Add toggle for mAdapter.toggleFastScroller();
//TODO: Add dialog configuration settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,18 @@ public void createStaggeredDatabase(Context context) {

protected void createMergedItems() {
//Simulating merged items
mergeItem((StaggeredItem) mItems.get(1), (StaggeredItem) mItems.remove(2));
mergeItem((StaggeredItem) mItems.get(4), (StaggeredItem) mItems.remove(5));
mergeItem((StaggeredItem) mItems.get(4), (StaggeredItem) mItems.remove(9));
mergeItem((StaggeredItem) mItems.get(8), (StaggeredItem) mItems.remove(9));
mergeItem((StaggeredItem) mItems.get(8), (StaggeredItem) mItems.remove(9));
mergeItem((StaggeredItem) mItems.get(8), (StaggeredItem) mItems.remove(10));
if (mItems.size() > 2)
mergeItem((StaggeredItem) mItems.get(1), (StaggeredItem) mItems.remove(2));
if (mItems.size() > 5)
mergeItem((StaggeredItem) mItems.get(4), (StaggeredItem) mItems.remove(5));
if (mItems.size() > 7)
mergeItem((StaggeredItem) mItems.get(4), (StaggeredItem) mItems.remove(7));
if (mItems.size() > 8)
mergeItem((StaggeredItem) mItems.get(7), (StaggeredItem) mItems.remove(8));
if (mItems.size() > 8)
mergeItem((StaggeredItem) mItems.get(7), (StaggeredItem) mItems.remove(8));
if (mItems.size() > 9)
mergeItem((StaggeredItem) mItems.get(7), (StaggeredItem) mItems.remove(9));
}

/*---------------*/
Expand Down Expand Up @@ -384,8 +390,8 @@ public void resetItems() {
for (AbstractFlexibleItem item : mItems) {
if (item instanceof StaggeredItem) {
StaggeredItem staggeredItem = (StaggeredItem) item;
staggeredItem.setStatus(StaggeredItemStatus.A);
staggeredItem.setHeader(headers.get(StaggeredItemStatus.A));
staggeredItem.setStatus(StaggeredItemStatus.C);
staggeredItem.setHeader(headers.get(StaggeredItemStatus.C));
mergedItems.addAll(staggeredItem.splitAllItems());
}
}
Expand All @@ -394,8 +400,7 @@ public void resetItems() {
}
mItems.addAll(mergedItems);
Collections.sort(mItems, new ItemComparatorById());
if (mItems.size() > 20)
createMergedItems();
createMergedItems();
}

public void mergeItem(StaggeredItem mainItem, StaggeredItem itemToMerge) {
Expand Down

0 comments on commit dd96c16

Please sign in to comment.