Bigfixes, framework updates, support for font resources. #23
base: master
Are you sure you want to change the base?
Conversation
MrBIMC
commented
Oct 18, 2017
- fixed potentially broken vector drawables on pre-lollipop devices
- added support for font resources introduced with supportlib-v26
- broke ResourcesAware interface as it now requires Pair<Context, Resources> instead of just Resources
@@ -15,20 +15,28 @@ allprojects { | |||
buildscript { | |||
repositories { | |||
jcenter() | |||
maven { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use google()
instead.
} | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
maven { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
factory() | ||
} | ||
} | ||
} | ||
|
||
val resources: Resources | ||
val resources: Pair<Context, Resources> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason for this change? You don't actually need a Context
.
typed("color", kotlin.Int::class.java) -> resources.getColor(id) | ||
typed("color", java.lang.Integer::class.java) -> resources.getColor(id) | ||
typed("color", ColorStateList::class.java) -> resources.getColorStateList(id) | ||
typed("color", kotlin.Int::class.java) -> ContextCompat.getColor(context, id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to use ContextCompat
instead of ResourcesCompat
?
typed("color", java.lang.Integer::class.java) -> resources.getColor(id) | ||
typed("color", ColorStateList::class.java) -> resources.getColorStateList(id) | ||
typed("color", kotlin.Int::class.java) -> ContextCompat.getColor(context, id) | ||
typed("color", java.lang.Integer::class.java) -> ContextCompat.getColor(context, id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
typed("color", ColorStateList::class.java) -> resources.getColorStateList(id) | ||
typed("color", kotlin.Int::class.java) -> ContextCompat.getColor(context, id) | ||
typed("color", java.lang.Integer::class.java) -> ContextCompat.getColor(context, id) | ||
typed("color", ColorStateList::class.java) -> ContextCompat.getColorStateList(context, id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
|
||
else -> throw UnsupportedOperationException("Unsupported resource (name = \"${resources.getResourceName(id)}\", type = \"${clazz.canonicalName}\")") | ||
typed("font", Typeface::class.java) -> ResourcesCompat.getFont(context, id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, now I see why you need a Context