Hi Wilmar

Thanks for using Crosswalk.
I tried your XWalkView code, load page and XWalkDialogManager  works well, 
what's your issue?

Best Regards :)
Xiaofeng Zhang

From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of Wilmar 
Martinez
Sent: Tuesday, September 27, 2016 12:33 AM
To: [email protected]
Subject: Re: [Crosswalk-help] Help with xwalkwebview while loading page


Good afternoon,



Actually I am registered in list mail, I going to send again my question,



Please, I need some help with the follow code is for a 
(xwalkwebview-while-loading-page), I am using crosswalk library 21.51.546.6 on 
android studio,



I have a example with webview, that work fine, but need convert it in 
xwalkwebview
public class WebViewDemo extends Activity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  WebView webView = new WebView(this);
  webView.setClickable(true);
  webView.setFocusableInTouchMode(true);
  webView.getSettings().setJavaScriptEnabled(true);
  webView.loadUrl("http://www.google.com";);
  WebClientClass webViewClient = new WebClientClass();
  webView.setWebViewClient(webViewClient);
  WebChromeClient webChromeClient=new WebChromeClient();
  webView.setWebChromeClient(webChromeClient);
  setContentView(webView);
 }

 public class WebClientClass extends WebViewClient {
  ProgressDialog pd = null;

  @Override
  public void onPageStarted(WebView view, String url, Bitmap favicon) {
   super.onPageStarted(view, url, favicon);
   pd = new ProgressDialog(WebViewDemo.this);
   pd.setTitle("Please wait");
   pd.setMessage("Page is loading..");
   pd.show();
  }

  @Override
  public void onPageFinished(WebView view, String url) {
   super.onPageFinished(view, url);
   pd.dismiss();
  }
 }

 public class WebChromeClass extends WebChromeClient{
 }




In my application I have the follow code for crosswalk
import android.app.AlertDialog;
 import android.os.Bundle;

 import org.xwalk.core.XWalkActivity;
 import org.xwalk.core.XWalkDialogManager;
 import org.xwalk.core.XWalkView;

 public class MainActivity extends XWalkActivity {
     private XWalkView mXWalkView;

     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         setContentView(R.layout.activity_main);
         mXWalkView = (XWalkView) findViewById(R.id.xwalkview);

         // Get default dialog and modifiy it as needed, or set a completely 
customized dialog.

         XWalkDialogManager dialogManager = getDialogManager();
         AlertDialog dialog = 
dialogManager.getAlertDialog(XWalkDialogManager.DIALOG_NOT_FOUND);
         dialog.setTitle("TestTitle");
         dialog.setMessage("TestMessage");
     }

     @Override
     public void onXWalkReady() {
         mXWalkView.load("https://crosswalk-project.org/";, null);
     }
 }





Attentively,



Wilmar Martinez

________________________________
De: Wilmar Martinez
Enviado: lunes, 26 de septiembre de 2016 11:25:26 a. m.
Para: 
[email protected]<mailto:[email protected]>
Asunto: Help with xwalkwebview while loading page


Good afternoon,



Please, I need some help with the follow code is for a 
(xwalkwebview-while-loading-page), I am using crosswalk library 21.51.546.6 on 
android studio,



I have a example with webview, that work fine, but need convert it in 
xwalkwebview
public class WebViewDemo extends Activity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  WebView webView = new WebView(this);
  webView.setClickable(true);
  webView.setFocusableInTouchMode(true);
  webView.getSettings().setJavaScriptEnabled(true);
  webView.loadUrl("http://www.google.com";);
  WebClientClass webViewClient = new WebClientClass();
  webView.setWebViewClient(webViewClient);
  WebChromeClient webChromeClient=new WebChromeClient();
  webView.setWebChromeClient(webChromeClient);
  setContentView(webView);
 }

 public class WebClientClass extends WebViewClient {
  ProgressDialog pd = null;

  @Override
  public void onPageStarted(WebView view, String url, Bitmap favicon) {
   super.onPageStarted(view, url, favicon);
   pd = new ProgressDialog(WebViewDemo.this);
   pd.setTitle("Please wait");
   pd.setMessage("Page is loading..");
   pd.show();
  }

  @Override
  public void onPageFinished(WebView view, String url) {
   super.onPageFinished(view, url);
   pd.dismiss();
  }
 }

 public class WebChromeClass extends WebChromeClient{
 }




In my application I have the follow code for crosswalk
import android.app.AlertDialog;
 import android.os.Bundle;

 import org.xwalk.core.XWalkActivity;
 import org.xwalk.core.XWalkDialogManager;
 import org.xwalk.core.XWalkView;

 public class MainActivity extends XWalkActivity {
     private XWalkView mXWalkView;

     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         setContentView(R.layout.activity_main);
         mXWalkView = (XWalkView) findViewById(R.id.xwalkview);

         // Get default dialog and modifiy it as needed, or set a completely 
customized dialog.

         XWalkDialogManager dialogManager = getDialogManager();
         AlertDialog dialog = 
dialogManager.getAlertDialog(XWalkDialogManager.DIALOG_NOT_FOUND);
         dialog.setTitle("TestTitle");
         dialog.setMessage("TestMessage");
     }

     @Override
     public void onXWalkReady() {
         mXWalkView.load("https://crosswalk-project.org/";, null);
     }
 }



Attentively,



Wilmar Martinez


_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to