public boolean onGenericMotionEvent(android.view.MotionEvent event) {
if (ScriptLoader.isCalledFromJRuby()) return super.onGenericMotionEvent(event);
if (!JRubyAdapter.isInitialized()) {
Log.i("Method called before JRuby runtime was initialized: RubotoActivity#onGenericMotionEvent");
return super.onGenericMotionEvent(event);
}
String rubyClassName = scriptInfo.getRubyClassName();
if (rubyClassName == null) return super.onGenericMotionEvent(event);
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :onGenericMotionEvent}")) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onGenericMotionEvent", event);
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(false).any?{|m| m.to_sym == :on_generic_motion_event}")) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_generic_motion_event", event);
} else {
if ((Boolean)JRubyAdapter.runScriptlet(rubyClassName + ".instance_methods(true).any?{|m| m.to_sym == :on_generic_motion_event}")) {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "on_generic_motion_event", event);
} else {
return (Boolean) JRubyAdapter.runRubyMethod(Boolean.class, scriptInfo.getRubyInstance(), "onGenericMotionEvent", event);
}
}
}
}