Search in sources :

Example 1 with DragSortListPreference

use of com.mobeta.android.dslv.DragSortListPreference in project Gadgetbridge by Freeyourgadget.

the class DeviceSpecificSettingsFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    DialogFragment dialogFragment;
    if (preference instanceof XTimePreference) {
        dialogFragment = new XTimePreferenceFragment();
        Bundle bundle = new Bundle(1);
        bundle.putString("key", preference.getKey());
        dialogFragment.setArguments(bundle);
        dialogFragment.setTargetFragment(this, 0);
        if (getFragmentManager() != null) {
            dialogFragment.show(getFragmentManager(), "androidx.preference.PreferenceFragment.DIALOG");
        }
    } else if (preference instanceof DragSortListPreference) {
        dialogFragment = new DragSortListPreferenceFragment();
        Bundle bundle = new Bundle(1);
        bundle.putString("key", preference.getKey());
        dialogFragment.setArguments(bundle);
        dialogFragment.setTargetFragment(this, 0);
        if (getFragmentManager() != null) {
            dialogFragment.show(getFragmentManager(), "androidx.preference.PreferenceFragment.DIALOG");
        }
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : DragSortListPreference(com.mobeta.android.dslv.DragSortListPreference) DragSortListPreferenceFragment(com.mobeta.android.dslv.DragSortListPreferenceFragment) Bundle(android.os.Bundle) DialogFragment(androidx.fragment.app.DialogFragment) XTimePreferenceFragment(nodomain.freeyourgadget.gadgetbridge.util.XTimePreferenceFragment) XTimePreference(nodomain.freeyourgadget.gadgetbridge.util.XTimePreference)

Aggregations

Bundle (android.os.Bundle)1 DialogFragment (androidx.fragment.app.DialogFragment)1 DragSortListPreference (com.mobeta.android.dslv.DragSortListPreference)1 DragSortListPreferenceFragment (com.mobeta.android.dslv.DragSortListPreferenceFragment)1 XTimePreference (nodomain.freeyourgadget.gadgetbridge.util.XTimePreference)1 XTimePreferenceFragment (nodomain.freeyourgadget.gadgetbridge.util.XTimePreferenceFragment)1