@Override
 protected void onDialogClosed(boolean positiveResult) {
   super.onDialogClosed(positiveResult);
   if (positiveResult) {
     persistBoolean(!getPersistedBoolean(true));
   }
 }
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   if (positiveResult) {
     persistInt(mColor);
   }
   super.onDialogClosed(positiveResult);
 }
示例#3
0
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    // Only if OK is pressed
    if (positiveResult) persistInt(mSeekBar.getProgress() + mMin);
  }
示例#4
0
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   super.onDialogClosed(positiveResult);
   Log.d(
       TAG,
       "positiveResult = "
           + positiveResult
           + " mIndex = "
           + mIndex
           + " mClickedDialogEntryIndex = "
           + mClickedDialogEntryIndex);
   // / M: Dialog dismiss is asynchronous, so hot-swap may reset the
   // mEntryValues
   if (positiveResult
       && mIndex != mClickedDialogEntryIndex
       && mEntryValues.size() > mClickedDialogEntryIndex) {
     // get the selected values --- simId
     long simId = mEntryValues.get(mClickedDialogEntryIndex);
     // pass simId to onPreferenceChangeListener
     if (callChangeListener(simId)) {
       mIndex = mClickedDialogEntryIndex;
       mAdapter.notifyDataSetChanged();
     }
   }
 }
示例#5
0
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   if (positiveResult) {
     CPDecksDBHelper.clearCachedApiData();
     UrlImageViewHelper.cleanup(mContext, 1);
   }
   super.onDialogClosed(positiveResult);
 }
示例#6
0
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   final float newValue = (float) mSeekBarValue / SEEKBAR_RESOLUTION;
   if (positiveResult && callChangeListener(newValue)) {
     setValue(newValue);
   }
   super.onDialogClosed(positiveResult);
 }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult && (mSelectedPackage != null)) {
      if (callChangeListener(mSelectedPackage)) {
        setValue(mSelectedPackage);
      }
    }
  }
 protected void onDialogClosed(boolean positiveResult) {
   if (positiveResult == true) {
     super.onDialogClosed(positiveResult);
     mPickInteger.onClick(null);
     mValue = mPickInteger.getCurrent();
     if (shouldPersist()) {
       persistInt(mValue);
     }
   }
 }
示例#9
0
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult) {
      int progress = mSeekBar.getProgress() + mMin;
      if (callChangeListener(progress)) {
        setValue(progress);
      }
    }
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    sInstances--;

    if (positiveResult) {
      mSeekBars.save();
    } else if (sInstances == 0) {
      mSeekBars.reset();
    }
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult && mPreferenceChanged) {
      final Set<String> values = mNewValues;
      if (callChangeListener(values)) {
        setValues(values);
      }
    }
    mPreferenceChanged = false;
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    // when the user selects "OK", persist the new value
    if (positiveResult) {
      int numberPickerValue = mNumberPicker.getValue();
      if (callChangeListener(numberPickerValue)) {
        setValue(numberPickerValue);
      }
    }
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult) {
      Editor editor = getEditor();
      editor.putString("display_color_calibration", DisplayColorCalibration.getCurColors());
      editor.commit();
    } else if (mOriginalColors != null) {
      DisplayColorCalibration.setColors(mOriginalColors);
    }
  }
示例#14
0
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   super.onDialogClosed(positiveResult);
   if (positiveResult) {
     lastHour = picker.getCurrentHour();
     lastMinute = picker.getCurrentMinute();
     String time = String.valueOf(lastHour) + ":" + String.valueOf(lastMinute);
     if (callChangeListener(time)) {
       persistString(time);
     }
   }
 }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult) {
      m_minutes = m_picker.getCurrentHour() * 60 + m_picker.getCurrentMinute();

      if (callChangeListener(m_minutes)) {
        persistInt(m_minutes);
        notifyChanged();
      }
    }
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    final int origValue = getValue();
    final int curValue = mPicker.getCurrent();

    if (positiveResult && (curValue != origValue)) {
      if (callChangeListener(curValue)) {
        saveValue(curValue);
      }
    }
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    Xlog.i(TAG, "mSelected = " + mSelected);
    Xlog.i(TAG, "mInitValue = " + mInitValue);
    if (positiveResult && mSelected >= 0 && (mSelected != mInitValue)) {

      Xlog.i(TAG, "callChangeListener");
      long value = mSimItemList.get(mSelected).mSimID;
      callChangeListener(value);
      mInitValue = mSelected;
    }
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult) {
      customPath = guessedPathsSpinner.getSelectedItem().toString();
      if (callChangeListener(customPath)) {
        persistString(customPath);
      }
    }

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
    preferences.unregisterOnSharedPreferenceChangeListener(this);
  }
  @Override
  protected void onDialogClosed(final boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult) {
      final int selectedValue = mNumberPicker.getValue();

      if (this.callChangeListener(selectedValue)) {
        mSelectedValue = selectedValue;

        this.updateSummary();
        this.persistInt(mSelectedValue);
      }
    }
  }
示例#20
0
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult) {
      progressDialog = new ProgressDialog(getContext());
      progressDialog.setTitle(null);
      progressDialog.setMessage(getContext().getString(R.string.pref_dialog_title_clearing_cache));
      progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progressDialog.setIndeterminate(true);
      progressDialog.setCancelable(false);

      new ClearCacheTask(getContext()).execute();
    }
  }
示例#21
0
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (!positiveResult) {
      return;
    }

    // Save changes to config.
    Config config = Config.getInstance();
    for (Group group : mGroups) {
      int value = group.seekBar.getProgress() * MULTIPLIER;
      group.option.write(config, getContext(), value, null);
    }
  }
示例#22
0
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    if (positiveResult) {
      calendar.set(Calendar.HOUR_OF_DAY, picker.getCurrentHour());
      calendar.set(Calendar.MINUTE, picker.getCurrentMinute());

      setSummary(getSummary());
      if (callChangeListener(calendar.getTimeInMillis())) {
        persistLong(calendar.getTimeInMillis());
        notifyChanged();
      }
    }
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    // If the user clicks CANCEL
    if (!positiveResult) {
      return;
    }

    // Persist current value if needed
    if (shouldPersist()) {
      persistLong(this.mSelectedDate.getMillis());
    }

    // Notify activity about changes (to update preference summary line)
    notifyChanged();
  }
  @Override
  protected void onDialogClosed(boolean positiveResult) {
    super.onDialogClosed(positiveResult);

    // Return if change was cancelled
    if (!positiveResult) {
      return;
    }

    // Persist current value if needed
    if (shouldPersist()) {
      persistInt(mCurrentValue);
    }

    // Notify activity about changes (to update preference summary line)
    notifyChanged();
  }
示例#25
0
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   super.onDialogClosed(positiveResult);
   if (positiveResult) {
     Set<String> longPrefStringSet = new HashSet<>(mKeyCombos.size());
     for (Long keyCombo : mKeyCombos) {
       longPrefStringSet.add(keyCombo.toString());
     }
     SharedPreferences sharedPreferences = getSharedPreferences();
     SharedPreferences.Editor editor = sharedPreferences.edit();
     String key = getKey();
     editor.putStringSet(key, longPrefStringSet);
     editor.apply();
     callChangeListener(longPrefStringSet);
     notifyChanged();
   } else {
     mKeyCombos = getKeyCodesForPreference(getContext(), getKey());
   }
 }
示例#26
0
    @Override
    protected void onDialogClosed(boolean positiveResult) {
      super.onDialogClosed(positiveResult);
      if (!positiveResult) {
        return;
      }

      reload();

      prefItem.setValueForEnable(enabledCheckBox.isChecked());
      prefItem.setValueForEngine((String) engineSpinner.getSelectedItem());
      prefItem.setValueForVolume(volumeSeekBar.getProgress() / 100.f);
      prefItem.setValueForPitch(pitchSeekBar.getProgress() / 10.f);
      prefItem.setValueForSpeechRate(rateSeekBar.getProgress() / 10.f);
      prefItem.setValueForPan((panSeekBar.getProgress() - 50) / 50.f);
      prefItem.commit(getSharedPreferences());

      reload();
    }
示例#27
0
 protected void onDialogClosed(boolean positiveResult) {
   super.onDialogClosed(positiveResult);
   if (positiveResult) getEditor().putInt(getKey(), stereoSeparation).commit();
 }
示例#28
0
 @Override
 protected void onDialogClosed(boolean positiveResult) {
   super.onDialogClosed(positiveResult);
 }