-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to set default region #321
Possibility to set default region #321
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature shows me that we have to explain carefully inside the next release notes what has been changed otherwise the user will only accidentally find this feature.
@@ -78,8 +86,18 @@ class RegionManagerActivity : BaseNavigationActivity() { | |||
currentCountryName = region.country.orEmpty() | |||
} | |||
|
|||
var regionDispName = region.name.orEmpty() | |||
var bgColor = Color.WHITE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As already mentioned, hard-coding colors makes re-styling complicated. I would define a color with a specific name. Since there are a lot of such lines in the code, it should be done in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, of course. This should be R.color.colorSecondaryLight
. Strange that I missed that.
@@ -159,4 +177,21 @@ class RegionManagerActivity : BaseNavigationActivity() { | |||
_updateHandler.finish() | |||
} | |||
} | |||
|
|||
private fun _selectDefaultRegion(regionId: Int) { | |||
val key = getString(R.string.default_region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the German word Standardgebiet
used internal as settings key? Because this string is defined in a file which is used to translate the app into other languages, this key changes for each language. It makes no sense and even can lead to the fact that the settings get lost, if the language is changed. I know, at the moment this cannot happen because the app is only available in German but in general it should be avoided. Why not just defining it in the setup.xml
?
Just like the pinning/archiving feature of Threema which I had not known before you told me. However, I have the same opinion and would prefer more visibility without adding additional UI widgets like a checkbox. |
app/src/main/res/values/strings.xml
Outdated
@@ -160,6 +163,8 @@ | |||
<string name="only_official_summits">Nur offizielle Gipfel</string> | |||
<string name="only_official_routes">Nur offizielle Wege</string> | |||
|
|||
<string name="default_region">Standardgebiet</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this definition is not used anymore after your last change.
Resolves #248