Blinking-image-view - A variant of Android View that blinks only the source image (not the background)

Overview

Blinker View for Android

License: GPL v3 Build Status Latest Version

What is this?

Blinker View is an Android View that blinks a given drawable. Yes, it's that simple. Place it in your layout and you can now blink the drawable it holds.

One important thing to note here is that - contrary to many approaches you can find on the web - it only blinks the given "source" drawable. The whole View is always at 100% alpha (i.e. always fully visible), including the View's background drawable. To blink the whole View, you don't need the custom-view approach, you can create an Alpha animation and go with that.

Examples

To use the BlinkerView in an XML layout, you would add something like this:

    <me.angrybyte.blinkerview.BlinkerView
        android:id="@+id/blinkerView"
        android:layout_width="@dimen/tap_dimension"
        android:layout_height="@dimen/tap_dimension"
        android:background="@android:color/darker_gray"
        android:padding="@dimen/icon_padding"
        app:blink_drawable="@drawable/ic_red_circle"
        app:blink_scale_type="constrain" />

All attributes that are currently available are:

  1. blink_drawable - Drawable reference, the one that will be blinking (default is null)
  2. blink_interval - Time value in milliseconds, telling the View how long to animate between visible and invisible states (default is 500)
  3. blink_autostart - Whether to automatically start the blinking when View is first inflated (default is false)
  4. blink_use_fading - Whether to display a fading animation while blinking (default is true)
  5. blink_scale_type - How to scale the drawable inside the Blinker View (default is stretch). Options are:
    • stretch - This should be self-explanatory, stretches the drawable to the view's bounds
    • constrain - Snaps the drawable's size to the view's smaller dimension (width or height), keeping the original drawable's aspect ratio
    • center - Centers the drawable inside the view, keeping original drawable size

Note that most of these attributes are also available on the view class via getters/setters.
If you want other attributes available on the view class too, please submit a request through the issues tab.

Setup

Both jCenter and mavenCentral are supported for this dependency.
To include the BlinkerView in your app, add the following line to your app's build.gradle dependecies block.

    // look for the latest version on top of this file and replace the placeholder with it
    implementation "me.angrybyte.blinkerview:blinkerview:LATEST_VERSION" 

If you're using the View in a library module and would like the dependency to go through to your main project as well, then you should use api instead of implementation in the dependency declaration.
For older Gradle versions, these keywords are not supported, so you should use the compile keyword.

Contributions

All interested parties need to create a new Feature request so that everyone involved in active development can discuss the feature or the workaround described. Any pull request not referencing a Feature request will be automatically denied.
Furthermore, we are trying to test everything that's not trivial and keep the code as clean as humanly possible; thus, any pull requests that fail the CI code quality check or fail to properly pass the tests will also be automatically denied. If pull requests pass every check (and don't worry, it's really not impossible to pass those), one of the maintainers could then merge the changes to the release branch - this triggers a CI build with device/emulator tests; and, if all goes ok, the library is automatically deployed to jCenter and MavenCentral.

Further support

In case of emergency errors, please create an issue. Want to add something? Sure, just fork this project and submit a pull request through GitHub. Keep in mind that you need a Feature request first with a finalized discussion (see the Contributions section). Some more help could potentially be found here:

You might also like...
Open source Crypto Currency Tracker Android App made fully in Kotlin
Open source Crypto Currency Tracker Android App made fully in Kotlin

CoinBit CoinBit is a beautiful CryptoCurrency app, completely open sourced and 100% in kotlin. It supports following features Track prices of over 300

Unofficial Android client for dev.to. Open source and free

Dev.to Android by Android Broadcast Unofficial Android client for dev.to Technologies Kotlin Gradle Kotlin DSL Kotlin Coroutines OkHttp + Retrofit kot

This repository contains the source code for the PokeApi Android app.

PokeApi App This repository contains the source code for the PokeApi Android app.

An android open-source quick search/diff/download plugin.
An android open-source quick search/diff/download plugin.

Android Reference Intellij Plugin This library based on AndroidSourceViewer It's built with the Gradle and rewritten by kotlin, that's why it's a new

An open source GitHub Android client app, faster and concise.
An open source GitHub Android client app, faster and concise.

An open-source GitHub Android client app, faster and concise.

Gestor is an innovative open-source application for universal Minecraft mod management.

Gestor Gestor is an innovative open-source application for universal Minecraft mod management. About It combines three types of tools into a single ap

Free & Open-Source External Scripting Platform
Free & Open-Source External Scripting Platform

LeagueOfJire Free & Open-Source External Scripting Platform What features does this have? All of the feature's source-code can be found in the userscr

An open-source plugin that accommodates Starships on Minecraft servers.

Minecraft Starship Plugin An open-source plugin that accommodates starships on minecraft servers. 'A shameless rip-off of Star Legacy's plugins.' Mine

OPEX core for Opex exchange, Open Source Cryptocurrency Exchange.
OPEX core for Opex exchange, Open Source Cryptocurrency Exchange.

Opex Core OPEX Core is a Kotlin based cryptocurrency exchange and matching engine from the OPEX project. This extendable and microservice architecture

Comments
  • Setting blink interval programmatically

    Setting blink interval programmatically

    Hi, is there a way to set blink interval programmatically in java code?

    I've found the BlinkerView very useful, but I need to set blink duration dynamically depending on my own conditions.

    Thank you

    opened by AlphaZulu74 1
Releases(v1.0.1)
Owner
Milos Marinkovic
Dealing with Software Systems and Processes
Milos Marinkovic
:bouquet: An easy way to persist and run code block only as many times as necessary on Android.

Only ?? An easy way to persist and run code block only as many times as necessary on Android. Download Gradle Add below codes to your root build.gradl

Jaewoong Eum 479 Dec 25, 2022
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space.

Pdf Viewer For Android A Simple PDF Viewer library which only occupies around 125kb while most of the Pdf viewer occupies upto 16MB space. How to inte

Rajat 362 Dec 29, 2022
:bouquet: An easy way to persist and run code block only as many times as necessary on Android.

Only ?? An easy way to persist and run code block only as many times as necessary on Android. Download Gradle Add below codes to your root build.gradl

Jaewoong Eum 468 Apr 14, 2021
A library for building Java only Zygisk/Riru modules.

A library for building Java only Zygisk/Riru modules.

Kr328 19 Dec 17, 2022
👋 A common toolkit (utils) ⚒️ built to help you further reduce Kotlin boilerplate code and improve development efficiency. Do you think 'kotlin-stdlib' or 'android-ktx' is not sweet enough? You need this! 🍭

Toolkit [ ?? Work in progress ⛏ ?? ??️ ?? ] Snapshot version: repositories { maven("https://s01.oss.sonatype.org/content/repositories/snapshots") }

凛 35 Jul 23, 2022
Don't write a RecyclerView adapter again. Not even a ViewHolder!

LastAdapter Don't write a RecyclerView adapter again. Not even a ViewHolder! Based on Android Data Binding Written in Kotlin No need to write the adap

Miguel Ángel Moreno 781 Dec 19, 2022
A template that utilizes both Scala and Kotlin because why not (And also because I endorse programming hell)

Fabric-Scala-Kotlin-template A template that utilizes both Scala and Kotlin because why not (And also because I endorse programming hell) I don't care

null 1 Dec 25, 2021
base url not included, rxJava, Retrofit

NewsFeed NewsFeed is an android sample application built using kotlin, androidx artifacts, kotlin-extensions in MVP pattern. Libraries Used Dagger 2 D

Sagar Raval 0 Dec 29, 2021
base url not included, rxJava, Retrofit

NewsFeed NewsFeed is an android sample application built using kotlin, androidx artifacts, kotlin-extensions in MVP pattern. Libraries Used Dagger 2 D

Sagar Raval 0 Dec 29, 2021
WaxedNotWaxed - Adds a simple indicator to know if a copper block is waxed or not

Waxed Not Waxed Adds a simple indicator to know if a copper block is waxed or no

Mateusz 2 Nov 11, 2022