diff options
author | Javier <dev.git@javispedro.com> | 2021-03-26 20:09:25 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2021-03-26 20:09:25 +0100 |
commit | 6b2dd5b290850301472a7097c84f76972b43b507 (patch) | |
tree | 670952beacb900aa15d4b9b3b367805cd18993c5 /app/src/main/res | |
parent | 558f29b84406b0d4b9493503f0ca02b35bfed9cf (diff) | |
download | rempe-6b2dd5b290850301472a7097c84f76972b43b507.tar.gz rempe-6b2dd5b290850301472a7097c84f76972b43b507.zip |
Add new Preferences activity and allow choosing temperature units
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/settings_activity.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/values/arrays.xml | 13 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 6 | ||||
-rw-r--r-- | app/src/main/res/xml/root_preferences.xml | 11 |
5 files changed, 39 insertions, 1 deletions
diff --git a/app/src/main/res/layout/settings_activity.xml b/app/src/main/res/layout/settings_activity.xml new file mode 100644 index 0000000..de6591a --- /dev/null +++ b/app/src/main/res/layout/settings_activity.xml @@ -0,0 +1,9 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <FrameLayout + android:id="@+id/settings" + android:layout_width="match_parent" + android:layout_height="match_parent" /> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml new file mode 100644 index 0000000..f82d234 --- /dev/null +++ b/app/src/main/res/values/arrays.xml @@ -0,0 +1,13 @@ +<resources> + <string-array name="settings_unit_entries"> + <item>Celsius</item> + <item>Fahrenheit</item> + <item>Kelvin</item> + </string-array> + + <string-array name="settings_unit_values"> + <item>celsius</item> + <item>fahrenheit</item> + <item>kelvin</item> + </string-array> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index cf00d3f..125df87 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,4 +1,3 @@ <resources> <dimen name="fab_margin">16dp</dimen> - <dimen name="text_margin">16dp</dimen> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c90f66a..df21b28 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,6 +14,8 @@ <string name="temperature_nothing">—</string> <string name="temperature_celsius">%.1f °C</string> + <string name="temperature_fahrenheit">%.0f °F</string> + <string name="temperature_kelvin">%.1f °K</string> <string name="last_24h">Last 24h:</string> @@ -40,4 +42,8 @@ <string name="connection_result_unrecognized">Unrecognized device</string> <string name="connection_result_unknown">Unknown failure</string> + <!-- Settings --> + <string name="settings_title">Settings</string> + <string name="settings_unit">Units</string> + </resources>
\ No newline at end of file diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml new file mode 100644 index 0000000..c360335 --- /dev/null +++ b/app/src/main/res/xml/root_preferences.xml @@ -0,0 +1,11 @@ +<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"> + + <ListPreference + app:key="units" + app:title="@string/settings_unit" + app:entries="@array/settings_unit_entries" + app:entryValues="@array/settings_unit_values" + app:defaultValue="celsius" + app:useSimpleSummaryProvider="true" /> + +</PreferenceScreen>
\ No newline at end of file |