Skip to content

Commit

Permalink
preference listens to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
midorikocak committed Oct 18, 2017
1 parent a550887 commit d7e46ff
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
mOpenPreferenceButton = (Button) view.findViewById(R.id.openPreferences);
mCurrencyFlagImageView = (ImageView) view.findViewById(R.id.selected_currency_flag_image_view);
mCurrencyPicker = CurrencyPicker.newInstance("Select Currency");
mCurrencyPicker.setCurrenciesList(preferences.getStringSet("selectedCurrencies", new HashSet<String>()));

mPickCurrencyButton.setOnClickListener(this);
mOpenFragmentButton.setOnClickListener(this);
mOpenPreferenceButton.setOnClickListener(this);

mTextView = (TextView) view.findViewById(R.id.selectedCurrencyPreference);
preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
mCurrencyPicker.setCurrenciesList(preferences.getStringSet("selectedCurrencies", new HashSet<String>()));
String selectedCurrency = preferences.getString("selectedCurrency", getString(R.string.default_currency));
mTextView.setText(selectedCurrency);

Expand Down

0 comments on commit d7e46ff

Please sign in to comment.