Example #1
0
 /**
  * Automatically linked with android:onClick in the layout.
  *
  * @param view
  */
 public void toggleEnableRecording(View view) {
   CheckBox b = (CheckBox) view;
   if (Utils.isFree(this)) {
     IntroTextDialog.showIntroTextIfNecessary(this, database, true);
     b.setChecked(false);
   }
   selected.setEnableRecording(b.isChecked());
 }
Example #2
0
  public void setRemoteSoundTypeFromSettings(int type) {
    if (Utils.isFree(this)) {
      type = Constants.REMOTE_SOUND_DISABLED;
    }

    int id = 0;
    switch (type) {
      case Constants.REMOTE_SOUND_DISABLED:
        id = R.id.radioRemoteSoundDisabled;
        break;
      case Constants.REMOTE_SOUND_ON_DEVICE:
        id = R.id.radioRemoteSoundOnDevice;
        break;
      case Constants.REMOTE_SOUND_ON_SERVER:
        id = R.id.radioRemoteSoundOnServer;
        break;
    }
    groupRemoteSoundType.check(id);
  }
Example #3
0
  /**
   * Sets the remote sound type in the settings from the specified parameter.
   *
   * @param view
   */
  public void setRemoteSoundTypeFromView(View view) {
    RadioGroup g = (RadioGroup) view;
    if (Utils.isFree(this)) {
      IntroTextDialog.showIntroTextIfNecessary(this, database, true);
      g.check(R.id.radioRemoteSoundDisabled);
    }

    int id = g.getCheckedRadioButtonId();
    int soundType = Constants.REMOTE_SOUND_DISABLED;
    switch (id) {
      case R.id.radioRemoteSoundOnServer:
        soundType = Constants.REMOTE_SOUND_ON_SERVER;
        break;
      case R.id.radioRemoteSoundOnDevice:
        soundType = Constants.REMOTE_SOUND_ON_DEVICE;
        break;
    }
    selected.setRemoteSoundType(soundType);
  }
Example #4
0
 /* (non-Javadoc)
  * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
  */
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.itemSaveAsCopy:
       if (selected.getNickname().equals(textNickname.getText().toString()))
         textNickname.setText("Copy of " + selected.getNickname());
       updateSelectedFromView();
       selected.set_Id(0);
       saveAndWriteRecent();
       arriveOnPage();
       break;
     case R.id.itemDeleteConnection:
       Utils.showYesNoPrompt(
           this,
           "Delete?",
           "Delete " + selected.getNickname() + "?",
           new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int i) {
               selected.Gen_delete(database.getWritableDatabase());
               database.close();
               arriveOnPage();
             }
           },
           null);
       break;
     case R.id.itemMainScreenHelp:
       showDialog(R.id.itemMainScreenHelp);
       break;
       // Disabling Manual/Wiki Menu item as the original does not correspond to this project
       // anymore.
       // case R.id.itemOpenDoc :
       //    Utils.showDocumentation(this);
       //    break;
   }
   return true;
 }
Example #5
0
 private void canvasStart() {
   if (selected == null) return;
   MemoryInfo info = Utils.getMemoryInfo(this);
   if (info.lowMemory) System.gc();
   start();
 }
Example #6
0
 /**
  * Automatically linked with android:onClick in the layout.
  *
  * @param view
  */
 public void remoteSoundTypeToggled(View view) {
   if (Utils.isFree(this)) {
     IntroTextDialog.showIntroTextIfNecessary(this, database, true);
   }
 }