fix articlefragment progressbar

This commit is contained in:
Andrew Dolgov 2012-09-19 16:16:38 +04:00
parent 675749a608
commit d733127fa1
3 changed files with 17 additions and 1 deletions

View File

@ -132,7 +132,7 @@ public class ArticleFragment extends Fragment {
web.setWebChromeClient(new WebChromeClient() { web.setWebChromeClient(new WebChromeClient() {
@Override @Override
public void onProgressChanged(WebView view, int progress) { public void onProgressChanged(WebView view, int progress) {
m_activity.setProgress(progress * 10000); m_activity.setProgress(Math.round(((float)progress / 100f) * 10000));
if (progress == 100) { if (progress == 100) {
m_activity.setProgressBarVisibility(false); m_activity.setProgressBarVisibility(false);
} }

View File

@ -23,6 +23,7 @@ import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.Window;
import android.widget.EditText; import android.widget.EditText;
import android.widget.SearchView; import android.widget.SearchView;
import android.widget.ShareActionProvider; import android.widget.ShareActionProvider;
@ -80,6 +81,10 @@ public class OfflineActivity extends CommonActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_PROGRESS);
setProgressBarVisibility(false);
setContentView(R.layout.login); setContentView(R.layout.login);
setLoadingStatus(R.string.blank, false); setLoadingStatus(R.string.blank, false);

View File

@ -28,6 +28,7 @@ import android.view.LayoutInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm; import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebView; import android.webkit.WebView;
@ -126,6 +127,16 @@ public class OfflineArticleFragment extends Fragment {
if (web != null) { 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 content;
String cssOverride = ""; String cssOverride = "";