Search in sources :

Example 1 with CustomSeekBarPreference

use of com.frostwire.android.gui.views.preference.CustomSeekBarPreference in project frostwire by frostwire.

the class TorrentPreferenceFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (preference instanceof CustomSeekBarPreference) {
        DialogFragment fragment;
        fragment = CustomSeekBarPreferenceDialog.newInstance((CustomSeekBarPreference) preference);
        fragment.setTargetFragment(this, 0);
        fragment.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : CustomSeekBarPreference(com.frostwire.android.gui.views.preference.CustomSeekBarPreference) DialogFragment(android.app.DialogFragment)

Example 2 with CustomSeekBarPreference

use of com.frostwire.android.gui.views.preference.CustomSeekBarPreference in project frostwire by frostwire.

the class TorrentPreferenceFragment method setupFWSeekbarPreference.

private void setupFWSeekbarPreference(final String key, final BTEngine btEngine) {
    final CustomSeekBarPreference pickerPreference = findPreference(key);
    if (pickerPreference != null) {
        pickerPreference.setOnPreferenceChangeListener((preference, newValue) -> {
            if (btEngine != null) {
                int newVal = (int) newValue;
                executeBTEngineAction(key, btEngine, newVal);
                return checkBTEngineActionResult(key, btEngine, newVal);
            }
            return false;
        });
    }
}
Also used : CustomSeekBarPreference(com.frostwire.android.gui.views.preference.CustomSeekBarPreference)

Aggregations

CustomSeekBarPreference (com.frostwire.android.gui.views.preference.CustomSeekBarPreference)2 DialogFragment (android.app.DialogFragment)1