SneakerView

How to install ?

You can add the library to your project using jitpack.io.

Add the code below to your project’s settings.gradle file.

 allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
        }
   }

Add the code below to your app’s gradle file.

 implementation 'com.github.osmangull:Sneaker:1.0'

Attributes

Attribute Description
activity* fragment* viewGroup* Context is required for sneaker (by default null)
title Title text for sneaker (by default “”)
iconVisible Setting icon visibility (by default true)
duration Sneaker visibility time (by default 3000)
autoHide Sneaker’s auto-off state (by default true)
buttonName action text for sneaker (by default “”)
arrowIcon action icon visibility with listener (by default false)
view* The sneaker type is selected in the SneakerType type (by default null)
listener Assign listener for arrow icon (by default null)
animation turn animations off and on (by default true)
animateRepeatCount number of animation repeats (by default 0)
animateDuration animation realization time (by default 2000)

Usage

 binding.success.setOnClickListener {
            Sneaker.Builder()
                .setActivity(this) /* optionally, these -> .setFragment() .setViewGroup() */
                .setType(SneakerType.Success)
                .setTitle("Success")
                .setSneakerDuration(3000)
                .setContent("Your transaction was successful")
                .setIconVisible(true)
                .setAnimateDuration(1000)
                .setAnimationRepeatCount(3)
                .setArrowIcon(true)
                .setButtonName("Action")
                .setAutoHide(false)
                .setArrowIcon(true)
                .setAnimation(true)
                .setButtonIconListener(object : SneakerListener {
                    override fun onClickListener() {
                        //TODO work to do
                    }
                })
                .build()

Libraries and resources used

https://github.com/Hamadakram/Sneaker

https://github.com/florent37/ViewAnimator

Developed By

Osman Gül

Linkedin

Furkan Akalın

Linkedin

GitHub

View Github