Skip to content
This repository was archived by the owner on Nov 14, 2018. It is now read-only.

Conversation

@CosminMihuMDC
Copy link

@CosminMihuMDC CosminMihuMDC commented Mar 13, 2018

@JakeWharton
Copy link
Contributor

These are resources. Why should we put them on context?

@CosminMihuMDC
Copy link
Author

CosminMihuMDC commented Mar 13, 2018

@JakeWharton

We already have Context.getString by default in Android Framework. (see https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/content/Context.java#LC555)
So, it could be a good idea to have also other simple methods from Resources in Context to be easily accessed like getString.

Thanks.

@JakeWharton
Copy link
Contributor

Then I think we should either deprecate that method or add these to Context in the framework.

@romainguy
Copy link
Contributor

getString() exists on Context because it's a very common task to do, a lot more than getBoolean() for instance.

@CosminMihuMDC
Copy link
Author

@romainguy You're right. getBoolean and getInteger are not so often used. On the other hand, getDimension could be really useful as getString is.

@JakeWharton
Copy link
Contributor

But there's two useful variants of retrieving dimensions and you've (arguably) included the less-useful variant despite it's more appealing name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants