diff options
author | Andrew Dolgov <[email protected]> | 2017-06-06 15:07:31 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-06-06 15:07:31 +0300 |
commit | 7150fad59b5d6a35cf585e71a01430c2d9993cb6 (patch) | |
tree | f68ad6e32caacfbb6cf96d69659515802880bfa0 | |
parent | a6038e6896e2c9f8b49ebcf7a517463f63bea32b (diff) |
bandaid fix for new-style list footer management causing crashes on tablets in landscape
do not allow swipe-dismissing footer articles entries
-rwxr-xr-x | org.fox.ttrss/src/main/AndroidManifest.xml | 4 | ||||
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java | 21 |
2 files changed, 16 insertions, 9 deletions
diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index 22545384..06c11588 100755 --- a/org.fox.ttrss/src/main/AndroidManifest.xml +++ b/org.fox.ttrss/src/main/AndroidManifest.xml @@ -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" /> diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 3a9687fc..6d866f81 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -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,8 +584,10 @@ public class HeadlinesFragment extends Fragment { m_articles.clear(); m_adapter.notifyDataSetChanged(); } else { - m_articles.add(new Article(Article.TYPE_LOADMORE)); - m_adapter.notifyDataSetChanged(); + if (!(m_activity instanceof DetailActivity)) { + m_articles.add(new Article(Article.TYPE_LOADMORE)); + m_adapter.notifyDataSetChanged(); + } } final String sessionId = m_activity.getSessionId(); @@ -619,7 +621,10 @@ public class HeadlinesFragment extends Fragment { m_lazyLoadDisabled = true; //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) { @@ -645,8 +650,10 @@ public class HeadlinesFragment extends Fragment { } } - m_articles.add(new Article(Article.TYPE_AMR_FOOTER)); - m_adapter.notifyDataSetChanged(); + if (!(m_activity instanceof DetailActivity)) { + m_articles.add(new Article(Article.TYPE_AMR_FOOTER)); + m_adapter.notifyDataSetChanged(); + } } }; |