本文主要是介绍SystemUI QSFactory插件解析,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
系统有默认的插件为 QSFactoryImpl,
QSTileHost 注册监听插件
pluginManager.addPluginListener(this, QSFactory.class, true);
在 QSTileHost 中把 默认插件和系统发现的插件都放入 mQsFactories,
然后有以下代码:
public QSTile createTile(String tileSpec) {for (int i = 0; i < mQsFactories.size(); i++) {QSTile t = mQsFactories.get(i).createTile(tileSpec);if (t != null) {return t;}}return null;}
public QSTileView createTileView(QSTile tile, boolean collapsedView) {for (int i = 0; i < mQsFactories.size(); i++) {QSTileView view = mQsFactories.get(i).createTileView(tile, collapsedView);if (view != null) {return view;}}throw new RuntimeException("Default factory didn't create view for " + tile.getTileSpec());
}
这篇关于SystemUI QSFactory插件解析的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!