diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-08-12 20:39:28 +0200 |
---|---|---|
committer | Charles Lombardo <clombardo169@gmail.com> | 2023-08-12 21:42:54 +0200 |
commit | 786b609151f4d80e4b9c1d4c1754c06f54b46338 (patch) | |
tree | 7318547ed7b0aea8540222223b3f00ee697ae036 /src/android/app | |
parent | android: Display setting value in setting list items (diff) | |
download | yuzu-786b609151f4d80e4b9c1d4c1754c06f54b46338.tar yuzu-786b609151f4d80e4b9c1d4c1754c06f54b46338.tar.gz yuzu-786b609151f4d80e4b9c1d4c1754c06f54b46338.tar.bz2 yuzu-786b609151f4d80e4b9c1d4c1754c06f54b46338.tar.lz yuzu-786b609151f4d80e4b9c1d4c1754c06f54b46338.tar.xz yuzu-786b609151f4d80e4b9c1d4c1754c06f54b46338.tar.zst yuzu-786b609151f4d80e4b9c1d4c1754c06f54b46338.zip |
Diffstat (limited to 'src/android/app')
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt | 13 | ||||
-rw-r--r-- | src/android/app/src/main/res/layout/dialog_slider.xml | 13 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt index ce0b92c90..afde186fd 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsAdapter.kt @@ -207,8 +207,11 @@ class SettingsAdapter( val sliderBinding = DialogSliderBinding.inflate(inflater) textSliderValue = sliderBinding.textValue - textSliderValue!!.text = sliderProgress.toString() - sliderBinding.textUnits.text = item.units + textSliderValue!!.text = String.format( + context.getString(R.string.value_with_units), + sliderProgress.toString(), + item.units + ) sliderBinding.slider.apply { valueFrom = item.min.toFloat() @@ -216,7 +219,11 @@ class SettingsAdapter( value = sliderProgress.toFloat() addOnChangeListener { _: Slider, value: Float, _: Boolean -> sliderProgress = value.toInt() - textSliderValue!!.text = sliderProgress.toString() + textSliderValue!!.text = String.format( + context.getString(R.string.value_with_units), + sliderProgress.toString(), + item.units + ) } } diff --git a/src/android/app/src/main/res/layout/dialog_slider.xml b/src/android/app/src/main/res/layout/dialog_slider.xml index 8c84cb606..d1cb31739 100644 --- a/src/android/app/src/main/res/layout/dialog_slider.xml +++ b/src/android/app/src/main/res/layout/dialog_slider.xml @@ -5,23 +5,16 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <TextView + <com.google.android.material.textview.MaterialTextView android:id="@+id/text_value" + style="@style/TextAppearance.Material3.LabelMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginBottom="@dimen/spacing_medlarge" android:layout_marginTop="@dimen/spacing_medlarge" - tools:text="75" /> - - <TextView - android:id="@+id/text_units" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignTop="@+id/text_value" - android:layout_toEndOf="@+id/text_value" - tools:text="%" /> + tools:text="75%" /> <com.google.android.material.slider.Slider android:id="@+id/slider" |