bandaid fix for new-style list footer management causing crashes on tablets in landscape

do not allow swipe-dismissing footer articles entries
This commit is contained in:
Andrew Dolgov 2017-06-06 15:07:31 +03:00
parent a6038e6896
commit 7150fad59b
2 changed files with 16 additions and 9 deletions

View File

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.fox.ttrss"
android:versionCode="442"
android:versionName="1.208">
android:versionCode="443"
android:versionName="1.209">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

View File

@ -363,7 +363,7 @@ public class HeadlinesFragment extends Fragment {
Article article = getArticleAtPosition(position);
if (article == null)
if (article == null && article.id > 0)
return 0;
return super.getSwipeDirs(recyclerView, viewHolder);
@ -379,7 +379,7 @@ public class HeadlinesFragment extends Fragment {
final Article article = getArticleAtPosition(position);
final boolean wasUnread;
if (article != null) {
if (article != null && article.id > 0) {
if (article.unread) {
wasUnread = true;
@ -584,9 +584,11 @@ public class HeadlinesFragment extends Fragment {
m_articles.clear();
m_adapter.notifyDataSetChanged();
} else {
if (!(m_activity instanceof DetailActivity)) {
m_articles.add(new Article(Article.TYPE_LOADMORE));
m_adapter.notifyDataSetChanged();
}
}
final String sessionId = m_activity.getSessionId();
final boolean isCat = m_feed.is_cat;
@ -619,8 +621,11 @@ public class HeadlinesFragment extends Fragment {
m_lazyLoadDisabled = true;
//Log.d(TAG, "first id changed, disabling lazy load");
if (!(m_activity instanceof DetailActivity)) {
m_articles.add(new Article(Article.TYPE_TOP_CHANGED));
}
}
if (m_amountLoaded < HEADLINES_REQUEST_SIZE) {
//Log.d(TAG, "amount loaded < request size, disabling lazy load");
@ -645,9 +650,11 @@ public class HeadlinesFragment extends Fragment {
}
}
if (!(m_activity instanceof DetailActivity)) {
m_articles.add(new Article(Article.TYPE_AMR_FOOTER));
m_adapter.notifyDataSetChanged();
}
}
};
int skip = 0;