@Override
 public void setUIClient(XWalkUIClient client) {
   // XWalk calls this method from its constructor.
   if (client instanceof XWalkCordovaUiClient) {
     this.uiClient = (XWalkCordovaUiClient) client;
   }
   super.setUIClient(client);
 }
예제 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_conference);

    statusCheck();
    getActionBar().setTitle("ArmyMax : PHONE CALL");

    url = getIntent().getExtras().getString("url");
    getActionBar().setDisplayHomeAsUpEnabled(true);

    Log.e("XwalkURL", url);
    // Toast.makeText(this, url, Toast.LENGTH_LONG).show();

    mXwalkView = (XWalkView) findViewById(R.id.conference);
    mXwalkView.setResourceClient(new MyResourceClient(mXwalkView));
    mXwalkView.setUIClient(new MyUIClient(mXwalkView));
    // mXwalkView.getSettings().setGeolocationEnabled(true);
    mXwalkView.clearCache(true);
    mXwalkView.load(url, null);
  }
  @Override
  public final void onXWalkInitCompleted() {
    setContentView(R.layout.activity_xwalk_view_with_on_unhandled_keyevent);
    mXWalkView = (XWalkView) findViewById(R.id.xwalk_view);
    mTextView = (TextView) findViewById(R.id.unhandled_keyevent_label);

    StringBuffer mess = new StringBuffer();
    mess.append("Test Purpose: \n\n")
        .append("Verifies XWalkView UI Client can override 'onUnhandledKeyEvent' method.\n\n")
        .append("Test  Step:\n\n")
        .append("1. Load baidu webpage.\n")
        .append("2. Input any words in the input field.\n")
        .append("Expected Result:\n\n")
        .append("Test passes if text shows \"onUnhandledKeyEvent is invoked\".");
    new AlertDialog.Builder(this)
        .setTitle("Info")
        .setMessage(mess.toString())
        .setPositiveButton("confirm", null)
        .show();

    mXWalkView.setUIClient(new UIClient(mXWalkView));
    mXWalkView.load("http://www.baidu.com/", null);
  }