示例#1
2
  @Override
  public void onClick(View v) {
    String usuario = edtUser.getText().toString();
    String senha = edtPassword.getText().toString();
    if (v.getId() == R.id.botaoLogar) {
      if (validateFields()) {
        if (usuario.equals("modelador") && senha.equals("123456")) {
          /** Um trabalho futuro será implementar uma funcionalidade para validar login e senha */
          Toast.makeText(this, resources.getString(R.string.login_auth_okm), Toast.LENGTH_LONG)
              .show();
          Intent it = new Intent(LoginActivity.this, MenuModelador.class);
          startActivityForResult(it, 1);
        } else if (usuario.equals("cliente") && senha.equals("123456")) {
          Toast.makeText(this, resources.getString(R.string.login_auth_okc), Toast.LENGTH_LONG)
              .show();
          Intent it = new Intent(LoginActivity.this, MenuCliente.class);
          startActivityForResult(it, 1);
        } else {
          Toast.makeText(LoginActivity.this, "Login/ ou Senha Invalido", Toast.LENGTH_LONG).show();
        }
      }
    }
    if (v.getId() == R.id.botaoCadastrar) {

      Intent it = new Intent(LoginActivity.this, EditarUsuario.class);
      startActivityForResult(it, 2);
    }
    if (v.getId() == R.id.botaoLimpar) {

      edtUser.setText("");
      edtPassword.setText("");

      Toast.makeText(LoginActivity.this, "Formulario Limpo", Toast.LENGTH_SHORT).show();
    }
  }
  @Override
  public void onClick(View v) {
    SharedPreferences gameSettings = getSharedPreferences(GAME_SETTING_PREFS, 0);
    SharedPreferences.Editor editor = gameSettings.edit();

    if (v.getId() == R.id.playBtn) {
      Intent nextIntent;

      SharedPreferences gameState = getSharedPreferences(GameActivity.GAME_STATE_PREFS, 0);
      final int currLevel = gameState.getInt(GameActivity.STATE_LEVEL, 0);

      nextIntent = new Intent(this, GameActivity.class);
      MediaController.stopLoopingSound();

      // startNext intent
      startActivity(nextIntent);
    } else if (v.getId() == R.id.settings_btn) {
      RelativeLayout settingsWrap = (RelativeLayout) findViewById(R.id.other_settings_buttons_wrap);
      if (View.GONE == settingsWrap.getVisibility()) {
        settingsWrap.setVisibility(View.VISIBLE);
      } else {
        settingsWrap.setVisibility(View.GONE);
      }
    } else if (v.getId() == R.id.toggle_sound) {
      boolean soundEdit = gameSettings.getBoolean(SOUND_PREF, true);
      editor.putBoolean(SOUND_PREF, !soundEdit);
      editor.commit();

      if (soundEdit) {
        Toast.makeText(getApplicationContext(), "Sound is turned off", Toast.LENGTH_SHORT).show();
        MediaController.stopLoopingSound();
      } else {
        Toast.makeText(getApplicationContext(), "Sound is turned on", Toast.LENGTH_SHORT).show();
        MediaController.playSoundClip(this, R.raw.background_intro, true);
      }
    } else if (v.getId() == R.id.toggle_vibration) {
      boolean vibrateEdit = gameSettings.getBoolean(VIBRATE_PREF, true);
      editor.putBoolean(VIBRATE_PREF, !vibrateEdit);

      String vibrateState = (!vibrateEdit) ? "on" : "off";
      Toast.makeText(
              getApplicationContext(), "Vibration is turned " + vibrateState, Toast.LENGTH_SHORT)
          .show();
    } else if (v.getId() == R.id.show_credits) {
      new GameAlertDialogBuilder(this)
          .setTitle("Credits")
          .setMessage(this.getResources().getString(R.string.credits))
          .setPositiveButton(
              android.R.string.no,
              new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                  dialog.cancel();
                }
              })
          .show();
    }
    editor.commit();

    updateColorOfSettingsButtons();
  }
示例#3
1
 @Override
 public void onClick(View view) {
   if (view.getId() == R.id.ll_uninstall) {
     CommandTask task = CommandTask.createForUninstall(context);
     task.execute();
   } else sInflateCallback.setOnViewIdReceived(view.getId());
 }
示例#4
1
 public void onRadioButtonClicked(View v) {
   if (v.getId() == R.id.group_closed_radio) {
     groupLogo.setImageResource(R.drawable.group_closed);
     groupLogo.setBackgroundColor(R.color.color_primary);
     groupTypeDescr.setText(R.string.group_closed_description);
     Log.e(
         TAG,
         "Cliccato: "
             + v.getId()
             + "! Setto: "
             + R.drawable.group_closed
             + ", "
             + R.color.color_primary
             + ", "
             + R.string.group_closed_description);
   } else if (v.getId() == R.id.group_open_radio) {
     groupLogo.setImageResource(R.drawable.group_open);
     groupLogo.setBackgroundColor(R.color.color_primary);
     groupTypeDescr.setText(R.string.group_open_description);
     Log.e(
         TAG,
         "Cliccato: "
             + v.getId()
             + "! Setto: "
             + R.drawable.group_open
             + ", "
             + R.color.color_primary
             + ", "
             + R.string.group_open_description);
   }
 }
示例#5
0
  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    LogUtil.i("MoveLinearLayout", "[onMeasure] start");
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    int count = getChildCount();
    boolean sub2 = false, sub3 = false;
    View view;
    for (int i = 0; i < count; ++i) {
      view = getChildAt(i);

      if (view.getId() == R.id.sub_view_1) {
        LogUtil.i(
            "MoveLinearLayout", "[onMeasure] sub_view_1  widthMeasureSpec : " + widthMeasureSpec);
      }
      if (view.getId() == R.id.sub_view_2 && !sub2) {
        LogUtil.i(
            "MoveLinearLayout", "[onMeasure] sub_view_2  widthMeasureSpec : " + widthMeasureSpec);
        view.setLayoutParams(new LayoutParams(widthMeasureSpec, view.getLayoutParams().height));
        sub2 = true;
      }
      if (view.getId() == R.id.sub_view_3 && sub3 == false) {
        LogUtil.i(
            "MoveLinearLayout", "[onMeasure] : sub_view_3 widthMeasureSpec : " + widthMeasureSpec);
        view.setLayoutParams(new LayoutParams(widthMeasureSpec, view.getLayoutParams().height));
        sub3 = true;
      }
      if (sub2 && sub3) {
        break;
      }
    }
  }
示例#6
0
  public void onClick(View view) {

    if (view.getId() == R.id.buttonScanLoop) {
      hideKeyboard();
      if (!isScanning) {
        logfileSetup(getLocation());
        startUpWiFi();
        Log.d(TAG, "onClick() wifi.startScan()");
        wifi.startScan();
        isScanning = true;
      } else {
        Toast.makeText(this, "Scan Loop already running!", Toast.LENGTH_LONG).show();
      }
    } else if (view.getId() == R.id.buttonStop) {
      if (isScanning) {
        unregisterReceiver(receiver);
        // receiver = null;
        Log.d(TAG, "onClick() wifi.stopScan()");
        isScanning = false;
        Toast.makeText(this, "Stopping!", Toast.LENGTH_LONG).show();
      } else {
        Toast.makeText(this, "Scan Loop not running!", Toast.LENGTH_LONG).show();
      }
    }
  }
示例#7
0
 @Override
 public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
   super.onCreateContextMenu(menu, v, menuInfo);
   switch (v.getId()) {
     case R.id.btn:
       menu.setHeaderTitle("Countries");
       listOfCoun = locationGet.getCountry();
       for (int i = 0; i < listOfCoun.size(); i++) {
         menu.add(0, v.getId(), 0, listOfCoun.get(i));
       }
       break;
     case R.id.btn2:
       menu.setHeaderTitle("Provinces/Territories");
       listOfProv = locationGet.getProvinces(setCoun);
       for (int i = 0; i < listOfProv.size(); i++) {
         menu.add(0, v.getId(), 0, listOfProv.get(i));
       }
       break;
     case R.id.btn3:
       menu.setHeaderTitle("Cities");
       listOfCity = locationGet.getCity(setProv);
       for (int i = 0; i < listOfCity.size(); i++) {
         menu.add(0, v.getId(), 0, listOfCity.get(i));
       }
       break;
   }
 }
示例#8
0
 @Override
 public void onClick(View v) {
   gridview.setVisibility(View.GONE);
   if (bible.getCount(Bible.TYPE.VERSION) == 0
       && bible.getDatabase() == null
       && v.getId() != R.id.version) {
     return;
   }
   switch (v.getId()) {
     case R.id.version:
       getVerse();
     case R.id.book:
     case R.id.chapter:
     case R.id.items:
       showSpinner(v);
       break;
     case R.id.search:
       onSearchRequested();
       break;
     case R.id.share:
       if (!copytext.equals("")) {
         Intent sendIntent = new Intent();
         sendIntent.setAction(Intent.ACTION_SEND);
         sendIntent.putExtra(Intent.EXTRA_TEXT, copytext);
         sendIntent.setType("text/plain");
         startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.share)));
       }
   }
 }
 @Override
 public void onClick(View view) {
   if (view.getId() == id.next) {
     position++;
     updateNotes();
   } else if (view.getId() == id.previous) {
     position--;
     updateNotes();
   } else if (view.getId() == id.play) {
     PinView pinView = (PinView) findViewById(id.imageView);
     Random random = new Random();
     if (pinView.isReady()) {
       float maxScale = pinView.getMaxScale();
       float minScale = pinView.getMinScale();
       float scale = (random.nextFloat() * (maxScale - minScale)) + minScale;
       PointF center =
           new PointF(random.nextInt(pinView.getSWidth()), random.nextInt(pinView.getSHeight()));
       pinView.setPin(center);
       AnimationBuilder animationBuilder = pinView.animateScaleAndCenter(scale, center);
       if (position == 3) {
         animationBuilder
             .withDuration(2000)
             .withEasing(SubsamplingScaleImageView.EASE_OUT_QUAD)
             .withInterruptible(false)
             .start();
       } else {
         animationBuilder.withDuration(750).start();
       }
     }
   }
 }
示例#10
0
  @Override
  public void onClick(View view) {

    if (view.getId() == R.id.registerButton) registerC2DM();
    else if (view.getId() == R.id.unregisterButton) unregisterC2DM();
    else sendMessage();
  }
示例#11
0
  @SuppressLint("NewApi")
  @Override
  public void onClick(View v) {
    if (v.getId() == R.id.refresh) {
      ImageView refeshImg = (ImageView) findViewById(R.id.refresh);
      ProgressBar loadingBar = (ProgressBar) findViewById(R.id.loadingPanel);
      readLiveData(refeshImg, loadingBar);
    }

    if (v.getId() == R.id.live) {
      ImageView liveIcon = (ImageView) findViewById(R.id.live);
      boolean isLive = sharedPreferences.getBoolean(PREFERENCE_CONF.IS_LIVE, true);
      if (isLive == false) // change to live is true
      liveIcon.setImageResource(R.drawable.all_match);
      else liveIcon.setImageResource(R.drawable.live_match);
      savePreferences(PREFERENCE_CONF.IS_LIVE, !isLive);

      drawDataUpLeagueNLive();
    }

    if (v.getId() == R.id.league) {
      ImageView leagueIcon = (ImageView) findViewById(R.id.league);
      boolean isLeague = sharedPreferences.getBoolean(PREFERENCE_CONF.IS_LEAGUE, true);
      if (isLeague == false) // change to league is true
      leagueIcon.setImageResource(R.drawable.whistle);
      else leagueIcon.setImageResource(R.drawable.league);
      savePreferences(PREFERENCE_CONF.IS_LEAGUE, !isLeague);

      drawDataUpLeagueNLive();
    }
  }
示例#12
0
  @Override
  public boolean onTouch(View v, MotionEvent event) {
    switch (event.getAction()) {
      case MotionEvent.ACTION_DOWN:
        if (v.getId() == R.id.llDemoMainServerSettingActivity) {
          touchDownTime = System.currentTimeMillis();
          Log.i(TAG, "onTouch MotionEvent.ACTION: touchDownTime=" + touchDownTime);
          return true;
        }
      case MotionEvent.ACTION_UP:
        if (v.getId() == R.id.llDemoMainServerSettingActivity) {
          long time = System.currentTimeMillis() - touchDownTime;
          if (time < 5000 || time > 8000) {
            showShortToast("请长按5-8秒");
          } else {
            toActivity(
                ServerSettingActivity.createIntent(
                    context,
                    SettingUtil.getServerAddress(context, false),
                    SettingUtil.getServerAddress(context, true),
                    SettingUtil.APP_SETTING,
                    Context.MODE_PRIVATE,
                    SettingUtil.KEY_SERVER_ADDRESS_NORMAL,
                    SettingUtil.KEY_SERVER_ADDRESS_TEST));
            return true;
          }
        }
        break;
      default:
        break;
    }

    return super.onTouch(v, event);
  }
示例#13
0
  /**
   * Click handlers for buttons
   *
   * @param target Button that is clicked
   */
  public void onButtonClickHandler(View target) {
    try {

      if (target.getId() == R.id.buttonWebBack) {
        if (mWebView.canGoBack()) {
          mWebView.goBack();
        }
      } else if (target.getId() == R.id.buttonWebReload) {
        mWebView.reload();
      }
      //			else if (target.getId() == R.id.buttonWebStop)
      //			{
      //				mWebView.stopLoading();
      //			}
      else if (target.getId() == R.id.buttonWebForward) {
        if (mWebView.canGoForward()) {
          mWebView.goForward();
        }
      } else if (target.getId() == R.id.buttonClose) {
        finish();
      } else if (target.getId() == R.id.buttonShare) {
        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(mWebView.getUrl()));
        startActivity(Intent.createChooser(i, getString(R.string.BTN_SHARING)));
      }
    } catch (Exception e) {

    }
  }
示例#14
0
    @Override
    public void onClick(View v) {
      if (v.getId() == DYNAMIC_IMAGE_ID) {
        Intent intent = new Intent(getActivity().getApplicationContext(), PrototypeActivity.class);

        intent.putExtra(PrototypeActivity.ACTION, "compose");
        intent.putExtra(PrototypeActivity.ORDER, 8);
        startActivity(intent);
      }

      int topic_id = v.getId() - DYNAMIC_TOPIC_ID;

      if (topic_id >= 0) {
        Fragment fragment = new DummySectionFragment();
        Bundle args = new Bundle();
        args.putInt(DummySectionFragment.ARG_SECTION_NUMBER, DummySectionFragment.HOME);

        args.putInt(DummySectionFragment.ARG_MAIN_TAB_NUMBER, topic_id);

        fragment.setArguments(args);
        getActivity()
            .getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.container, fragment)
            .commit();
      }
    }
示例#15
0
  @Override
  public void onClick(View v) {

    if (v.getId() == R.id.bLogout) {
      Register.currentUsername = "";
      startActivity(new Intent(this, Login.class));
    } else if (v.getId() == R.id.bAddItem) {
      startActivity(new Intent(this, AddItem.class));
    } else if (v.getId() == R.id.bDelete) {
      new AlertDialog.Builder(this)
          .setTitle("Delete Table")
          .setMessage("Are you sure you want to delete all items?")
          .setPositiveButton(
              android.R.string.yes,
              new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                  mDbHelper.deleteCoupons(Coupon.TABLE_LIST);
                }
              })
          .setNegativeButton(
              android.R.string.no,
              new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {}
              })
          .setIcon(android.R.drawable.ic_dialog_alert)
          .show();
    } else if (v.getId() == R.id.bShoppingList) {
      startActivity(new Intent(this, ShoppingList.class));
    }
  }
示例#16
0
 @Override
 public void onClick(View view) {
   ArrayList<TaskTemplate> temp = new ArrayList<TaskTemplate>();
   temp = globals.bodyPartTasks;
   if (view.getId() == forward.getId()) {
     if (reference + 1 < temp.size()) {
       ++reference;
       task = temp.get(reference);
       loadTask();
     }
   }
   if (view.getId() == back.getId()) {
     if (reference - 1 >= 0) {
       --reference;
       task = temp.get(reference);
       loadTask();
     }
   }
   if (view.getId() == add.getId()) {
     if (selected.contains(task)) {
       Toast.makeText(this, "Task already selected", Toast.LENGTH_SHORT).show();
     } else {
       selected.add(task);
       Toast.makeText(this, "Task added", Toast.LENGTH_SHORT).show();
     }
   }
 }
  /** Starts new Activity to display Homography transformation */
  @Override
  public void onClick(View v) {
    if (v.getId() == transformButton.getId()) {
      transformButton.setEnabled(false);

      // Remove all but the two base imagess
      Pair<Bitmap, Bitmap> imagesToAdd = tranBuilder.getWarpedImages();
      if (imagesToAdd == null) {
        // Notify User
        mExpandedImageText.setText("Tranformation is not ready just Yet");
        return;
      } else mExpandedImageText.setText(R.string.show_exp_image);

      mImageAdapter.setWarpedImage(imagesToAdd.first);
      mImageAdapter.setInvertedWarpedImage(imagesToAdd.second);

      // Start transformation process
      transformButton.setEnabled(true);
      // Allow user to look for OCR conversion
      ocrButton.setEnabled(true);
    } else if (v.getId() == ocrButton.getId()) {
      // No support for filePath
      if (ocrIntent == null) return;

      // TODO
      Bitmap warp = tranBuilder.getWarpedImages().first;
      Uri uri = Utility.saveBitmapToFile(warp, WARPED_PATH);
      ocrIntent.putExtra(WARPED_SOURCE_EXTRA, uri);
      startActivity(ocrIntent);
    }
  }
示例#18
0
  @Override
  public void onClick(View v) {
    if (v.getId() != R.id.rb_home) {
      if (AdmobManager.getInstance(MainActivity.me).allowShowQCFull
          && AdmobManager.getInstance(MainActivity.me).adFull.isLoaded()) {
        AdmobManager.getInstance(MainActivity.me).showQuangCaoFull(v);
        return;
      }
    }

    switch (v.getId()) {
      case R.id.rb_home:
        // onResume();
        toggle();
        new Handler()
            .postDelayed(
                new Runnable() {
                  @Override
                  public void run() {
                    toggle(); // your fragment transactions go here
                  }
                },
                200);
        toggle();
        break;
    }
  }
 @Override
 public void onClick(View v) {
   super.onClick(v);
   if (v.getId() == cancelReasonView.getId()) {
     cancelTv.setText("我不喜欢");
   }
 }
示例#20
0
  public void onClick(View v) {
    if (v.getId() == R.id.title_btn_left2) {
      finish();
    } else if (v.getId() == R.id.center_modifyword) {
      Intent intent = new Intent(UpdateInfo.this, UpdateMiMa.class);
      startActivity(intent);
      finish();
    } else if (v.getId() == R.id.title_btn_right2) {
      user = null;
      BookApp.setUser(null);
      Toast.makeText(UpdateInfo.this, "成功注销!", Toast.LENGTH_LONG).show();
      finish();
    } else if (v.getId() == R.id.updateInfo_over) {

      e = email.getText().toString();

      if (e.length() == 0) {
        Toast.makeText(UpdateInfo.this, "请输入邮箱!", Toast.LENGTH_LONG).show();
        return;
      }
      if (e.indexOf('@') == -1) {
        Toast.makeText(UpdateInfo.this, "请输入正确的邮箱!", Toast.LENGTH_LONG).show();
        return;
      }

      progress = ProgressDialog.show(UpdateInfo.this, "温馨提示", "正在修改信息...", true);
      progress.show();

      upInfoT = new UpdateInfoThread(UpdateInfo.this, handler, uid, token, e, null);
      upInfoT.start();
    }
  }
 /** {@inheritDoc} */
 public void onClick(View view) {
   if (view.getId() == R.id.btn_done) {
     this.doSaveAction();
   } else if (view.getId() == R.id.btn_discard) {
     this.finish();
   }
 }
示例#22
0
  // Denne metoden blir kalt når OK blir trykket, eller når teksten til Login blir trykket.
  @Override
  public void onClick(View v) {
    System.out.println("Registert klikk");
    // Sjekker om knappen ble trykket på.
    if (v.getId() == R.id.okButton) {

      // Validerer feltene vha. private metoder.
      if (validateUsername(username.getText().toString())
          && validateEmail(email.getText().toString())
          && validatePassword(password.getText().toString())
          && validateRetypePassword(
              password.getText().toString(), retypePassword.getText().toString())
          && validateRaspnum(raspnum.getText().toString())) {

        // postData sendes til PHP-serveren for å legge inn verdier.
        HashMap postData = new HashMap();
        postData.put("mobile", "android");
        postData.put("username", username.getText().toString());
        postData.put("email", email.getText().toString());
        postData.put("password", password.getText().toString());
        postData.put("raspnum", raspnum.getText().toString());

        PostResponseAsyncTask task = new PostResponseAsyncTask(this, postData);
        task.execute("http://folk.ntnu.no/sigurbe/register.php");
      }
    }
    // Sjekker om login-button ble trykket på. Starter i såfall Login-aktiviteten
    else if (v.getId() == R.id.loginButton) {
      System.out.println("Else loginButton");
      startLoginActivity();
    }
  }
 @Override
 public void onClick(View v) {
   if ((v.getId() == editProfileImageText.getId()) || (v.getId() == profileImage.getId())) {
     popupMenu = new PopupMenu(getActivity(), v);
     popupMenu
         .getMenuInflater()
         .inflate(R.menu.edit_profile_edit_picture_dropdown, popupMenu.getMenu());
     popupMenu.setOnMenuItemClickListener(
         new OnMenuItemClickListener() {
           @Override
           public boolean onMenuItemClick(MenuItem item) {
             if (item.getTitle().toString().equalsIgnoreCase("From Camera")) {
               /* TODO */
             } else if (item.getTitle().toString().equalsIgnoreCase("From Gallery")) {
               /* TODO */
             }
             popupMenu.dismiss();
             return true;
           }
         });
     popupMenu.show();
   } else if (v.getId() == submitButton.getId()) {
     if (IsValid()) {
       PostToServer();
     }
   }
 }
示例#24
0
  @Override
  public void onClick(View v) {
    if (v.getId() == R.id.app_connect_button) {
      // Intent intent = new Intent(getBaseContext(), CollectDataActivity.class);
      // startActivity(intent);;
      BluetoothHelper bluetoothHelper = BluetoothHelper.getInstance();
      final HashMap<String, String> pairedDevices = bluetoothHelper.GetPairedDevices();

      if (pairedDevices.isEmpty())
        Toast.makeText(this, "No paired devices found.", Toast.LENGTH_LONG).show();
      else
        SimpleDialogs.ChooseOption(
            this,
            pairedDevices.keySet().toArray(new String[pairedDevices.keySet().size()]),
            new DialogResponse() {
              @Override
              public void onDialogResponse(String deviceName) {
                String deviceAddress = pairedDevices.get(deviceName);
                Toast.makeText(
                        EntranceActivity.this, "Choosed device:" + deviceAddress, Toast.LENGTH_LONG)
                    .show();
                EntranceActivity.this.ConnectDevice(deviceAddress);
              }
            });
    }

    if (v.getId() == R.id.app_last_trips_button) {
      Intent intent = new Intent(getBaseContext(), LastTripsActivity.class);
      startActivity(intent);
    }
  }
  // check which button is pushed and do the turn
  public void clickTicTac(View view) {

    System.out.println("Button Pushed");
    ImageButton pushedButton = (ImageButton) findViewById(view.getId());

    int horizontal = Integer.parseInt(map.get(view.getId()).substring(0, 1));
    int vertical = Integer.parseInt(map.get(view.getId()).substring(1, 2));

    System.out.println(horizontal);
    System.out.println(vertical);

    if (board[horizontal][vertical] == 0) {

      System.out.println("box was empty, now filling..");
      // Do the human turn and check for a winner
      board[horizontal][vertical] = 1;
      pushedButton.setImageResource(R.mipmap.circle);
      checkWinner(1);

      System.out.println("image resource changed");

      // do the computer move and check for a winner
      computerTurn();
      System.out.println("Done computer turn");
      checkWinner(2);
    }
  }
 @Override
 public void onClick(View v) {
   if (v.getId() == R.id.btn_obdervable_test1) {
     if (RxBus.hasObservers()) {
       RxBus.send(new TapEvent());
     }
   } else if (v.getId() == R.id.btn_obdervable_test2) {
     if (RxBus.hasObservers()) {
       mRemoteServerEngine
           .loadMoreDataRx(1)
           .subscribeOn(Schedulers.io())
           .observeOn(Schedulers.io())
           .flatMap(refreshModels -> Observable.from(refreshModels))
           .filter(refreshModel -> !refreshModel.title.contains("4"))
           .take(3)
           .observeOn(AndroidSchedulers.mainThread())
           .subscribe(
               refreshModel -> {
                 if (RxBus.hasObservers()) {
                   RxBus.send(new RefreshModelEvent(refreshModel));
                 }
               });
     }
   }
 }
  @Override
  public void onClick(View v) {
    if (v.getId() == RHelper.get("id.rl_switch_block_groupmsg")) {
      toggleBlockGroup();
    } else if (v.getId() == RHelper.get("id.clear_all_history")) {
      String st9 = getResources().getString(RHelper.get("string.sure_to_empty_this"));
      new EaseAlertDialog(
              GroupDetailsActivity.this,
              null,
              st9,
              null,
              new AlertDialogUser() {

                @Override
                public void onResult(boolean confirmed, Bundle bundle) {
                  if (confirmed) {
                    clearGroupHistory();
                  }
                }
              },
              true)
          .show();
    } else if (v.getId() == RHelper.get("id.rl_blacklist")) // 黑名单列表
    startActivity(
          new Intent(GroupDetailsActivity.this, GroupBlacklistActivity.class)
              .putExtra("groupId", groupId));
    else if (v.getId() == RHelper.get("id.rl_change_group_name"))
      startActivityForResult(
          new Intent(this, EditActivity.class).putExtra("data", group.getGroupName()),
          REQUEST_CODE_EDIT_GROUPNAME);
  }
示例#28
0
  public void onPlayButtonClicked(View view) {
    if (view.getId() == R.id.play_album_button) {
      logStatus("Starting playback the list of tracks");
      mPlayer.play(TEST_ALBUM_TRACKS);
    } else {
      String uri;
      switch (view.getId()) {
        case R.id.play_track_button:
          uri = TEST_SONG_URI;
          break;
        case R.id.play_mono_track_button:
          uri = TEST_SONG_MONO_URI;
          break;
        case R.id.play_48khz_track_button:
          uri = TEST_SONG_48kHz_URI;
          break;
        case R.id.play_playlist_button:
          uri = TEST_PLAYLIST_URI;
          break;
        default:
          throw new IllegalArgumentException("View ID does not have an associated URI to play");
      }

      logStatus("Starting playback for " + uri);
      mPlayer.play(uri);
    }
  }
示例#29
0
  @Override
  public void onClick(View v) {
    if (click == 6 && answer_num[click] == 1) {
      Intent intent = new Intent();
      intent.putExtra("result", "6");

      getNew();
      setResult(1001, intent);
      this.finish();
      return;
    }
    if (v.getId() == R.id.ll_answer_o && answer_num[click] == 1) {
      click++;
      tv_answer_o.setText(answer_o[click]);
      tv_answer_t.setText(answer_t[click]);
      tv_answer_title.setText(answer_title[click]);
      return;
    } // 122121
    if (v.getId() == R.id.ll_answer_t && answer_num[click] == 2) {
      click++;
      tv_answer_o.setText(answer_o[click]);
      tv_answer_t.setText(answer_t[click]);
      tv_answer_title.setText(answer_title[click]);
      return;
    }
  }
示例#30
0
  public void retrieveWidgets() {
    home();
    clearWidgetList();
    ArrayList<View> viewList =
        (isInAndOutFocusEnabled()) ? solo.getViews() : solo.getCurrentViews();
    for (View w : viewList) {
      String text = (w instanceof TextView) ? ": " + ((TextView) w).getText().toString() : "";
      Log.d(
          "nofatclips",
          "Found widget: id="
              + w.getId()
              + " ("
              + w.toString()
              + ")"
              + text); // + " in window at [" + xy[0] + "," + xy[1] + "] on screen at [" + xy2[0] +
      // "," + xy2[1] +"]");

      //
      allViews.add(w);
      //

      if (w.getId() > 0) {
        theViews.put(w.getId(), w); // Add only if the widget has a valid ID
      }
      if (w instanceof TabHost) {
        setTabs((TabHost) w);
      }
    }
  }