From d733127fa1531afad6b2f8472ef0ca64cb8b2a0f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 19 Sep 2012 16:16:38 +0400 Subject: [PATCH] fix articlefragment progressbar --- src/org/fox/ttrss/ArticleFragment.java | 2 +- src/org/fox/ttrss/offline/OfflineActivity.java | 5 +++++ src/org/fox/ttrss/offline/OfflineArticleFragment.java | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index 2f293ab8..1788b691 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -132,7 +132,7 @@ public class ArticleFragment extends Fragment { web.setWebChromeClient(new WebChromeClient() { @Override public void onProgressChanged(WebView view, int progress) { - m_activity.setProgress(progress * 10000); + m_activity.setProgress(Math.round(((float)progress / 100f) * 10000)); if (progress == 100) { m_activity.setProgressBarVisibility(false); } diff --git a/src/org/fox/ttrss/offline/OfflineActivity.java b/src/org/fox/ttrss/offline/OfflineActivity.java index 319428f5..121cb8d1 100644 --- a/src/org/fox/ttrss/offline/OfflineActivity.java +++ b/src/org/fox/ttrss/offline/OfflineActivity.java @@ -23,6 +23,7 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.view.Window; import android.widget.EditText; import android.widget.SearchView; import android.widget.ShareActionProvider; @@ -80,6 +81,10 @@ public class OfflineActivity extends CommonActivity { super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_PROGRESS); + + setProgressBarVisibility(false); + setContentView(R.layout.login); setLoadingStatus(R.string.blank, false); diff --git a/src/org/fox/ttrss/offline/OfflineArticleFragment.java b/src/org/fox/ttrss/offline/OfflineArticleFragment.java index 3035d629..6fd7ad01 100644 --- a/src/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -28,6 +28,7 @@ import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebSettings.LayoutAlgorithm; import android.webkit.WebView; @@ -126,6 +127,16 @@ public class OfflineArticleFragment extends Fragment { if (web != null) { + web.setWebChromeClient(new WebChromeClient() { + @Override + public void onProgressChanged(WebView view, int progress) { + m_activity.setProgress(Math.round(((float)progress / 100f) * 10000)); + if (progress == 100) { + m_activity.setProgressBarVisibility(false); + } + } + }); + String content; String cssOverride = "";