Issue 1640 - Login preference strings and username check#42
Issue 1640 - Login preference strings and username check#42flerda merged 1 commit intoflerda:v2.1-devfrom hssm:Issue1640
Conversation
src/com/ichi2/anki/Preferences.java
Outdated
There was a problem hiding this comment.
Generally it is better to use TextUtils.isEmpty for these kind of checks.
It takes care of nulls for you (just in case).
There was a problem hiding this comment.
Thanks for the tip. I'll update that.
|
I've updated it to use TextUtils.isEmpty. After a bit of thought, I prefer keeping "Not logged in". It's direct and explains its purpose well enough. |
src/com/ichi2/anki/Preferences.java
Outdated
There was a problem hiding this comment.
Sorry for being pedantic!
I think this is an activity, so instead of getting the Resources you can just call getString().
Also getString() takes formatting arguments, so there should be no need for String.format().
Something like:
syncAccount.setSummary(getString(R.string.sync_account_summ_logged_in, username));should just work, but I do not have the code handy to try it out.
If it does not work, just let me know and let's leave it as is.
|
Cool, thanks a lot! |
Issue 1640 - Login preference strings and username check
As discussed, changed login strings and check for username instead of hkey.