codernaut / citizenconnect

Apache License 2.0
1 stars 9 forks source link

Strings should never be directly used in the app #28

Open wahibhaq opened 6 years ago

wahibhaq commented 6 years ago

I have noticed that text is directly quoted in classes which is a very bad practise. Strings should always be first created in strings.xml and then this resources should be references wherever needed.

See examples related to progressDialog in PhoneVerificationActivity progressDialog.setMessage("Verifying...");

I introduced these two new strings in last PR and tried to replace wherever "Please wait..." was used.

<string name="in_progress_msg">Please wait…</string>
<string name="completed_msg">Operation Completed!</string>

Also better if a certain naming convention is used in strings.xml for naming resources. I can guide if there is any confusion with names.

But I would suggest if @shahzaib414 can also replace the newly introduced strings in Release Demo PR

codernaut commented 6 years ago

agreed already we should be careful in the future

wahibhaq commented 6 years ago

Good to know but nevertheless someone should replace the strings currently existing in the code.

wahibhaq commented 6 years ago

@codernaut I created this issue with an intention to raise a point about need of referencing strings only from strings.xml but its sad to see that a lot of them are still used directly in the recent merge.

I can understand that its a bit of an extra effort but trust me it will be a much bigger hassle in future to change any string or to replace them. So it's like small investment for future.