Git Product home page Git Product logo

sliding-layout's Introduction

SlidingLayout

This little library lets you very easily create smooth transitions between two layouts of components in a special panel. The layouts are based on a grid, which can nest sub-grids and provides fixed/flexible columns and rows.

The library is fully documented (javadoc everywhere) to get you started quickly.

Note: The library uses the Universal Tween Engine under the hood, so you need to have this library in your classpath. It is compatible with the revision 6.3.3.

Examples

The following animated gif features an example of what can be done with the library.

There is also a Youtube video featuring the same demo with images. The source code of these examples is available in the demo folder of this project.

Help

Please use the issue tracker of this repository to report a bug. Else, there is a dedicated forum for you if you need some help to understand how it works or how to setup your project :)

License

The library is distributed under the Apache-2 License. Feel free to modify it, distribute it and include it in your projects as you want.

Howto's

General setup:

// First create the panel and give it a way to animate
// its transitions

SLPanel panel = new SLPanel();
panel.setTweenManager(SLAnimator.createTweenManager());

// Create your configurations

SLConfig config1 = ... ;
SLConfig config2 = ... ;

// Then set the panel to its initial configuration

panel.initialize(config1);

// Start the animation thread

SLAnimator.start();

// Now, whenever you want, you can fire a transition

panel.createTimeline()
	.push(new SLKeyframe(config2, 0.6f)
		.setEndSide(SLSide.BOTTOM, child1, child2)
		.setStartSide(SLSide.UP, child3, child4))
	.play();

Creating a layout configuration is very simple (extracted from the demo):

SLConfig mainCfg = new SLConfig(panel)
	.gap(10, 10)
	.row(1f).col(250).col(1f).col(2f)
	.beginGrid(0, 0)
		.row(2f).row(1f).col(1f)
		.place(0, 0, p1)
		.place(1, 0, p2)
	.endGrid()
	.beginGrid(0, 1)
		.row(1f).row(2f).col(1f)
		.place(0, 0, p3)
		.place(1, 0, p4)
	.endGrid()
	.place(0, 2, p5);

sliding-layout's People

Contributors

aurelienribon avatar dylan-chong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sliding-layout's Issues

SLAnimator.start() is missing in howto

In readme.md the howto section should include SLAnimator.start() otherwise the api does not seem to work.

It's also not createTimeline but createTransition.

Missing class SLAnimator

Hi Aurelien,

I've downloaded your sliding-layout demo recently and I've that there is a missing class 'aurelienribon.slidinglayout.SLAnimator'. Could you help me, please? am I supposed to write it?

Thanks,
Agustín.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.