Remove local suppression store
This commit is contained in:
@@ -17,7 +17,6 @@ public final class FeedActivity extends Activity {
|
||||
|
||||
private CardScrollView cardScrollView;
|
||||
private FeedAdapter adapter;
|
||||
private SuppressionStore suppressionStore;
|
||||
private FeedItem selectedItem;
|
||||
|
||||
private final HudState.Listener hudListener = new HudState.Listener() {
|
||||
@@ -37,8 +36,6 @@ public final class FeedActivity extends Activity {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
suppressionStore = new SuppressionStore(this);
|
||||
|
||||
cardScrollView = new CardScrollView(this);
|
||||
adapter = new FeedAdapter(this, makeWaitingCard());
|
||||
cardScrollView.setAdapter(adapter);
|
||||
@@ -85,15 +82,11 @@ public final class FeedActivity extends Activity {
|
||||
String action = data.getStringExtra(MenuActivity.EXTRA_ACTION);
|
||||
if (cardId == null || action == null) return;
|
||||
|
||||
long now = System.currentTimeMillis() / 1000L;
|
||||
if ("DISMISS".equals(action)) {
|
||||
suppressionStore.setSuppressed(cardId, now + (10L * 365L * 24L * 60L * 60L));
|
||||
adapter.removeById(cardId);
|
||||
} else if ("SNOOZE_2H".equals(action)) {
|
||||
suppressionStore.setSuppressed(cardId, now + 2L * 60L * 60L);
|
||||
adapter.removeById(cardId);
|
||||
} else if ("SNOOZE_24H".equals(action)) {
|
||||
suppressionStore.setSuppressed(cardId, now + 24L * 60L * 60L);
|
||||
adapter.removeById(cardId);
|
||||
} else if ("SAVE".equals(action)) {
|
||||
Toast.makeText(this, "Saved", Toast.LENGTH_SHORT).show();
|
||||
@@ -125,12 +118,10 @@ public final class FeedActivity extends Activity {
|
||||
List<FeedItem> items = env.activeItems();
|
||||
if (items.isEmpty()) return makeWaitingCard();
|
||||
|
||||
long now = System.currentTimeMillis() / 1000L;
|
||||
ArrayList<FeedItem> filtered = new ArrayList<FeedItem>();
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
FeedItem it = items.get(i);
|
||||
if (it == null) continue;
|
||||
if (it.id != null && suppressionStore.isSuppressed(it.id, now)) continue;
|
||||
filtered.add(it);
|
||||
}
|
||||
if (filtered.isEmpty()) return makeWaitingCard();
|
||||
|
||||
Reference in New Issue
Block a user