https://github.com/cesarferreira/faker
A kotlin extension to load images asynchronously on android
https://github.com/cesarferreira/faker
android image kotlin loader picasso
Last synced: 4 months ago
JSON representation
A kotlin extension to load images asynchronously on android
- Host: GitHub
- URL: https://github.com/cesarferreira/faker
- Owner: cesarferreira
- License: mit
- Created: 2018-03-08T00:28:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-11T14:04:52.000Z (almost 6 years ago)
- Last Synced: 2025-04-14T18:59:23.244Z (6 months ago)
- Topics: android, image, kotlin, loader, picasso
- Language: Kotlin
- Homepage:
- Size: 2.12 MB
- Stars: 58
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Faker
A kotlin extension to load images asynchronously on android
# Features
- Load random images asynchronously into any `ImageView`
- Load a random image that fits perfectly the size of that `imageView`
- Load any image by passing a simple url into it
- Perfect for image placeholders to jump start a project
# Install
Just add the following dependency in your app's `build.gradle`
```groovy
allprojects { repositories { maven { url 'https://jitpack.io' } }}
```
```groovy
dependencies {
implementation 'com.github.cesarferreira:faker:x.x.x'
}
```
or use [drone](https://github.com/cesarferreira/drone):
> drone add faker app-module
# Examples
Here are some examples to provide you a head start with using this library.
`.loadRandomImage()`
```kotlin
imageView.loadRandomImage()
```
`.loadFromUrl(url: String)`
```kotlin
imageView.loadFromUrl("http://sample.com/image.png")
```
`.loadFromUrl(url: String, placeholder: Int, error: Int)`
```kotlin
imageView.loadFromUrl("http://sample.com/image.png", R.color.placeholder, R.color.error)
```
`.loadFromUrl(url: String, placeholder: Drawable, error: Drawable)`
```kotlin
imageView.loadFromUrl("http://sample.com/image.png", R.drawable.placeholder, R.drawable.error)
```
# License
Licensed under `MIT license`. View [license](LICENSE.md).