use of com.newsrob.Entry in project newsrob by marianokamp.
the class ShowArticleActivity method onResume.
@Override
protected void onResume() {
NewsRob.lastActivity = this;
super.onResume();
webView.resumeTimers();
try {
Method m = webView.getClass().getMethod("onResume", null);
m.invoke(webView, new Object[] {});
} catch (Exception e) {
e.printStackTrace();
}
if (false)
UIHelper.resumeWebViews(this);
if (currentTheme != getEntryManager().getCurrentThemeResourceId()) {
finish();
startActivity(getIntent());
} else {
if (getWebView() != null) {
PL.log("WebView timer resumed.", this);
webView.resumeTimers();
} else
PL.log("WebView timer not resumed.", this);
// that was stored, otherwise rewind.
try {
if (savedContentCursorPosition != -1 && savedContentCursoCurrentId != null) {
contentCursor.moveToPosition(savedContentCursorPosition);
if (!savedContentCursoCurrentId.equals(contentCursor.getLong(0)))
contentCursor.moveToPosition(-1);
}
} catch (CursorIndexOutOfBoundsException e) {
contentCursor.moveToPosition(-1);
}
if (false)
googleAdsUtil.showAds(this);
leavingThisActivity = false;
getEntryManager().addListener(this);
Entry selectedEntry = getSelectedEntry();
if (selectedEntry != null) {
PL.log("ADV: onResume()1 Article " + selectedEntry.getTitle() + " was already read=" + articleWasAlreadyRead, this);
// articleWasAlreadyRead = selectedEntry.getReadState() ==
// ReadState.READ;
PL.log("ADV: onResume()2 Article " + selectedEntry.getTitle() + " was already read=" + articleWasAlreadyRead, this);
if (selectedEntry.getReadState() == ReadState.UNREAD)
setArticleReadStateAsynchronously(selectedEntry, ReadState.READ);
}
view();
refreshUI();
savedContentCursorPosition = -1;
savedContentCursoCurrentId = null;
}
if (entryManager.isProVersion() && entryManager.getDaysInstalled() > 0)
MessageHelper.showMessage(this, R.string.explain_fullscreen_toggle_title, R.string.explain_fullscreen_toggle_message, "explain_fullscreen_toggle");
if ("1".equals(NewsRob.getDebugProperties(this).getProperty("traceArticleDetailViewLaunch", "0")))
Debug.stopMethodTracing();
}
use of com.newsrob.Entry in project newsrob by marianokamp.
the class UnsubscribeFeedTask method findEntryByPosition.
private Entry findEntryByPosition(final int position) {
final Cursor cursor = (Cursor) getListView().getItemAtPosition(position);
String atomId = null;
try {
atomId = cursor.getString(1);
} catch (final CursorIndexOutOfBoundsException cioobe) {
// atomId stays null
}
if (atomId == null)
return null;
final Entry selectedEntry = getEntryManager().findEntryByAtomId(atomId);
return selectedEntry;
}
use of com.newsrob.Entry in project newsrob by marianokamp.
the class UnsubscribeFeedTask method onCreateContextMenu.
@Override
public void onCreateContextMenu(final ContextMenu menu, final View v, final ContextMenuInfo menuInfo, final int position) {
final Entry entry = findEntryByPosition(position);
if (entry != null) {
ArticleViewHelper.createArticleMenu(menu, this, entry);
if (getEntryManager().isProVersion())
menu.add(0, MENU_ITEM_MARK_READ_UNTIL_HERE_ID, 3, "Mark Read Until Here");
else {
menu.add(0, MENU_ITEM_MARK_READ_UNTIL_HERE_ID, 99, "Mark Read Until Here").setEnabled(false);
}
boolean feedCanBeUnsubscribed = false;
Feed f = getEntryManager().findFeedById(entry.getFeedId());
if (f != null)
feedCanBeUnsubscribed = !getEntryManager().isModelCurrentlyUpdated() && getEntryManager().canFeedBeUnsubscribed(f.getAtomId());
menu.add(0, MENU_ITEM_UNSUBSCRIBE_FEED_ID, 10, "Unsubscribe Feed").setEnabled(feedCanBeUnsubscribed);
}
}
use of com.newsrob.Entry in project newsrob by marianokamp.
the class ShowArticleInfoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.show_article_info);
String atomId = getIntent().getExtras().getString(EXTRA_ATOM_ID);
if (atomId == null)
finish();
Entry entry = EntryManager.getInstance(this).findEntryByAtomId(atomId);
if (entry == null)
finish();
TextView textView = (TextView) findViewById(R.id.error);
textView.setText("" + entry.getError() + " (" + atomId + ")");
}
Aggregations