daniel-stoneuk / material-about-library

Makes it easy to create beautiful about screens for your apps
Apache License 2.0
1.12k stars 140 forks source link

ConvenienceBuilder use "hardcoded" strings #29

Closed Robyer closed 7 years ago

Robyer commented 7 years ago

When using ConvenienceBuilder.createWebViewDialogItem() or ConvenienceBuilder.createEmailItem() it internally uses string.mal_close and string.mal_send_email resources.

I'm not sure if that can be considered as a bug or intention, but user is not able to provide own string for "close dialog" button or "send email" selector. Actually I can provide by own string in strings.xml for mal_close and mal_send_email but it doesn't look as a clean way and also it's undocumented.

So providing additional parameter for own string would be nice. And maybe for the dialog's button allow null to hide the close button completely?

(Or alternatively at least document somewhere that users have to provide own translations for these internal strings.)

daniel-stoneuk commented 7 years ago

It was my intention to have it like this, however I understand that this may not be preferred.

I had assumed that anyone who wanted to change the strings would override them in the app's resources but nevertheless I will add a new method that will allow you to pass in your own resources or strings (including null).

My initial idea for the library was to allow the user to code functionality themselves, yet the ConvenienceBuilder seems to be well liked so I will continue to develop it.

daniel-stoneuk commented 7 years ago

Parameters have been added to the ConvenienceBuilder & null can be passed to hide the buttons