Loading...

A Regular CardView which Can Flex From user Touches

Trying to find a perfect thing for giving life to your content on the android application. Then, this library might be the one you are looking for. There are numerous designs for giving a better user interface. Such as a cool box-shadow effect or a card view animation and many more. However, this one is a bit different and appealing compared to others. So, we present to you the ElasticView for your card view. Card views is a great option with a variety of libraries already available for a better user interface and different functionality. Undoubtedly, card view is great for various purposes. The Elastic view is a regular card view but with flex applied on the touch event of the user. This has a great Ui with all those card views moving on touch

Furthermore, the elastic view can improve the user experience on your projects. Especially, if you have numerous card views applied. It has been perfectly implemented to be very responsive and functions smoothly. On each touch, the position of touch is detected leading to the card content squeezing on the very position. However, the explanation might not make you clear about the library. So, let’s watch some screenshots to get a more clear view of the elastic view library.

Screenshots

Here are some screenshots of the project. These screenshots shall provide you with a great explanation of the library.

Requirements

However, this one is limited to only projects meeting the requirement.
It’s quite unfortunate, but the minimum requirement is certain to
cover many devices. Android 5.0 covers around 98%of android users.

The current min SDK version is API level 21.

Download

Now, let’s get into the actual project implementation. 

Gradle:

implementation 'com.github.armcha:ElasticView:0.2.0'

Setup and usage

After the implementation, let’s setup the elastic view to your project. Firstly, you can use it as a regular card view.

<io.armcha.elasticview.ElasticView
        android:id="@+id/imageElasticView"
        android:layout_width="..."
        android:layout_height="..."
        app:cardCornerRadius="10dp"
        app:cardElevation="5dp">
  
        <ChildView.../>
        <!--or without childView-->
  
</io.armcha.elasticview.ElasticView>

Customization

The customization is a bit limited for now. However, the option is enough to apply changes as per preference. For now, you are able to customize the flexibility values. However, keep it noted that the flexibility needs to be between 1f to 10f.


from code

elasticView.flexibility = 8f

or from xml

 <io.armcha.elasticview.ElasticView
        android:id="@+id/imageElasticView"
        android:layout_width="..."
        android:layout_height="..."
        app:flexibility="7"
        app:cardCornerRadius="10dp"
        app:cardElevation="5dp"/>

Download complete project source code from GitHub

CardView 2212582233876125351
Home item