summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-04-19 10:16:57 +0300
committerAndrew Dolgov <[email protected]>2016-04-19 10:16:57 +0300
commitf0de531e2e2a5613d71ecb306759cc6a5b72bb5d (patch)
treeb615bbcc75970708783c565c61076187b55b6b00
parentfb540692aea8cc367e460a83092d0d8eb08b0008 (diff)
hopefully improve headline footer handling
-rwxr-xr-xorg.fox.ttrss/src/main/AndroidManifest.xml2
-rwxr-xr-xorg.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java37
2 files changed, 25 insertions, 14 deletions
diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml
index 32b9898b..5ebbff26 100755
--- a/org.fox.ttrss/src/main/AndroidManifest.xml
+++ b/org.fox.ttrss/src/main/AndroidManifest.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
- android:versionCode="409"
+ android:versionCode="410"
android:versionName="1.176" >
<uses-sdk
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 6268aff4..cd2072a7 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
@@ -117,7 +117,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
private ListView m_list;
private ImageLoader m_imageLoader = ImageLoader.getInstance();
private View m_listLoadingView;
- //private View m_topChangedView;
+ private View m_topChangedView;
+ private View m_amrFooterView;
public ArticleList getSelectedArticles() {
ArticleList tmp = new ArticleList();
@@ -450,23 +451,22 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
}
m_listLoadingView = inflater.inflate(R.layout.headlines_row_loadmore, m_list, false);
- m_list.addFooterView(m_listLoadingView, null, false);
- m_listLoadingView.setVisibility(View.GONE);
+ //m_list.addFooterView(m_listLoadingView, null, false);
+ //m_listLoadingView.setVisibility(View.GONE);
- /*m_topChangedView = inflater.inflate(R.layout.headlines_row_top_changed, m_list, false);
- m_list.addFooterView(m_topChangedView, null, false);
- m_topChangedView.setVisibility(View.GONE);*/
+ m_topChangedView = inflater.inflate(R.layout.headlines_row_top_changed, m_list, false);
+ //m_list.addFooterView(m_topChangedView, null, false);
+ //m_topChangedView.setVisibility(View.GONE);*/
if (m_prefs.getBoolean("headlines_mark_read_scroll", false)) {
WindowManager wm = (WindowManager) m_activity.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
int screenHeight = display.getHeight();
- View layout = inflater.inflate(R.layout.headlines_footer, container, false);
+ m_amrFooterView = inflater.inflate(R.layout.headlines_footer, container, false);
+ m_amrFooterView.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, screenHeight));
- layout.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, screenHeight));
-
- m_list.addFooterView(layout, null, false);
+ m_list.addFooterView(m_amrFooterView, null, false);
}
if (m_activity.isSmallScreen()) {
@@ -569,6 +569,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
@SuppressWarnings({ "serial" })
public void refresh(boolean append, boolean userInitiated) {
+ m_list.removeFooterView(m_listLoadingView);
+ m_list.removeFooterView(m_topChangedView);
+ m_list.removeFooterView(m_amrFooterView);
if (!append) m_lazyLoadDisabled = false;
@@ -612,7 +615,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false);
- m_listLoadingView.setVisibility(View.GONE);
+ //m_listLoadingView.setVisibility(View.GONE);
+ m_list.removeFooterView(m_listLoadingView);
+ m_list.removeFooterView(m_topChangedView);
+ m_list.removeFooterView(m_amrFooterView);
if (result != null) {
m_refreshInProgress = false;
@@ -624,10 +630,12 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (m_firstIdChanged) {
m_lazyLoadDisabled = true;
- m_activity.toast(R.string.headlines_row_top_changed);
+ //m_activity.toast(R.string.headlines_row_top_changed);
//m_topChangedView.setVisibility(View.VISIBLE);
//m_articles.add(new Article(ARTICLE_SPECIAL_TOP_CHANGED));
+
+ m_list.addFooterView(m_topChangedView, null, false);
}
HeadlinesFragment.this.m_firstId = m_firstId;
@@ -658,6 +666,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
//m_activity.setLoadingStatus(getErrorMessage(), false);
}
}
+
+ if (m_amrFooterView != null) m_list.addFooterView(m_amrFooterView, null, false);
}
};
@@ -688,7 +698,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
}
if (skip > 0) {
- m_listLoadingView.setVisibility(View.VISIBLE);
+ m_list.addFooterView(m_listLoadingView, null, false);
+ //m_listLoadingView.setVisibility(View.VISIBLE);
}
} else {