Exemplo n.º 1
0
 public boolean onKeyDown(int keyCode, KeyEvent event) {
   Logger.d(TAG, "onKeyDown(" + keyCode + ", " + event + ")");
   if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
     return true;
   } else {
     return super.onKeyDown(keyCode, event);
   }
 }
Exemplo n.º 2
0
 public void destroy() {
   try {
     unregisterReceiver(mScreenReceiver);
   } catch (Exception e) {
     Logger.w(TAG, "destroy(), e:" + e);
   }
   if (mTimer != null) {
     mTimer.cancel();
     mTimer = null;
   }
   onAppVisibilityChange = null;
 }
Exemplo n.º 3
0
  public static void setDialog(
      String[] texts, Media[] media, String button1, String button2, LuaClosure callback) {
    WigPushDialogActivity.texts = texts;
    WigPushDialogActivity.media = media;
    WigPushDialogActivity.callback = callback;
    WigPushDialogActivity.page = -1;

    if (button1 == null) button1 = "OK";

    menu01Text = button1;
    menu02Text = button2;
    Logger.d(TAG, "setDialog() - finish, callBack:" + (callback != null));
  }
Exemplo n.º 4
0
  private void nextPage() {
    Logger.d(
        TAG,
        "nextpage() - page:"
            + page
            + ", texts:"
            + texts.length
            + ", callback:"
            + (callback != null));
    page++;
    if (page >= texts.length) {
      if (callback != null) {
        LuaClosure call = callback;
        callback = null;
        Engine.invokeCallback(call, "Button1");
      }
      WigPushDialogActivity.this.finish();
      return;
    }

    tvImageText.setText("");

    Media m = media[page];
    if (m != null) {
      try {
        byte[] img = Engine.mediaFile(m);
        CartridgeListActivity.setBitmapToImageView(
            BitmapFactory.decodeByteArray(img, 0, img.length), ivImage);
      } catch (Exception e) {
        tvImageText.setText(m.altText);
      }
    } else {
      ivImage.setImageBitmap(null);
      ivImage.setMinimumWidth(0);
      ivImage.setMinimumHeight(0);
    }

    tvImageText.setText(tvImageText.getText().toString() + "\n" + texts[page]);
  }
Exemplo n.º 5
0
 private static void onAppRestored() {
   Logger.w(TAG, "onAppRestored()");
 }