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" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="442" android:versionCode="443"
android:versionName="1.208"> android:versionName="1.209">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

View File

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