Android Bindings Library

Hello,

I'm trying to create Android Bindings Library for PageIndicatorView (github.com/romandanylyk/PageIndicatorView) but without success.

I managed to resolve compiler errors by adding following code to Metadata.xml:

<remove-node path="/api/package[@name='com.rd']/interface[@name='IndicatorManager.Listener']" />

<attr path="/api/package[@name='com.rd.animation.type']/class[@name='ColorAnimation']/method[@name='createAnimator']" name="managedReturn">Java.Lang.Object</attr>
<attr path="/api/package[@name='com.rd.animation.type']/class[@name='ColorAnimation']/method[@name='progress']" name="managedReturn">Com.RD.Animation.Type.BaseAnimation</attr>

<attr path="/api/package[@name='com.rd.animation.type']/class[@name='DropAnimation']/method[@name='createAnimator']" name="managedReturn">Java.Lang.Object</attr>
<attr path="/api/package[@name='com.rd.animation.type']/class[@name='DropAnimation']/method[@name='progress']" name="managedReturn">Com.RD.Animation.Type.BaseAnimation</attr>

<attr path="/api/package[@name='com.rd.animation.type']/class[@name='SlideAnimation']/method[@name='createAnimator']" name="managedReturn">Java.Lang.Object</attr>
<attr path="/api/package[@name='com.rd.animation.type']/class[@name='SlideAnimation']/method[@name='progress']" name="managedReturn">Com.RD.Animation.Type.BaseAnimation</attr>

<attr path="/api/package[@name='com.rd.animation.type']/class[@name='SwapAnimation']/method[@name='createAnimator']" name="managedReturn">Java.Lang.Object</attr>
<attr path="/api/package[@name='com.rd.animation.type']/class[@name='SwapAnimation']/method[@name='progress']" name="managedReturn">Com.RD.Animation.Type.BaseAnimation</attr>

<attr path="/api/package[@name='com.rd.animation.type']/class[@name='WormAnimation']/method[@name='createAnimator']" name="managedReturn">Java.Lang.Object</attr>
<attr path="/api/package[@name='com.rd.animation.type']/class[@name='WormAnimation']/method[@name='progress']" name="managedReturn">Com.RD.Animation.Type.BaseAnimation</attr>

It builds now, but I'm getting runtime error java.lang.ClassNotFoundException: Didn't find class "com.rd.PageIndicatorView". I can see that PageIndicatorView.cs is not generated at all.

Here are some of the warnings I get after successful build.

BINDINGSGENERATOR : warning BG8604: top ancestor PageIndicatorView not found for nested type Com.RD.PageIndicatorView.1.
BINDINGSGENERATOR : warning BG8604: top ancestor PageIndicatorView not found for nested type Com.RD.PageIndicatorView.2.
BINDINGSGENERATOR : warning BG8604: top ancestor PageIndicatorView not found for nested type Com.RD.PageIndicatorView.3.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method CreateFromXml in managed type Android.Content.Res.ColorStateList.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method CreateFromXml in managed type Android.Content.Res.ColorStateList.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method ParseBundleExtras in managed type Android.Content.Res.Resources.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method CreateFromXml in managed type Android.Graphics.Drawables.Drawable.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method CreateFromXml in managed type Android.Graphics.Drawables.Drawable.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method CreateFromXmlInner in managed type Android.Graphics.Drawables.Drawable.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method CreateFromXmlInner in managed type Android.Graphics.Drawables.Drawable.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method Inflate in managed type Android.Graphics.Drawables.Drawable.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method Inflate in managed type Android.Graphics.Drawables.Drawable.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method ParseIntent in managed type Android.Content.Intent.
BINDINGSGENERATOR : warning BG8800: Unknown parameter type System.Xml.XmlReader in method ReadFromXml in managed type Android.Content.IntentFilter.
BINDINGSGENERATOR : warning BG8900: Type com.rd.draw.drawer.Drawer: FxDG naming violation: Type name 'Drawer' matches namespace part 'Drawer'.
BINDINGSGENERATOR : warning BG8900: Type com.rd.draw.drawer.Drawer: FxDG naming violation: Type name 'Drawer' matches namespace part 'Drawer'.
BINDINGSGENERATOR : warning BG8900: Type com.rd.draw.drawer.Drawer: FxDG naming violation: Type name 'Drawer' matches namespace part 'Drawer'.
BINDINGSGENERATOR : warning BG8900: Type com.rd.draw.drawer.Drawer: FxDG naming violation: Type name 'Drawer' matches namespace part 'Drawer'.

I added a reference to System.Xml to resolve warning BG8800: Unknown parameter type System.Xml.XmlReader in method...

I also tried to resolve warning BG8604: top ancestor PageIndicatorView not found for nested type... by adding following code to Metadata.xml:

<add-node path="/api/package[@name='com.rd']">
    <class abstract="false" deprecated="not deprecated" final="false" name="PageIndicatorView" static="false" visibility="public" extends="android.view.View"></class>
</add-node>

After adding this, PageIndicatorView.cs is generated and warning BG8604: top ancestor PageIndicatorView not found for nested type... disappears, but I'm still getting runtime error java.lang.ClassNotFoundException: Didn't find class "com.rd.PageIndicatorView".

How to get working PageIndicatorView.cs? Do I need to add all constructors, fields and methods manually with <add-node/>?
PageIndicatorView implements IndicatorManager.Listener which is not accessible outside a package. That is the reason I added <remove-node path="/api/package[@name='com.rd']/interface[@name='IndicatorManager.Listener']" /> to Metadata.xml. Could this be a source of the issue?

I'm stuck with this and I would appreciate any kind of help,
Thank you

Answers

Sign In or Register to comment.