Add context extensions for getBoolean, getInteger, getDimension.#434
Add context extensions for getBoolean, getInteger, getDimension.#434CosminMihuMDC wants to merge 2 commits intoandroid:masterfrom CosminMihuMDC:ContextExtensions
Conversation
|
These are resources. Why should we put them on context? |
|
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) Thanks. |
|
Then I think we should either deprecate that method or add these to Context in the framework. |
|
|
|
@romainguy You're right. |
|
But there's two useful variants of retrieving dimensions and you've (arguably) included the less-useful variant despite it's more appealing name. |
Add Context extensions for Resources methods:
getBoolean -> https://developer.android.com/reference/android/content/res/Resources.html#getBoolean(int)
getInteger -> https://developer.android.com/reference/android/content/res/Resources.html#getInteger(int)
getDimension -> https://developer.android.com/reference/android/content/res/Resources.html#getDimension(int)