Comments (3)
dialog或者其他view,如果是宿主提供的,它所需的资源也在宿主中,就应该让宿主inflate出来再交给插件使用。
要注意宿主和插件的多对多版本关系。如果不是通过稳定的Java接口相互调用,比如在插件中直接访问宿主的资源。那么可能在宿主的不同版本中这个资源就发生变化了。对于xml中依赖的资源id来说,就更不稳定了。所以插件inflate宿主的view在多对多版本模型下是不可行的。
from shadow.
dialog的layout以及其中的drawable均是宿主的。插件中仅调用了dialog.show()。Layout的Inflate是宿主创建的,并且能够创建成功,但是其宿主的Layout中如果使用了宿主的drawable,则会Resources$NotFoundException。
总结就是
宿主:
MDialog、Layout、Drawable。
插件:
仅调用new MDialog(ShadowContext).show()
按照你的说法,我需要单独实现一个接口,该接口调用宿主的弹窗创建能力?但是我的Context使用容器的Context还是哪个?
另外,我有一点不明白的是,Mdialog的Layout我能正确infalte成功(如果布局里面不设置宿主的Drawable),但是加上宿主的Drawable就失败。Drawable只是示例,dimen也是一样的问题。
from shadow.
我在创建Resource时,将宿主的sourceDir添加到插件的AssetManager中。
from shadow.
Related Issues (20)
- com.tencent.shadow.plugin 这个插件最大支持的 AGP 和 Gradle 版本分别是多少?还有 compileSdk 版本? HOT 10
- 插件中使用 WorkManager 时启动插件出错 HOT 1
- 线上偶现Rejecting re-init on previously-failed class xxx,NoClassDefFoundError Class not found using the boot class loader; no stack trace available HOT 1
- gradle执行transformClassesWithShadowTransformForPluginDebug任务时卡住 HOT 6
- NoSuchMethodException: com.android.tools.apk.analyzer.BinaryXmlParser.decodeXml 错误 HOT 2
- transformClassesWithShadowTransformForPluginDebug执行时卡住 HOT 1
- Unsupported class loader HOT 2
- 关于插件uuid的设计问题 HOT 9
- 多插件运行时崩溃问题 HOT 10
- PluginLoaderImpl类加载器出现java.lang.LinkageError
- 在插件中使用packageManager.queryIntentActivities(@NonNull Intent intent, int flags) HOT 7
- 使用shadow反射插件资源时出现异常 HOT 2
- onNewIntent可能丢失数据
- 崩溃必现 android.util.SuperNotCalledException: Activity {com.xx.act.DefaultContainerActivity} did not call through to super.onCreate() HOT 1
- 替换add和findFragmentByTag等调用,给插件fragment的tag都加个前缀,是否可行?@shifujun
- 这样开发出来的app能上google play? HOT 1
- 想将android.content.res.TypedArray#getDrawable hook住,但是编译报错 HOT 2
- 插件中SO库更新问题
- 关于仿写插件访问sample-host-lib中HostAddPluginViewContainerHolder的疑问
- 升级com.google.android.material:material到1.11.0后编译报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shadow.