How to add a cocoa pod to a codename one project

20 views
Skip to first unread message

medd...@gmail.com

unread,
Sep 13, 2018, 7:17:09 AM9/13/18
to CodenameOne Discussions
Hi,
I'm new to cn1. I want to add a pod so I can use it directly on my codename 1 projet. The pod is :https://github.com/yourtion/YXWaveView   a layout of a wave effect that I want to add as visual component to my cn1 Form.    Is there anyway to make this possible ? If yes, please provide me with the detailed process because I already tried what around on the net but in vain. 

Thanks in advance.


IDE: IDEA
Desktop OS : mac OS Heigh Sierra
Simulator : Codename One
Device : iPhone X, Samsung S*

Shai Almog

unread,
Sep 13, 2018, 11:10:11 PM9/13/18
to CodenameOne Discussions
Hi,
you can add it easily but it won't help you in a Codename One application.

Since the application is rendered using Java the view animation you see there won't work for the Codename One view. It will see it as just a view drawing graphics. Obviously won't work for platforms like Android etc.

Having said that this effect is pretty trivial to implement in Codename One using several approaches. The simplest would be to have a set of image frames for the animation and just updating them on the fly. A more elaborate implementation can set a bgPainter to the toolbar area and draw the wave effect using a Shape curve. Then use padding to move the content of the toolbar with the motions of the wave.


medd...@gmail.com

unread,
Sep 14, 2018, 4:37:31 AM9/14/18
to CodenameOne Discussions
Hello, 
Thanks for your reply. I want to add it as a view in a native interface, so I can display it on iOS devices. Is this possible ?
Besides that, can you please provide a detailed/concrete way on how to add a pod to the project. The tutos on the net didn't help me much :/

Shai Almog

unread,
Sep 15, 2018, 12:46:20 AM9/15/18
to CodenameOne Discussions
Hi,
you would need to write that view in native code too... In that situation why use Codename One at all?

It's just a build hint with the URL of the cocoapod.
Reply all
Reply to author
Forward
0 new messages