/PulseView

Widget that generates pulsation relative to your icons. Tinder search like.

Primary LanguageJavaApache License 2.0Apache-2.0

PulseView

Widget that generates pulsation relative to your icons.

DevLight

Android Arsenal Android Download Crates.io Codacy Badge

You can check the sample app here.

Download

You can download an .aar from GitHub's releases page.

Or alternatively use Gradle jCenter:

dependencies {
    repositories {
        mavenCentral()
        maven {
            url  'http://dl.bintray.com/gigamole/maven/'
        }
    }
    compile 'com.github.devlight.pulseview:library:+'
}

Gradle Maven Central:

compile 'com.github.devlight.pulseview:library:1.0.2'

Maven:

<dependency>
    <groupId>com.github.devlight.pulseview</groupId>
    <artifactId>library</artifactId>
    <version>1.0.2</version>
    <type>aar</type>
</dependency>

Android SDK Version

PulseView requires a minimum SDK version of 11.

Sample

Parameters

For PulseView you can set such parameters as:

  • icon:

    at first you need to set icon for PulseView.

  • icon width and height:

    allows you to set size of the icon.

  • pulse side measure:

    allows you to set pulse side measure. Width or height of PulseView.

  • pulse count:

    allows you to set pulse count.

  • pulse spawn period:

    allows you to set pulse spawn period.

  • pulse alpha:

    allows you to set alpha to pulse.

  • pulse color:

    allows you to set pulse color.

  • interpolator:

    allows you to set an interpolator for the pulse.

  • listener:

    allows you to set pulse listener. onStartPulse() and onFinishPulse() listeners.

Tips

The icon to pulse can be a normal bitmap or a SVG file.

In preview mode PulseView renders incorrectly because the Canvas can`t scale in this mode.

Init

Check out in code init:

final PulseView pulseView = (PulseView) findViewById(R.id.pv);
pulseView.setPulseColor(Color.BLACK);
pulseView.setPulseCount(5);
pulseView.setPulseMeasure(PulseView.PulseMeasure.WIDTH);
pulseView.setIconHeight(200);
pulseView.setIconWidth(200);
pulseView.setIconRes(R.drawable.icon);
pulseView.setPulseAlpha(70);
pulseView.setInterpolator(new LinearInterpolator());
pulseView.setPulseListener(new PulseView.PulseListener(...));

To start or finish pulse you need to call methods:

pulseView.startPulse();
pulseView.finishPulse();

Other methods can be seen within the sample application.

And XML init:

<com.gigamole.library.PulseView
    android:id="@+id/pv"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:pv_icon="@drawable/icon"
    app:pv_alpha="70"
    app:pv_color="#eae761"
    app:pv_count="8"
    app:pv_measure="height"
    app:pv_icon_width="168dp"
    app:pv_icon_height="194dp"
    app:pv_spawn_period="700"
    app:pv_interpolator="@android:anim/linear_interpolator"/>

Getting Help

To report a specific problem or feature request, open a new issue on Github.

License

Apache 2.0 and MIT. See LICENSE file for details.

Inspiration

Author

Made in DevLight Mobile Agency

Created by Basil Miller - @gigamole

Support

If you'd like to support future development and new product features, please make a payments on Gratipay and Beerpay or become a patron on Patreon.

Gratipay Beerpay Patreon

Also, if you use this library in applications that are available on Google Play, please report it to us or author.

Thanks in advance.