Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Bigfixes, framework updates, support for font resources. #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MrBIMC
Copy link

@MrBIMC 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 {
Copy link
Owner

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 {
Copy link
Owner

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>
Copy link
Owner

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)
Copy link
Owner

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)
Copy link
Owner

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)
Copy link
Owner

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)
Copy link
Owner

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

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.

None yet

2 participants