Skip to content

Commit

Permalink
Change summary for font size multiplication setting
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Dec 28, 2024
1 parent 09fb646 commit bc27f3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import net.bible.service.common.htmlToSpan
import net.bible.service.device.ScreenSettings.autoModeAvailable
import org.crosswire.jsword.book.Books
import org.crosswire.jsword.book.FeatureType
import java.util.Locale

class PreferenceStore: PreferenceDataStore() {
private val prefs = CommonUtils.settings
Expand Down Expand Up @@ -224,9 +225,17 @@ class SettingsFragment : PreferenceFragmentCompat() {
val dictCategory = preferenceScreen.findPreference<PreferenceCategory>("dictionaries_category") as PreferenceCategory
dictCategory.isVisible = showGreek || showHebrew || showGreekMorph
val fontSizeMultiplier = preferenceScreen.findPreference<SeekBarPreference>("font_size_multiplier") as SeekBarPreference
fontSizeMultiplier.summary = getString(R.string.pref_font_size_multiplier_summary, CommonUtils.settings.fontSizeMultiplier.toString())
fontSizeMultiplier.summary = getString(
R.string.pref_font_size_multiplier_summary,
String.format(Locale.getDefault(), "%1.1f",
CommonUtils.settings.fontSizeMultiplierFloat)
)
fontSizeMultiplier.setOnPreferenceChangeListener { pref, newValue ->
fontSizeMultiplier.summary = getString(R.string.pref_font_size_multiplier_summary, (newValue as Int).toString())
fontSizeMultiplier.summary = getString(
R.string.pref_font_size_multiplier_summary,
String.format(Locale.getDefault(), "%1.2f",
CommonUtils.settings.fontSizeMultiplierFloat)
)
true
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1236,5 +1236,5 @@
Don\'t show this message again
</string>
<string name="pref_font_size_multiplier_title">Font size multiplier</string>
<string name="pref_font_size_multiplier_summary">Multiply font sizes by this number. Current value: %s%%</string>
<string name="pref_font_size_multiplier_summary">Multiply font sizes by this number. Current multiplication: %sx</string>
</resources>

0 comments on commit bc27f3e

Please sign in to comment.