ExpectAnim Kotlin Animation Library

ExpectAnim is a Android Kotlin library which give you support to describe your animation and run with Materialize design. If you’re not familiar with this new Android official language then you can see my some previous post:

Now come with this cool library and firstly you must see the demo which is given below:

ExpectAnim Kotlin Android Library

How to implement ExpectAnim in your application

In your module

Maven

<dependency>

<groupId>com.github.florent37</groupId>

<artifactId>expectanim</artifactId>

<version>1.0.3</version>

<type>pom</type>

</dependency>

Gradle

compile ‘com.github.florent37:expectanim:1.0.3’

Ivy

<dependency org=‘com.github.florent37’ name=‘expectanim’ rev=‘1.0.3’>

<artifact name=‘expectanim’ ext=‘pom’ />

</dependency>

This code describe the image above

new ExpectAnim()
.expect(avatar)
.toBe(
bottomOfParent().withMarginDp(16),
leftOfParent().withMarginDp(16),
width(40).toDp().keepRatio()
)
.expect(name)
.toBe(
toRightOf(avatar).withMarginDp(16),
sameCenterVerticalAs(avatar),
toHaveTextColor(Color.WHITE)
)
.expect(subname)
.toBe(
toRightOf(name).withMarginDp(5),
sameCenterVerticalAs(name),
toHaveTextColor(Color.WHITE)
)
.expect(follow)
.toBe(
rightOfParent().withMarginDp(4),
bottomOfParent().withMarginDp(12),
toHaveBackgroundAlpha(0f)
)
.expect(message)
.toBe(
aboveOf(follow).withMarginDp(4),
rightOfParent().withMarginDp(4),
toHaveBackgroundAlpha(0f)
)
.expect(bottomLayout)
.toBe(
atItsOriginalPosition()
)
.expect(content)
.toBe(
atItsOriginalPosition(),
visible()
)
.toAnimation()
.setDuration(1500)
.start();

Source: ExpectAnim – Describe animation with Materialize » Tell Me How – A Place for Technology Geekier

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s