Tried to port the CardView library in the compatibility libraries, but unfortunately at some point I broke it and its not working anymore.
Basically, the android-support-v7-cardview.jar referenced a lot of resource files.
For this I used the method prescribed by @warwound to create an R.java class, and reference all the resource files here. All the other libraries I ported using this method work.
For e.g.
but either the last update of the SDK or my changes at some level broke it and I keep getting the following:
I added the Eclipse project to the post.
I cant see what I am doing wrong as the radius is never zero.
Basically, the android-support-v7-cardview.jar referenced a lot of resource files.
For this I used the method prescribed by @warwound to create an R.java class, and reference all the resource files here. All the other libraries I ported using this method work.
For e.g.
B4X:
public static class dimen {
public static int default_margin = BA.applicationContext.getResources().getIdentifier("default_margin", "dimen", BA.packageName);
public static int default_margin_small = BA.applicationContext.getResources().getIdentifier("default_margin_small", "dimen", BA.packageName);
public static final int cardview_compat_inset_shadow=BA.applicationContext.getResources().getIdentifier("cardview_compat_inset_shadow", "dimen", BA.packageName);
public static final int cardview_default_radius=BA.applicationContext.getResources().getIdentifier("cardview_default_radius", "dimen", BA.packageName);
}
but either the last update of the SDK or my changes at some level broke it and I keep getting the following:
B4X:
LogCat connected to: 42f7b903479d9f59
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
** Activity (main) Create, isFirst = true **
RadiusDimen:4.0
ElevDimen:4.0
** Activity (main) Resume **
java.lang.IllegalArgumentException: radius must be > 0
at android.graphics.RadialGradient.<init>(RadialGradient.java:34)
at android.support.v7.widget.RoundRectDrawableWithShadow.buildShadowCorners(RoundRectDrawableWithShadow.java:285)
at android.support.v7.widget.RoundRectDrawableWithShadow.buildComponents(RoundRectDrawableWithShadow.java:307)
at android.support.v7.widget.RoundRectDrawableWithShadow.draw(RoundRectDrawableWithShadow.java:209)
at android.view.View.draw(View.java:13744)
at android.widget.FrameLayout.draw(FrameLayout.java:467)
at android.view.View.getDisplayList(View.java:12710)
at android.view.View.getDisplayList(View.java:12754)
at android.view.View.draw(View.java:13483)
at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
at android.view.View.getDisplayList(View.java:12708)
at android.view.View.getDisplayList(View.java:12754)
at android.view.View.draw(View.java:13483)
at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:870)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
at android.view.View.getDisplayList(View.java:12708)
at android.view.View.getDisplayList(View.java:12754)
at android.view.View.draw(View.java:13483)
at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
at android.view.View.draw(View.java:13762)
at android.view.View.getDisplayList(View.java:12710)
at android.view.View.getDisplayList(View.java:12754)
at android.view.View.draw(View.java:13483)
at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
at android.view.View.getDisplayList(View.java:12708)
at android.view.View.getDisplayList(View.java:12754)
at android.view.View.draw(View.java:13483)
at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
at android.view.View.getDisplayList(View.java:12708)
at android.view.View.getDisplayList(View.java:12754)
at android.view.View.draw(View.java:13483)
at android.view.ViewGroup.drawChild(ViewGroup.java:3169)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3039)
at android.view.View.draw(View.java:13762)
at android.widget.FrameLayout.draw(FrameLayout.java:467)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2390)
at android.view.View.getDisplayList(View.java:12710)
at android.view.View.getDisplayList(View.java:12754)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1144)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2271)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2143)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1954)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1110)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4470)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:525)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)
Message longer than Log limit (4000). Message was truncated.
I added the Eclipse project to the post.
I cant see what I am doing wrong as the radius is never zero.