Added field for custom server name#34
Added field for custom server name#34mario merged 5 commits intonextcloud:masterfrom Flole998:patch-1
Conversation
Preparing everything to change title in the app as mentioned in android issue 240
| mVersionMicro = 0; | ||
| mVersionString = ""; | ||
| mVersionString = ""; | ||
| mServerName = "Nextcloud"; |
There was a problem hiding this comment.
This needs to be set to app name, if possible, and not to Nextcloud. :)
There was a problem hiding this comment.
This is the default value in the constructor. To avoid nullpointer exception we have to initialize it to something. This get's overwritten later if the field is found.
There was a problem hiding this comment.
I meant you can initialize with the app name, aka R.string.app_name :)
There was a problem hiding this comment.
Sorry I misunderstood you there. Of course that is possible.
EDIT: I don't think that's possible as we are in the library here while R.string.app_name only exists within the App.
There was a problem hiding this comment.
@mario this is library code, R.string.app_name is part of the app project, so we need to use a "hardcoded value" here.
There was a problem hiding this comment.
That is only half-true. In strings.xml (of the library) you create an app_name and put "Nextcloud" there. Once included in a project it will be overwritten with the app's strings.xml app_name, and this is the approach we should take.
There was a problem hiding this comment.
Then you are right, so @Flole998 could you please add this string? :)
There was a problem hiding this comment.
It was not possible to do that as there is no context in that part of the library. I decided to leave the default value empty, that leaves handling up to the application using the library.
| JSONObject respTheming = respCapabilities.getJSONObject(NODE_THEMING); | ||
| // Add theming | ||
| capability.setServerName(respTheming.getString(PROPERTY_SERVERNAME)); | ||
| Log_OC.d(TAG, "*** Added " + NODE_THEMING); |
There was a problem hiding this comment.
I believe there are other properties here as well. Can you please add them?
|
👍 from me. @AndyScherzinger ? |
|
@mario I am fine with a merge, while due to the merge you would have to re-approve. |
|
Thanks for the contribution! |
Preparing everything to change title in the app as mentioned in nextcloud/android#240