use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class DBQueryContentCursorTests method testContentCursorOrderAscending.
public void testContentCursorOrderAscending() {
DBQuery dbq = new DBQuery(entryManager, null, null);
dbq.setSortOrderAscending(true);
dbq.setShouldHideReadItemsWithoutUpdatingThePreference(false);
List<String> expectedIds = atomIdsOrderedAscending;
executeAndVerify(dbq, expectedIds);
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class FeedListActivity method onListItemClick.
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Cursor c = (Cursor) getListAdapter().getItem(position);
Long filterFeedId = c.getLong(c.getColumnCount() - 1);
int frequency = c.getInt(1);
DBQuery dbq = new DBQuery(getDbQuery());
dbq.setFilterFeedId(filterFeedId);
if (frequency == 1) {
startShowEntryActivityForPosition(0, dbq);
} else {
// new File(Environment.getExternalStorageDirectory(),
// "t").mkdirs();
// Debug.startMethodTracing("t/launch_al_"
// + new SimpleDateFormat("yyMMdd-hh:mm:ss").format(new
// Date()).replace(':', '-'));
Intent intent = new Intent(this, ArticleListActivity.class);
UIHelper.addExtrasFromDBQuery(intent, dbq);
startActivity(intent);
}
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class FeedListActivity method getToastMessage.
@Override
protected CharSequence getToastMessage() {
StringBuilder sb = new StringBuilder();
DBQuery dbq = getDbQuery();
if (dbq.getFilterLabel() != null && !"all articles".equals(dbq.getFilterLabel()))
sb.append(dbq.getFilterLabel());
if (sb.length() == 0)
sb.append("All Feeds");
return sb.toString().toLowerCase();
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class FeedListActivity method onContextItemSelected.
@Override
protected boolean onContextItemSelected(MenuItem item, int selectedPosition) {
Long feedId = getSelectedFeedId(selectedPosition);
if (feedId == null || feedId == -1l)
return false;
if (item.getItemId() == MENU_ITEM_MANAGE_FEED_ID) {
startActivity(new Intent(this, ManageFeedActivity.class).putExtra(ManageFeedActivity.EXTRA_FEED_ID, feedId));
} else if (item.getItemId() == MENU_ITEM_MARK_ALL_READ_ID) {
DBQuery dbq = getDbQuery();
instantiateMarkAllReadDialog(dbq.getFilterLabel(), feedId, dbq.getStartDate(), dbq.getDateLimit(), dbq.isSortOrderAscending(), dbq.getLimit());
}
if (item.getItemId() == MENU_ITEM_UNSUBSCRIBE_FEED_ID) {
Feed f = getEntryManager().findFeedById(feedId);
if (f == null)
return true;
final String feedAtomId = f.getAtomId();
Runnable r = new Runnable() {
@Override
public void run() {
new UnsubscribeFeedTask(getEntryManager()).execute(feedAtomId);
}
};
showConfirmationDialog("Unsubscribe from \'" + f.getTitle() + "\' during the next sync and mark all remaining articles read?", r);
return true;
}
return true;
}
use of com.newsrob.DBQuery in project newsrob by marianokamp.
the class AbstractNewsRobListActivity method shouldMarkAllReadButtonBeEnabled.
protected boolean shouldMarkAllReadButtonBeEnabled() {
DBQuery dbq = new DBQuery(getDbQuery());
dbq.setShouldHideReadItemsWithoutUpdatingThePreference(true);
return getEntryManager().isMarkAllReadPossible(dbq);
}
Aggregations