use string arguments

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-10-29 11:54:46 +01:00 committed by Alper Öztürk
parent 8b499fbe5d
commit 3fda8d3567
2 changed files with 14 additions and 21 deletions

View file

@ -40,16 +40,16 @@ class InternalTwoWaySyncActivity : BaseActivity(), Injectable {
private fun setupTwoWaySyncInterval() {
val durations = listOf(
15.minutes to getString(R.string.two_way_sync_interval_15_min),
30.minutes to getString(R.string.two_way_sync_interval_30_min),
45.minutes to getString(R.string.two_way_sync_interval_45_min),
1.hours to getString(R.string.two_way_sync_interval_1_hour),
2.hours to getString(R.string.two_way_sync_interval_2_hours),
4.hours to getString(R.string.two_way_sync_interval_4_hours),
6.hours to getString(R.string.two_way_sync_interval_6_hours),
8.hours to getString(R.string.two_way_sync_interval_8_hours),
12.hours to getString(R.string.two_way_sync_interval_12_hours),
24.hours to getString(R.string.two_way_sync_interval_24_hours)
15.minutes to getString(R.string.two_way_sync_interval_minutes, "15"),
30.minutes to getString(R.string.two_way_sync_interval_minutes, "30"),
45.minutes to getString(R.string.two_way_sync_interval_minutes, "45"),
1.hours to getString(R.string.two_way_sync_interval_hour, "1"),
2.hours to getString(R.string.two_way_sync_interval_hours, "2"),
4.hours to getString(R.string.two_way_sync_interval_hours, "4"),
6.hours to getString(R.string.two_way_sync_interval_hours, "6"),
8.hours to getString(R.string.two_way_sync_interval_hours, "8"),
12.hours to getString(R.string.two_way_sync_interval_hours, "12"),
24.hours to getString(R.string.two_way_sync_interval_hours, "24")
)
val selectedDuration = durations.find { it.first.inWholeMinutes == preferences.twoWaySyncInterval }
@ -61,7 +61,7 @@ class InternalTwoWaySyncActivity : BaseActivity(), Injectable {
binding.twoWaySyncInterval.run {
setAdapter(adapter)
setText(selectedDuration?.second ?: getString(R.string.two_way_sync_interval_15_min), false)
setText(selectedDuration?.second ?: getString(R.string.two_way_sync_interval_minutes, "15"), false)
setOnItemClickListener { _, _, position, _ ->
handleDurationSelected(durations[position].first.inWholeMinutes)
}

View file

@ -118,16 +118,9 @@
<string name="prefs_two_way_sync_switch_title">Enable two way sync</string>
<string name="prefs_two_way_sync_interval">Interval</string>
<string name="two_way_sync_interval_15_min">15 minutes</string>
<string name="two_way_sync_interval_30_min">30 minutes</string>
<string name="two_way_sync_interval_45_min">45 minutes</string>
<string name="two_way_sync_interval_1_hour">1 hour</string>
<string name="two_way_sync_interval_2_hours">2 hours</string>
<string name="two_way_sync_interval_4_hours">4 hours</string>
<string name="two_way_sync_interval_6_hours">6 hours</string>
<string name="two_way_sync_interval_8_hours">8 hours</string>
<string name="two_way_sync_interval_12_hours">12 hours</string>
<string name="two_way_sync_interval_24_hours">24 hours</string>
<string name="two_way_sync_interval_minutes">%1$s minutes</string>
<string name="two_way_sync_interval_hour">%1$s hour</string>
<string name="two_way_sync_interval_hours">%1$s hours</string>
<string name="recommend_subject">Try %1$s on your device!</string>
<string name="recommend_text">I want to invite you to use %1$s on your device.\nDownload here: %2$s</string>