Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.

Overview

StrikedImageView

Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.

StrikedImageView

Platform API

Gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.DamonBaker:StrikedImageView:1.0.0'
}

Usage

Set base drawable like you would a regular ImageView. It is recommended that you also set the android:tint attribute so the view knows what color to tint the strike.

<xyz.damonbaker.strikedimageview.StrikedImageView
    android:id="@+id/striked_image"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:tint="#FFC107"
    app:srcCompat="@drawable/ic_camera_black_24dp"
    app:striked="false" />
val strikedImage: StrikedImageView = findViewById(R.id.striked_image)
strikedImage.setImageDrawable(drawable)

Set isStriked to apply the animation.

strikedImage.isStriked = true

Limitations

  • StrikedImageView works best with vector drawables, if you are not using a vector drawable as the image source then the strikeColor attribute must be set if you want the strike color to match the color of the drawable.
  • A tint should be set on the StrikedImageView so the view knows what color to tint the strike, otherwise you can set strikeColor manually.
  • In order to simulate the clip-through effect of the strike, the view hierarchy is traversed until the first parent with a ColorDrawable is found. This color will be used as the strikeBackgroundColor.
    • If the parent's background is not an instance of ColorDrawable (i.e. a drawable instead of a color), then the strikeBackgroundColor attribute must be manually set.
You might also like...
Image-search - An Image search android app with offline support
Image-search - An Image search android app with offline support

image-search Image search app built using bing image search API via paging 3. Fe

Material image loading implementation
Material image loading implementation

MaterialImageLoading Material image loading implementation Sample And have a look on a sample Youtube Video : Youtube Link [] (https://www.youtube.com

An easy, flexible way to add a shimmering effect to any view in an Android app.
An easy, flexible way to add a shimmering effect to any view in an Android app.

Shimmer for Android Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as a

🎨 Android colorpicker for getting colors from any images by tapping on the desired color.
🎨 Android colorpicker for getting colors from any images by tapping on the desired color.

ColorPickerView 🎨 ColorPickerView implements getting HSV colors, ARGB values, Hex color codes from any image drawables or your gallery pictures by ta

Customizable bounce animation for any view like in Clash Royale app
Customizable bounce animation for any view like in Clash Royale app

Bounceview-Android Customizable bounce animation for any view updation Getting Started In your build.gradle dependencies { implementation 'hari.bo

FastHub - Yet another open-source GitHub client app but unlike any other app
FastHub - Yet another open-source GitHub client app but unlike any other app

FastHub - Yet another open-source GitHub client app but unlike any other app

An amazing and convenient Android image slider.

Android Image Slider ![Gitter](https://badges.gitter.im/Join Chat.svg) This is an amazing image slider for the Android platform. I decided to open sou

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.

PhotoEditor A Photo Editor library with simple, easy support for image editing using Paints, Text, Filters, Emoji and Sticker like stories. Features D

Road Runner is a library for android which allow you to make your own loading animation using a SVG image
Road Runner is a library for android which allow you to make your own loading animation using a SVG image

Road Runner Road Runner is a library for android which allow you to make your own loading animation using a SVG image Sample video View in Youtube Dem

Releases(1.0.0)
Owner
null
AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

PhotoFiltersSDK PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image medi

Zomato 2.5k Dec 23, 2022
A sample implementation Compose BottomSheet with animation different states

Compose Animated BottomSheet A sample implementation Compose BottomSheet with animation different states Medium post: https://proandroiddev.com/how-to

Yahor 40 Jan 6, 2023
💪 Rich Android Path. 🤡 Draw as you want. 🎉 Animate much as you can.

?? Rich Android Path. ?? Draw as you want. ?? Animate much as you can. Download sample app: Features Full Animation Control on Paths and VectorDrawabl

Ahmed Tarek 2.3k Dec 20, 2022
Android library to animate Floating Action Button to Bottom Sheet Dialog and vice-versa

FabulousFilter Show some ❤️ and star the repo to support the project This library is the implementation of filter-concept posted on MaterialUp.com. It

Krupen Ghetiya 2.6k Jan 3, 2023
Simple way to animate your views on Android with Rx 🚀

This is an Android library to make a simple way to animate your views on Android with Rx.

Lopez Mikhael 583 Dec 9, 2022
POC of how you can animate LazyColumn insertions/deletions/moving

Animated LazyColumn/LazyRow POC of how you can animate LazyColumn/LazyRow insertions/deletions/moving Note, this is not production ready or a library,

Roudi Korkis Kanaan 33 Dec 24, 2022
Animated-splash-screen - Animate your Splash Screen using Lottie files.

Animated Splash Screen This small project shows how you can add animation into your android projects or create beautiful looking Splash Screen or Laun

Aashish Ace 0 Jan 2, 2022
Backarrow-animation-example - Animate back arrow to close button in Compose using animated drawables

Animate Back Arrow to Close Icon in Compose This is a simple demo for animated v

Jose Mateo 3 Feb 17, 2022
Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs.

ComposeSimpleAnimation Trying to play with Jetpack compose low level animations APIs, which are animate*AsState APIs that I needed in another project.

Mustafa Ibrahim 39 Dec 10, 2022
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures

Stfalcon ImageViewer A simple and customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" g

Stfalcon LLC 1.9k Jan 5, 2023