Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myWebView.setWebViewClient(new WebViewClient() {
- @Override
- public void onPageFinished(WebView view, String url) {
- myLoadingView.setVisibility(View.GONE);
- myWebView.setVisibility(View.VISIBLE);
- }
- });
- myWebView.loadUrl(...);
- myWebView.setWebChromeClient(new WebChromeClient() {
- public void onProgressChanged(WebView view, int progress) {
- myLoadingView.setText(progress+"%");
- }
- });
- super.setStringProperty("loadingDialog", "Wait, Loading...");
- public class MainActivity extends DroidGap {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- super.setIntegerProperty("splashscreen", R.drawable.splash);
- // Display a native loading dialog. Format for value = "Title,Message".
- // (String - default=null)
- super.setStringProperty("loadingDialog", "Wait,Loading Demo...");
- super.loadUrl("file:///android_asset/www/index.html");
- }
- }
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <ProgressBar
- android:id="@+id/progressBar1"
- style="@android:style/Widget.ProgressBar.Horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentRight="true"
- android:maxHeight="10dip"
- android:minHeight="10dip" />
- </LinearLayout>
- final Activity activity = this;
- private ProgressBar progessBar1;
- View footer = View.inflate(getContext(), R.layout.mainshop, null);
- root.addView(footer);
- progessBar1 = (ProgressBar) findViewById(R.id.progressBar1);
- this.appView.setWebChromeClient(new WebChromeClient() {
- public void onProgressChanged(WebView view, int progress) {
- activity.setProgress(progress * 1000);
- if(progress < 100 && progessBar1.getVisibility() == ProgressBar.GONE) {
- progessBar1.setVisibility(ProgressBar.VISIBLE);
- }
- progessBar1.setProgress(progress);
- if(progress == 100) {
- progessBar1.setVisibility(ProgressBar.GONE);
- }
- Log.d("Progress", progress+"");
- }
- });
- $.mobile.showPageLoadingMsg();
- $('.ui-loader h1').html('<h1>Saving ... <span id="ui-loading-extra"></span>');
- $('#ui-loading-extra').text(progress + '%');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement