Search in sources :

Example 1 with ColorPickerPreference

use of org.thoughtcrime.securesms.preferences.widgets.ColorPickerPreference in project Signal-Android by WhisperSystems.

the class CorrectedPreferenceFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    DialogFragment dialogFragment = null;
    if (preference instanceof ColorPickerPreference) {
        dialogFragment = ColorPickerPreferenceDialogFragmentCompat.newInstance(preference.getKey());
    } else if (preference instanceof CustomDefaultPreference) {
        dialogFragment = CustomDefaultPreference.CustomDefaultPreferenceDialogFragmentCompat.newInstance(preference.getKey());
    }
    if (dialogFragment != null) {
        dialogFragment.setTargetFragment(this, 0);
        dialogFragment.show(getFragmentManager(), "android.support.v7.preference.PreferenceFragment.DIALOG");
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : DialogFragment(androidx.fragment.app.DialogFragment) ColorPickerPreference(org.thoughtcrime.securesms.preferences.widgets.ColorPickerPreference) CustomDefaultPreference(org.thoughtcrime.securesms.components.CustomDefaultPreference)

Example 2 with ColorPickerPreference

use of org.thoughtcrime.securesms.preferences.widgets.ColorPickerPreference in project Signal-Android by signalapp.

the class CorrectedPreferenceFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    DialogFragment dialogFragment = null;
    if (preference instanceof ColorPickerPreference) {
        dialogFragment = ColorPickerPreferenceDialogFragmentCompat.newInstance(preference.getKey());
    } else if (preference instanceof CustomDefaultPreference) {
        dialogFragment = CustomDefaultPreference.CustomDefaultPreferenceDialogFragmentCompat.newInstance(preference.getKey());
    }
    if (dialogFragment != null) {
        dialogFragment.setTargetFragment(this, 0);
        dialogFragment.show(getFragmentManager(), "android.support.v7.preference.PreferenceFragment.DIALOG");
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : DialogFragment(androidx.fragment.app.DialogFragment) ColorPickerPreference(org.thoughtcrime.securesms.preferences.widgets.ColorPickerPreference) CustomDefaultPreference(org.thoughtcrime.securesms.components.CustomDefaultPreference)

Aggregations

DialogFragment (androidx.fragment.app.DialogFragment)2 CustomDefaultPreference (org.thoughtcrime.securesms.components.CustomDefaultPreference)2 ColorPickerPreference (org.thoughtcrime.securesms.preferences.widgets.ColorPickerPreference)2