@@ -0,0 +1,2373 @@
+package fr.tvbarthel.apps.simplethermometer;%0A%0A%0Aimport android.app.AlertDialog;%0Aimport android.app.Dialog;%0Aimport android.content.DialogInterface;%0Aimport android.content.SharedPreferences;%0Aimport android.os.Bundle;%0Aimport android.preference.PreferenceManager;%0Aimport android.support.v4.app.DialogFragment;%0Aimport android.widget.ArrayAdapter;%0A%0Apublic class TemperatureUnitPickerDialogFragment extends DialogFragment %7B%0A%0A%09private static final String BUNDLE_TEMPERATURE_UNIT_NAMES = %22BundleTemperatureUnitNames%22;%0A%09private static final String BUNDLE_TEMPERATURE_UNIT_SYMBOLS = %22BundleTemperatureUnitSymbols%22;%0A%0A%09private TemperatureUnitPickerDialogFragment() %7B%0A%09%09super();%0A%09%7D%0A%0A%09public static TemperatureUnitPickerDialogFragment newInstance(String%5B%5D temperatureUnitNames, String%5B%5D temperatureUnitSymbols) %7B%0A%09%09TemperatureUnitPickerDialogFragment fragment = new TemperatureUnitPickerDialogFragment();%0A%09%09Bundle arguments = new Bundle();%0A%09%09arguments.putStringArray(BUNDLE_TEMPERATURE_UNIT_NAMES, temperatureUnitNames);%0A%09%09arguments.putStringArray(BUNDLE_TEMPERATURE_UNIT_SYMBOLS, temperatureUnitSymbols);%0A%09%09fragment.setArguments(arguments);%0A%09%09return fragment;%0A%09%7D%0A%0A%09@Override%0A%09public Dialog onCreateDialog(Bundle savedInstanceState) %7B%0A%0A%09%09Bundle arguments = getArguments();%0A%09%09final String%5B%5D temperatureUnitNames = arguments.getStringArray(BUNDLE_TEMPERATURE_UNIT_NAMES);%0A%09%09final String%5B%5D temperatureUnitSymbols = arguments.getStringArray(BUNDLE_TEMPERATURE_UNIT_SYMBOLS);%0A%0A%09%09AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());%0A%09%09builder.setTitle(R.string.temperature_unit_picker_dialog_fragment_title);%0A%09%09final ArrayAdapter%3CString%3E arrayAdapterColorNames = new ArrayAdapter%3CString%3E(getActivity(),%0A%09%09%09%09android.R.layout.simple_expandable_list_item_1,%0A%09%09%09%09temperatureUnitNames);%0A%09%09builder.setAdapter(arrayAdapterColorNames, new DialogInterface.OnClickListener() %7B%0A%09%09%09@Override%0A%09%09%09public void onClick(DialogInterface dialog, int which) %7B%0A%09%09%09%09SharedPreferences defaultPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());%0A%09%09%09%09SharedPreferences.Editor editor = defaultPreferences.edit();%0A%09%09%09%09editor.putString(MainActivity.PREF_KEY_TEMPERATURE_UNIT_STRING, temperatureUnitSymbols%5Bwhich%5D);%0A%09%09%09%09editor.commit();%0A%09%09%09%7D%0A%09%09%7D);%0A%09%09builder.setCancelable(true);%0A%09%09builder.setNegativeButton(R.string.alert_dialog_cancel_button, null);%0A%0A%09%09return builder.create();%0A%09%7D%0A%7D%0A

Support Fahrenheit and Kelvin Unit(ter)