expressview

Micro-Interaction library to animate like, react or other actions in an Android app.

License

License

GroupId

GroupId

co.ankurg.expressview
ArtifactId

ArtifactId

expressview
Last Version

Last Version

0.0.3
Release Date

Release Date

Type

Type

aar
Description

Description

expressview
Micro-Interaction library to animate like, react or other actions in an Android app.
Project URL

Project URL

https://github.com/ankurg22/ExpressView
Source Code Management

Source Code Management

https://github.com/ankurg22/ExpressView/tree/main

Download expressview

How to add to project

<!-- https://jarcasting.com/artifacts/co.ankurg.expressview/expressview/ -->
<dependency>
    <groupId>co.ankurg.expressview</groupId>
    <artifactId>expressview</artifactId>
    <version>0.0.3</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/co.ankurg.expressview/expressview/
implementation 'co.ankurg.expressview:expressview:0.0.3'
// https://jarcasting.com/artifacts/co.ankurg.expressview/expressview/
implementation ("co.ankurg.expressview:expressview:0.0.3")
'co.ankurg.expressview:expressview:aar:0.0.3'
<dependency org="co.ankurg.expressview" name="expressview" rev="0.0.3">
  <artifact name="expressview" type="aar" />
</dependency>
@Grapes(
@Grab(group='co.ankurg.expressview', module='expressview', version='0.0.3')
)
libraryDependencies += "co.ankurg.expressview" % "expressview" % "0.0.3"
[co.ankurg.expressview/expressview "0.0.3"]

Dependencies

compile (3)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.10
androidx.core » core-ktx jar 1.3.2
androidx.appcompat » appcompat jar 1.2.0

Project Modules

There are no modules declared in this project.

ExpressView

A micro-interaction library which enables animation for various actions or reactions. Inspired from Twitter's and Instagram's like button animation.

Platform API Twitter

ExpressView sample gif

Gradle Dependency

dependencies {
    implementation "co.ankurg.expressview:expressview:0.0.3"
}

XML

<co.ankurg.expressview.ExpressView
        android:id="@+id/likeButton"
        android:layout_width="64dp"
        android:layout_height="64dp" />

Observing check state

View reacts to clicks and maintains the state on its own. To listen to the check state change, implement the following callback.

import co.ankurg.expressview.OnCheckListener
...
likeButton.setOnCheckListener(object : OnCheckListener {
    override fun onChecked(view: ExpressView?) {
        Log.d(TAG, "Checked")
    }
    override fun onUnChecked(view: ExpressView?) {
        Log.d(TAG, "Unchecked")
    }
})

Attributes

Name Description Value Default
uncheckedIcon Uncheked icon sate Drawable Heart Icon
checkedIcon Checked icon state Drawable Heart Icon
uncheckedIconTint Unchecked icon color Color #A1A1A1A1
checkedIconTint Checked icon color Color #FFFF0000
iconSize Size of icon, applied to both widht & height Dimension 55% of ExpressView
burstColor Color of line burst behind the icon Color #FFFF0000
setChecked Initial check state of icon Boolean false

Note:- Default ExpressView size is 48dp and iconSize is 26dp (55% of 48dp)

Public Kotlin/Java properties

Name Description Value Default
isChecked Initial check state of icon Boolean false
animationStartDelay Delay between the tap and animation, applied to both icon and burst animations Long 50L
iconAnimationDuration Animation duration of icon inside ExpressView Long 700L
burstAnimationDuration Animation duration of line burst behind the icon Long 500L
interpolator Animation interpolator for the icon inside ExpressView Interpolator BounceInterpolator
onCheckListener Check state change listener/callback OnCheckListener null

Versions

Version
0.0.3
0.0.2
0.0.1