An open API service indexing awesome lists of open source software.

https://github.com/mindinventory/shimmertextview

ShimmerTextView is a simple library to integrate shimmer effect in your TextView.
https://github.com/mindinventory/shimmertextview

android android-application androidlibrary animation animation-library shimmer shimmer-android shimmer-animation shimmer-effect shimmer-layout shimmer-loading shimmer-text-view textview-android

Last synced: 6 months ago
JSON representation

ShimmerTextView is a simple library to integrate shimmer effect in your TextView.

Awesome Lists containing this project

README

        

ShimmerTextView [![](https://jitpack.io/v/Mindinventory/ShimmerTextView.svg)](https://jitpack.io/#Mindinventory/ShimmerTextView) ![](https://img.shields.io/github/languages/top/Mindinventory/ShimmerTextView) ![](https://img.shields.io/github/license/mindinventory/ShimmerTextView)
====

ShimmerTextView is a simple library to integrate shimmer effect in your TextView.

![image](art/ShimmerTextView.gif)
![image](art/ShimmerTextViewOffer.gif)

# Key features

* Set a base color in ShimmerTextView.
* Set a highlight color in ShimmerTextView.
* Set animation duration for shimmer effect(in millisecond).
* Set animation direction(left_to_right, top_to_bottom, right_to_left, bottom_to_top).
* Set ShimmerTextView shape(Linear/Radial)

# Usage
**Dependencies**
- **Step 1: Add the JitPack repository in your project build.gradle file**
```bash
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

**or**

If Android studio version is Arctic Fox or upper then add it in your settings.gradle:
```bash
dependencyResolutionManagement {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

- **Step 2: Add the dependency in your app module build.gradle file**
```bash
dependencies {
...
implementation 'com.github.Mindinventory:ShimmerTextView:x.x.x'
}
```

**Implementation**

* Step 1 : Use custom ShimmerTextView in XML.

* Step 2 : Use all attributes dynamically in your.

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

val textView = findViewById(R.id.textView)
textView.setBaseColor(ContextCompat.getColor(this, R.color.dark_red))
.setHighLightColor(ContextCompat.getColor(this, R.color.orange))
.setDirection(Shimmer.Direction.LEFT_TO_RIGHT)
.build()
textView.startShimmer()
}
}

**XML Properties**

| Properties | Description |
|-------------------------|------------------------------------------------------------------------------------|
| shimmer_base_color | Set base color of ShimmerTextView |
| Shimmer_highlight_color | Set highlight color of shimmer animation |
| shimmer_colored | Set it to true for colored ShimmerTextView |
| shimmer_duration | Set duration for animation |
| shimmer_direction | Set animation direction(left_to_right,top_to_bottom, right_to_left, bottom_to_top) |

That's it 👍 and you're good to go 🚀

### Guideline to report an issue/feature request
---------
It would be very helpful for us, if the reporter can share the below things to understand the root cause of the issue.

* Library version.
* Code snippet.
* Logs if applicable.
* Screenshot/video with steps to reproduce the issue.

### LICENCE
----------------
ShimmerTextView is [MIT-licensed.](https://git.mindinventory.com/mi-android/android-libs/shimmertextview/-/blob/master/LICENSE)

### Let us know!
---------
If you use open-source libraries in your project, please make sure to credit us and Give a star to [www.mindinventory.com](https://www.mindinventory.com/)

Please feel free to use this component and let us know if you are interested to building Apps or Designing Products.