Skip to content

Metric & Imperial#398

Open
na7q wants to merge 1 commit into
ge0rg:masterfrom
na7q:Units-PR
Open

Metric & Imperial#398
na7q wants to merge 1 commit into
ge0rg:masterfrom
na7q:Units-PR

Conversation

@na7q

@na7q na7q commented Dec 27, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@ge0rg ge0rg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I've added a few comments.

Comment thread res/values/arrays.xml
</string-array>

<string-array name="p_units_ev">
<item>1</item> <item>2</item>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values "1" and "2" aren't useful. You can replace them with "metric" and "imperial" or completely remove the array and use getListItemIndex() to determine the configured value.

Comment thread res/values/strings.xml
<string name="p_ssid_summary">Station type (1..15; 9=Mobile, 10=APRS-IS)</string>
<string name="p_ssid_entry">Enter the SSID for your station</string>
<string name="p_units_title">Distance Units</string>
<string name="p_units">Unit Preference</string>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This preference should go into the "Display and Notifications" section. It can be the first item in the category. Then it should be named "Distance Units" and the sub-string should be removed, as it will be replaced by the selected value anyway.

Comment thread res/values/strings.xml
<string name="p_ssid_entry">Enter the SSID for your station</string>
<string name="p_units_title">Distance Units</string>
<string name="p_units">Unit Preference</string>
<string name="p_units_entry">Select Distance Unit</string>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've stopped adding distinct entry dialog titles, as every string needs to be translated into all languages, and the preference title ("Distance Units") can be re-used here.

Comment thread res/xml/preferences.xml
android:title="@string/p_units_title">

<de.duenndns.ListPreferenceWithValue
android:key="p.units"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key should be p_units for consistency with the other prefs in the main prefs screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants