-
Notifications
You must be signed in to change notification settings - Fork 80
Refactor Calligraphy into a ViewPump interceptor #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
chrisjenx
left a comment
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.
Let's also make this 14+ not that it probably makes much difference?
| } | ||
|
|
||
| public Builder setFontMapper(FontMapper fontMapper) { | ||
| this.fontMapper = fontMapper; |
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.
Can we move this FontMapper into a different PR?
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.
sure, will do
|
|
||
| import io.github.inflationx.viewpump.ReflectionUtils; | ||
|
|
||
| class CalligraphyFactory { |
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.
Do you think this should still be called Factory? The ViewPump#Interceptor calls into these methods right?
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.
Factory doesn't make as much sense now since it's further from the LayoutInflater.Factory, but I can't think of a better name. maybe just Calligraphy?
| textViewFont = CalligraphyUtils.pullFontPathFromTheme(context, styleForTextView[0], mAttributeId); | ||
| } | ||
|
|
||
| textViewFont = applyFontMapper(textViewFont); |
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.
again pull out into a seperate PR
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.
👍
|
|
||
| dependencies { | ||
| compile 'io.github.inflationx:viewpump:0.1.0-SNAPSHOT' | ||
| compile 'com.android.support:appcompat-v7:24.0.0' |
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.
@chrisjenx what do you think about dependencies here? keep viewpump compile or change to provided? what about appcompat, too?
sounds good. I just kept it the same as the original lib, but happy to make the bump to 14 |
|
Addressed comments |
With the LayoutInflater and ContextWrapper moved to ViewPump, Calligraphy can be refactored into a ViewPump interceptor.
This refactored version of Calligraphy will be namespaced as
calligraphy3due to the major breaking changes. This PR depends on SNAPSHOT version of ViewPump provided throughmavenLocal(), but will update it when a hosted snapshot becomes available.