Hello,
craig wrote:
I'm trying to bind this class (follow link below):
http://codeviewer.org/view/code:27cb Click here to view code
I don't think you would like to "bind" the ActionBarSherlock's
"internal" stuff, which is not supposed to be touched by users. This is
my Metadata.xml when I try to bind it:
<metadata>
<remove-node path="/api/package[starts-with(@name,
'com.actionbarsherlock.internal')]" />
</metadata>
But anyways ActionBarSherlock binding won't work as expected, due to
this Android Library project binding issue regarding R class:
https://bugzilla.xamarin.com/show_bug.cgi?id=5617
I'm fixing this issue, but it isn't fixable in very few days.
(There's another non-blocking issue regarding 9-patch images which can
be workarounded by running build twice so far.)
In case you really need to bind that package, I'll explain some
internals of this sausage...
But in short: use 4.2.4 from alpha/beta channel which has a fix.
The important thing to note is that the class contains a method called
setEnabled.
However when I build the JAR binding project this method is not included in
the api.xml that is generated and it is causing an error in the generated C#
code since this method is missing.
Usually api.xml does not describe overriden methods in many cases. It is
because, the XML format is almost the same as AOSP (open source Android)
provided as API definition, which omitted those overrides.
When the generator binds a class, it tries to fill "missing" methods
from the class' implementing interfaces (unlike Java we need explicit
methods existence, so we fill them apart from api.xml class
description). There, the definitions are taken from the interface's
definition, so if a method comes from the interface and you want to make
changes to it, then it is the interface's definition which needs to be
modified.
But where is "android.view.View.OnClickListener" in the api.xml ... ?
The key is: the binding generator input is *not* only the "api.xml". The
referenced *.dlls are also used. In this case, Mono.Android.dll. The
generator extracts the API definition from the dll, and use it as if
there were another api.xml to retrieve required information.
At this point, you might have noticed: there is no way to make changes
to this assembly-based API definition. You have to deal with it.
But this "params" name is wrong. This is a bug in generator. I noticed
there is some overlook for mangling the names when they come from
assemblies (not XML) a couple of days ago and the fix is in 4.2.4 beta
(but not stable, or 4.2.3; you got a moment in time to catch my bug! ;-)
Hence, please use alpha/beta channel version to get around this issue.
But let me rephrase, I don't think you need the entire package. Just
remove them. And it doesn't work right now anyways...
Atsushi Eno
Below is the output from api.xml that pertains to this class. Any ideas why
the method is missing from api.xml? Is this a bug in mono for android or is
there something I can do in the transform file to fix it? Thanks.
<class abstract="false" deprecated="not deprecated"
extends="android.widget.LinearLayout"
extends-generic-aware="android.widget.LinearLayout" final="false"
name="ActionMenuItemView" static="false" visibility="public">
<implements name="android.view.View.OnClickListener"
name-generic-aware="android.view.View.OnClickListener">
</implements>
<implements name="android.view.View.OnLongClickListener"
name-generic-aware="android.view.View.OnLongClickListener">
</implements>
<implements
name="com.actionbarsherlock.internal.view.View_HasStateListenerSupport"
name-generic-aware="com.actionbarsherlock.internal.view.View_HasStateListenerSupport">
</implements>
<implements
name="com.actionbarsherlock.internal.view.menu.ActionMenuView.ActionMenuChildView"
name-generic-aware="com.actionbarsherlock.internal.view.menu.ActionMenuView.ActionMenuChildView">
</implements>
<implements
name="com.actionbarsherlock.internal.view.menu.MenuView.ItemView"
name-generic-aware="com.actionbarsherlock.internal.view.menu.MenuView.ItemView">
</implements>
<constructor deprecated="not deprecated" final="false"
name="ActionMenuItemView" static="false"
type="com.actionbarsherlock.internal.view.menu.ActionMenuItemView"
visibility="public">
<parameter name="p0" type="android.content.Context">
</parameter>
</constructor>
<constructor deprecated="not deprecated" final="false"
name="ActionMenuItemView" static="false"
type="com.actionbarsherlock.internal.view.menu.ActionMenuItemView"
visibility="public">
<parameter name="p0" type="android.content.Context">
</parameter>
<parameter name="p1" type="android.util.AttributeSet">
</parameter>
<parameter name="p2" type="int">
</parameter>
</constructor>
<constructor deprecated="not deprecated" final="false"
name="ActionMenuItemView" static="false"
type="com.actionbarsherlock.internal.view.menu.ActionMenuItemView"
visibility="public">
<parameter name="p0" type="android.content.Context">
</parameter>
<parameter name="p1" type="android.util.AttributeSet">
</parameter>
</constructor>
<method abstract="false" deprecated="not deprecated" final="false"
name="addOnAttachStateChangeListener" native="false" return="void"
static="false" synchronized="false" visibility="public">
<parameter name="p0"
type="com.actionbarsherlock.internal.view.View_OnAttachStateChangeListener">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="dispatchHoverEvent" native="false" return="boolean" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="android.view.MotionEvent">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="getItemData" native="false"
return="com.actionbarsherlock.internal.view.menu.MenuItemImpl"
static="false" synchronized="false" visibility="public">
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="hasText" native="false" return="boolean" static="false"
synchronized="false" visibility="public">
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="initialize" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0"
type="com.actionbarsherlock.internal.view.menu.MenuItemImpl">
</parameter>
<parameter name="p1" type="int">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="needsDividerAfter" native="false" return="boolean" static="false"
synchronized="false" visibility="public">
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="needsDividerBefore" native="false" return="boolean" static="false"
synchronized="false" visibility="public">
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="onClick" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="android.view.View">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="onFinishInflate" native="false" return="void" static="false"
synchronized="false" visibility="public">
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="onLongClick" native="false" return="boolean" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="android.view.View">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="prefersCondensedTitle" native="false" return="boolean" static="false"
synchronized="false" visibility="public">
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="removeOnAttachStateChangeListener" native="false" return="void"
static="false" synchronized="false" visibility="public">
<parameter name="p0"
type="com.actionbarsherlock.internal.view.View_OnAttachStateChangeListener">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="setCheckable" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="boolean">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="setChecked" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="boolean">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="setExpandedFormat" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="boolean">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="setIcon" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="android.graphics.drawable.Drawable">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="setItemInvoker" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0"
type="com.actionbarsherlock.internal.view.menu.MenuBuilder.ItemInvoker">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="setShortcut" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="boolean">
</parameter>
<parameter name="p1" type="char">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="setTitle" native="false" return="void" static="false"
synchronized="false" visibility="public">
<parameter name="p0" type="java.lang.CharSequence">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false"
name="showsIcon" native="false" return="boolean" static="false"
synchronized="false" visibility="public">
</method>
</class>
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/JAR-Binding-Problem-tp5710768.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid