Example #1
0
  @Override
  protected void onResume() {
    super.onResume();

    if (settings.getCallMode().equals(Settings.ARRAY_CALL_MODE_VOICE)) setProximityEnabled(true);

    if (mService != null && mService.getCurrentUser() != null)
      updateMuteDeafenMenuItems(mService.isMuted(), mService.isDeafened());

    // Clear chat notifications when activity is re-opened
    if (mService != null && settings.isChatNotifyEnabled()) {
      mService.setActivityVisible(true);
      mService.clearChatNotification();
    }
  }
Example #2
0
  @Override
  protected void onPause() {
    super.onPause();

    if (settings.getCallMode().equals(Settings.ARRAY_CALL_MODE_VOICE)) setProximityEnabled(false);

    if (mService != null) {
      mService.setActivityVisible(false);

      // Turn off push to talk when rotating so it doesn't get stuck on, except if it's in toggled
      // state.
      // if(settings.isPushToTalk() && !mTalkToggleBox.isChecked()) {
      //	mService.setRecording(false);
      // }
    }
  }
Example #3
0
  /**
   * Handles activity initialization when the Service has connected.
   *
   * <p>Should be called when there is a reason to believe that the connection might have became
   * valid. The connection MUST be established but other validity criteria may still be unfilled
   * such as server synchronization being complete.
   *
   * <p>The method implements the logic required for making sure that the Connected service is in
   * such a state that it fills all the connection criteria for ChannelList.
   *
   * <p>The method also takes care of making sure that its initialization code is executed only once
   * so calling it several times doesn't cause problems.
   */
  protected void onConnected() {
    // Tell the service that we are now visible.
    mService.setActivityVisible(true);

    // Update user control
    updateUserControlMenuItems();

    // Restore push to talk state, if toggled. Otherwise make sure it's turned off.
    if (settings.isPushToTalk() && mService.isRecording()) {
      if (settings.isPushToTalkToggle() && settings.isPushToTalkButtonShown()) setPushToTalk(true);
      else mService.setPushToTalk(false);
    }

    if (settings.isPushToTalk() && mService.isRecording())
      if (chatTarget != null) {
        listFragment.setChatTarget(chatTarget);
        chatFragment.setChatTarget(chatTarget);
      }

    // Showcase hints
    List<ShowcaseView> showcaseViews = new ArrayList<ShowcaseView>();
    if (settings.isPushToTalk() && settings.isPushToTalkButtonShown()) {
      ConfigOptions pttConfig = new ConfigOptions();
      pttConfig.shotType = ShowcaseView.TYPE_ONE_SHOT;
      pttConfig.showcaseId = Globals.SHOWCASE_PUSH_TO_TALK;
      showcaseViews.add(
          ShowcaseView.insertShowcaseView(
              pttView, this, R.string.hint_ptt, R.string.hint_ptt_summary, pttConfig));
    }

    if (mViewPager != null) {
      ConfigOptions switcherConfig = new ConfigOptions();
      switcherConfig.shotType = ShowcaseView.TYPE_ONE_SHOT;
      switcherConfig.showcaseId = Globals.SHOWCASE_SWITCHER;
      showcaseViews.add(
          ShowcaseView.insertShowcaseView(
              ShowcaseView.ITEM_ACTION_HOME,
              0,
              this,
              R.string.hint_switching,
              R.string.hint_switching_summary,
              switcherConfig));
    }

    ShowcaseViewQueue queue = new ShowcaseViewQueue(showcaseViews);
    queue.queueNext();
  }
  /**
   * Handles activity initialization when the Service has connected.
   *
   * <p>Should be called when there is a reason to believe that the connection might have became
   * valid. The connection MUST be established but other validity criteria may still be unfilled
   * such as server synchronization being complete.
   *
   * <p>The method implements the logic required for making sure that the Connected service is in
   * such a state that it fills all the connection criteria for ChannelList.
   *
   * <p>The method also takes care of making sure that its initialization code is executed only once
   * so calling it several times doesn't cause problems.
   */
  protected void onConnected() {
    // Tell the service that we are now visible.
    mService.setActivityVisible(true);

    // Update user control
    updateUserControlMenuItems();

    // Restore push to talk state, if toggled. Otherwise make sure it's turned off.
    if (settings.isPushToTalk() && mService.isRecording()) {
      if (settings.isPushToTalkToggle() && settings.isPushToTalkButtonShown()) setPushToTalk(true);
      else mService.setPushToTalk(false);
    }

    if (settings.isPushToTalk() && mService.isRecording())
      if (chatTarget != null) {
        listFragment.setChatTarget(chatTarget);
        chatFragment.setChatTarget(chatTarget);
      }
  }