use of com.willowtreeapps.hyperion.plugin.v1.PluginModule in project Hyperion-Android by willowtreeapps.
the class HyperionPluginView method onDetachedFromWindow.
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (modules != null) {
for (PluginModule module : modules) {
module.destroy();
}
}
pluginExtension.setHyperionMenu(null);
}
use of com.willowtreeapps.hyperion.plugin.v1.PluginModule in project Hyperion-Android by willowtreeapps.
the class HyperionPluginView method update.
private void update(Try<List<PluginModule>> result) {
try {
modules = result.get();
} catch (Throwable t) {
// TODO
t.printStackTrace();
return;
}
final Context context = new PluginExtensionContextWrapper(getContext(), pluginExtension);
final LayoutInflater inflater = LayoutInflater.from(context);
for (PluginModule module : modules) {
module.create(pluginExtension, context);
View view = module.createPluginView(inflater, pluginListContainer);
pluginListContainer.addView(view);
}
}
use of com.willowtreeapps.hyperion.plugin.v1.PluginModule in project Hyperion-Android by willowtreeapps.
the class PluginLoader method load.
@WorkerThread
List<PluginModule> load() {
List<PluginModule> plugins = new ArrayList<>();
ServiceLoader<Plugin> loader = ServiceLoader.load(Plugin.class);
for (Plugin plugin : loader) {
PluginModule module = plugin.createPluginModule();
if (module != null) {
plugins.add(module);
}
}
return plugins;
}
Aggregations