android-pulse-indicator


Source link: https://github.com/jackpocket/android-pulse-indicator

pulse-indicator

An Android View system for indicating Views using fading pulses

Installation


 repositories {

jcenter()
  
}

dependencies {

compile('com.jackpocket:pulse-indicator:1.0.4')
  
}
 

Usage

Layout Approach

Make the root of your Activity's layout one of the base PulseLayouts included in this library: the PulsingLinearLayout or the PulsingRelativeLayout. e.g.

<com.jackpocket.pulse.layouts.PulsingLinearLayout

...
  >

Then find it in your Activity and simply call PulseLayout.attachTo(Activity, View). Done. e.g.

((PulseLayout) findViewById(R.id.my_pulsing_layout))
  .attachTo(this, findViewById(R.id.some_view_I_want_to_indicate);
PulseView Approach

Just add a PulseView to your layout (make sure you're using a ViewGroup that allows overlapping children (e.g. RelativeLayout)).

<RelativeLayout>
  <com.jackpocket.pulse.layouts.PulseView

android:layout_width="match_parent"

android:layout_height="match_parent"

... /> </RelativeLayout>

You could then use it the same way you would going the Layout Approach mentioned above.

Custom Approach

If you want to add pulsing to your own custom layouts, just checkout one of the supplied layout class files for detailed information on how to implemented the PulsingController manually.

Changing the values at runtime can also be configured by working with the PulseController:

((PulseLayout) findViewById(R.id.my_pulsing_layout))
  .attachTo(this, findViewById(R.id.some_view_I_want_to_indicate)

.setCirclePathOverride(false) // Set it to use the rectangular boundaries instead of circle pulsing

.setPulsingColor(0xFF22FF22) // Set the pulse starting color

.setPulsingStrokeWidth(10) // Override the dynamic stroke width with a custom one

.setDurationMs(1500) // Set the overall duration of the pulsing (will continue until no pulses exist)

.setPulseLifespanMs(900) // The length of time a pulse is visible

.setRespawnRateMs(300) // The rate at which a new pulse should be added

.setAlphaInterpolator(new AccelerateInterpolator()) // Set the Interpolator for the alpha animation

.setScaleInterpolator(new LinearInterpolator()) // Set the Interpolator for the scaling animation

.setFinishedListener(view -> doSomethingOnFinished());
 // Set a callback to be triggered when the pulsing finished for a View. Calling attach() before it completes will prevent it from being triggered

Configs

The default configs for pulsing color, duration, individual lifespan, respawn rates can be overwritten via the following, respectively:

R.color.pulse__color R.integer.pulse__duration_default R.integer.pulse__lifespan_default R.integer.pulse__respawn_rate_default 

Note, all time values are in milliseconds.

Resources

An uncaught exception handler library.

Android library to place labels next to another. If there is not enough space for the next label, it will be added in a new line.

Handler-based Eventbus for Android.

Android DI, DDD, Specification Pattern, Repository Pattern, IoC.

This project aims to provide a working dual toggle button implementation.

Android Marshmallow permissions made easy.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes