Skip to content
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

fix(core): LayoutInflater.getFactory()行为保持和正常app一致 #546

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

shifujun
Copy link
Collaborator

AppCompat有一个installViewFactory逻辑,依赖于判断layoutInflater.getFactory() == null才正常安装。
而ShadowLayoutInflater已经设置了Factory,所以对于插件代码来说,虽然还能够setFactory,
但是getFactory()返回的就不是null了。

添加一个Transform,将插件中原本的getFactory()修改为ShadowLayoutInflater.getOriginalFactory,
从而保持插件代码getFactory()时总能获取到自己原本设置的Factory。

fix #214

AppCompat有一个installViewFactory逻辑,依赖于判断layoutInflater.getFactory() == null才正常安装。
而ShadowLayoutInflater已经设置了Factory,所以对于插件代码来说,虽然还能够setFactory,
但是getFactory()返回的就不是null了。

添加一个Transform,将插件中原本的getFactory()修改为ShadowLayoutInflater.getOriginalFactory,
从而保持插件代码getFactory()时总能获取到自己原本设置的Factory。

fix Tencent#214
@shifujun shifujun force-pushed the issue214 branch 2 times, most recently from c67d462 to eb0a0f4 Compare June 23, 2021 11:37
@shifujun
Copy link
Collaborator Author

ReactiveCircus/android-emulator-runner#160

Android自动化测试暂时挂了。在本地测了没问题。

@shifujun shifujun merged commit c710a18 into Tencent:master Jun 23, 2021
@shifujun shifujun deleted the issue214 branch June 23, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AndroidX 自定义字体不生效
1 participant