disable auto mark as read temporarily when scrolling listview back to
top because of new items (refs #767)
This commit is contained in:
parent
0d4bdfad43
commit
02a8162956
@ -65,6 +65,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
private Article m_activeArticle;
|
private Article m_activeArticle;
|
||||||
private String m_searchQuery = "";
|
private String m_searchQuery = "";
|
||||||
private boolean m_refreshInProgress = false;
|
private boolean m_refreshInProgress = false;
|
||||||
|
private boolean m_autoCatchupDisabled = false;
|
||||||
|
|
||||||
private SharedPreferences m_prefs;
|
private SharedPreferences m_prefs;
|
||||||
|
|
||||||
@ -376,7 +377,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
if (getView() != null) {
|
if (getView() != null) {
|
||||||
Log.d(TAG, "scroll hack");
|
Log.d(TAG, "scroll hack");
|
||||||
ListView list = (ListView)getView().findViewById(R.id.headlines);
|
ListView list = (ListView)getView().findViewById(R.id.headlines);
|
||||||
|
m_autoCatchupDisabled = true;
|
||||||
list.smoothScrollToPosition(0);
|
list.smoothScrollToPosition(0);
|
||||||
|
m_autoCatchupDisabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -878,7 +881,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
|||||||
refresh(true);
|
refresh(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_prefs.getBoolean("headlines_mark_read_scroll", false) && firstVisibleItem > 0) {
|
if (m_prefs.getBoolean("headlines_mark_read_scroll", false) && firstVisibleItem > 0 && !m_autoCatchupDisabled) {
|
||||||
Article a = m_articles.get(firstVisibleItem - 1);
|
Article a = m_articles.get(firstVisibleItem - 1);
|
||||||
|
|
||||||
if (a != null && a.unread) {
|
if (a != null && a.unread) {
|
||||||
|
Loading…
Reference in New Issue
Block a user