Esempio n. 1
0
 private void pauseMusic() {
   player.pause();
   if (!task.isCancelled()) {
     task.cancel(true);
   }
   mSetupIb.setActivated(false);
   // isPlaying = false;
   state = STATE_PAUSE;
 }
Esempio n. 2
0
  private void updateMapLocationButtons(AutoPanMode mode) {
    mGoToMyLocation.setActivated(false);
    mGoToDroneLocation.setActivated(false);

    if (mapFragment != null) {
      mapFragment.setAutoPanMode(mode);
    }

    switch (mode) {
      case DRONE:
        mGoToDroneLocation.setActivated(true);
        break;

      case USER:
        mGoToMyLocation.setActivated(true);
        break;
      default:
        break;
    }
  }
Esempio n. 3
0
  @Override
  public void onDrawerClosed() {
    super.onDrawerClosed();

    if (actionDrawerToggle != null) actionDrawerToggle.setActivated(false);

    if (telemetryFragment == null) return;
    final View telemetryView = telemetryFragment.getView();
    if (telemetryView != null) {
      final int slidingDrawerWidth = telemetryView.getWidth();
      final boolean isSlidingDrawerOpened = isActionDrawerOpened();
      updateLocationButtonsMargin(isSlidingDrawerOpened, slidingDrawerWidth);
    }
  }
Esempio n. 4
0
 private void playMusic() {
   //        if (!isBlueToothHeadsetConnected()) {
   //            Toast.makeText(PlayerActivity.this, R.string.toast_play_bt_headset,
   // Toast.LENGTH_LONG)
   //                    .show();
   //            return;
   //        }
   player.start();
   task = new MediaObserver();
   task.execute();
   // task.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
   mSetupIb.setActivated(true);
   // isPlaying = true;
   state = STATE_PLAYING;
 }
Esempio n. 5
0
 private void resumeMusic() {
   if (!isBlueToothHeadsetConnected()) {
     Toast.makeText(PlayerActivity.this, R.string.toast_play_bt_headset, Toast.LENGTH_LONG).show();
     return;
   }
   //        try {
   //            player.prepare();
   //        } catch (IOException e) {
   //            e.printStackTrace();
   //        }
   player.start();
   task = new MediaObserver();
   task.execute();
   // task.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
   mSetupIb.setActivated(true);
   // isPlaying = true;
   state = STATE_PLAYING;
 }
Esempio n. 6
0
  @Override
  public void onCompletion(MediaPlayer mediaPlayer) {
    state = STATE_INIT;
    //        if (!task.isCancelled()) {
    //            task.cancel(true);
    //        }
    //        mCircle.setProgress(1.0f);
    mCircle.postDelayed(
        new Runnable() {
          @Override
          public void run() {
            mCircle.setVisibility(View.GONE);
          }
        },
        500);
    mSetupIb.setActivated(false);
    // isPlaying = false;

  }
 @Override
 public void setActivated(boolean isActivated) {
   ib_avar.setActivated(isActivated);
   viewBottomShadow.setActivated(isActivated);
 }