Skip to content

Commit

Permalink
Merge pull request #1727 from moneymanagerex/scheduled
Browse files Browse the repository at this point in the history
refine settings by setting summary
  • Loading branch information
guanlisheng authored Jun 25, 2024
2 parents 6b05de1 + 4c6ef95 commit f1c77b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ private void initializeControls() {

final ListPreference lstTheme = findPreference(getString(R.string.pref_theme));
if (lstTheme != null) {
String summary = settings.getGeneralSettings().getTheme();
lstTheme.setSummary(summary);
lstTheme.setOnPreferenceChangeListener((preference, newValue) -> {
Timber.d("setting theme: %s", newValue.toString());
lstTheme.setSummary(newValue.toString());

restartActivity();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
import androidx.preference.SwitchPreferenceCompat;

import timber.log.Timber;

/**
Expand Down Expand Up @@ -118,7 +119,6 @@ public void onCreate(Bundle savedInstanceState) {
}

// Font type

final ListPreference lstFont = findPreference(getString(PreferenceConstants.PREF_APPLICATION_FONT));
if (lstFont != null) {
lstFont.setOnPreferenceChangeListener((preference, newValue) -> {
Expand All @@ -134,11 +134,12 @@ public void onCreate(Bundle savedInstanceState) {
}

// Font size

final ListPreference lstFontSize = findPreference(getString(PreferenceConstants.PREF_APPLICATION_FONT_SIZE));
if (lstFontSize != null) {
lstFontSize.setSummary(lstFontSize.getValue());
lstFontSize.setOnPreferenceChangeListener((preference, newValue) -> {
Timber.d("Preference set: font = %s", newValue.toString());
lstFontSize.setSummary(newValue.toString());

RobotoView.setUserFontSize(getActivity().getApplicationContext(), newValue.toString());
return true;
Expand Down

0 comments on commit f1c77b7

Please sign in to comment.