Wednesday, February 24, 2021

A special form of MaterialCardView that has animated stroke

 SurroundCardView

SurroundCardView is a special form of MaterialCardView that has animated stroke.

Setup
Gradle
Add jcenter to your build.gradle in the root project.

allprojects {
    repositories {
        jcenter()
    }
}
Gradle
Add the library to the dependencies section

dependencies {
    implementation "com.furkanakdemir:surroundcardview:1.0.1"
}
Gradle
Usage
The example of SurroundCardView is the following:

<com.furkanakdemir.surroundcardview.SurroundCardView
    android:id="@+id/sampleSurroundCardView"
    android:layout_width="200dp"
    android:layout_height="200dp"
    app:cardCornerRadius="12dp"
    app:scv_duration="1000"
    app:scv_startPoint="bottom_start"
    app:scv_color="#03A9F4"
    app:scv_surrounded="true"
    app:scv_width="12dp" />

Attributes

Attribute Type Default Description

scv_duration Integer 600 the duration of a surround or a release animation in milliseconds

scv_width Dimension 4 dp the width of surrounding stroke

scv_color Color #03A9F4 the color of surrounding stroke

scv_startPoint StartPoint top_start the starting point of the animation

scv_surrounded Boolean false the initial visibility of the stroke 

No comments:

Post a Comment