Scyla is a rotation safe canvas engine for Android. Available on maven. It's run inside a fragment so you can use it wherever you want !
Gradle dependency
compile 'fr.nelaupe:scyla:1.1.2@aar'
Maven dependency
<dependency>
<groupId>fr.nelaupe</groupId>
<artifactId>scyla</artifactId>
<version>1.1.2</version>
</dependency>
How simple is to create an "Hello word" that you can drag ?
public class myView extends ScylaCanvasView {
public myView(ViewHandler handler, Context context) {
super(handler, context);
}
@Override
public void addCustomElements(Scene scene, GridTemplate grid) {
final Text txt = new Text(context(), "Hello world", grid.getCenter());
scene.addStaticElement(txt);
this.subscribeTouchListener(txt,new TouchEvent() {
@Override
public void onTouch(Point point, TouchTypeEvent event) {
if(event == TouchTypeEvent.Move){
txt.gravityCenterFacet().moveGravityCenterTo(point);
}
}
});
}
}
Licensed under the Apache License, Version 2.0