Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RomainPiel/Shimmer-android
(DEPRECATED) An Android TextView with a shimmering effect
https://github.com/RomainPiel/Shimmer-android
Last synced: 2 months ago
JSON representation
(DEPRECATED) An Android TextView with a shimmering effect
- Host: GitHub
- URL: https://github.com/RomainPiel/Shimmer-android
- Owner: romainpiel
- Archived: true
- Created: 2014-03-06T16:54:23.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-10-10T13:28:38.000Z (about 8 years ago)
- Last Synced: 2024-10-13T02:38:17.419Z (3 months ago)
- Language: Java
- Homepage:
- Size: 304 KB
- Stars: 1,993
- Watchers: 90
- Forks: 437
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- -awesome-android-ui - Shimmer-android - 2.0) | ![](/art/Shimmer-android.gif) (Index `(light-weight pages)`)
- awesome-android-ui - Shimmer-android - 2.0) | ![](/art/Shimmer-android.gif) (Index `(light-weight pages)`)
- awesome-android-ui - Shimmer-android - 2.0) | ![](/art/Shimmer-android.gif) (Index)
- awesome-android-ui - https://github.com/RomainPiel/Shimmer-android
- awesome-android-ui - https://github.com/RomainPiel/Shimmer-android
README
# Shimmer for Android
This library is DEPRECATED, as I don't have time to mainatin it anymore. But feel free to go through the code and copy that into your project, it still does its job.
Shimmer-android is an Android port of [Facebook Shimmer library for iOS](https://github.com/facebook/Shimmer).
[![ScreenShot](shimmer.gif)](http://youtu.be/7EOsegp4J2o)
[http://youtu.be/7EOsegp4J2o](http://youtu.be/7EOsegp4J2o)
Examples of usage:
- show a loading indicator
- show a highlighted `TextView`.## How to use
Gradle dependency:
```groovy
compile 'com.romainpiel.shimmer:library:1.4.0@aar'
```Add a `ShimmerTextView` to your layout:
```xml```
To start the animation:
```java
shimmer = new Shimmer();
shimmer.start(myShimmerTextView);
```You may want to keep track of the shimmer instance after the animation is started if you want to stop it.
To stop it:
```java
shimmer.cancel();
```## Customization
### Customizing the view
You can change the color of the reflection using the custom attribute `reflectionColor`:
```xml
```
### Customizing the animation
The animation can be tweaked like a usual `ObjectAnimator`:
```java
// DON'T COPY THIS CODE TO YOUR PROJECT! It is just an example
shimmer.setRepeatCount(0)
.setDuration(500)
.setStartDelay(300)
.setDirection(Shimmer.ANIMATION_DIRECTION_RTL)
.setAnimatorListener(new Animator.AnimatorListener(){});
```### Custom Shimmer view
Shimmer also includes a [`ShimmerButton`](https://github.com/RomainPiel/Shimmer-android/blob/master/library/src/main/java/com/romainpiel/shimmer/ShimmerButton.java). It works exactly the same way as a `ShimmerTextView`.
Have a look at how it's implemented and you can apply the same effect on your custom view if you need it.## Sample
See the [sample](https://github.com/RomainPiel/Shimmer-android/tree/master/sample) for a common use of this library.
## License
```
Copyright 2014 Romain PielLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```