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);
}
}
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;
});
}
}
Aggregations