Skip to content

mrabelwahed/photon

Repository files navigation

Photon

is an image loading library for Android. Photon is easy,fast and light library

features

  • Image downloading
  • In Memory Caching
  • Disk Caching

Sample App

How to use Photon

    val imageLoader = Photon.getInstance(this)

    imageLoader.displayImage(URL1,image1 , R.drawable.place_holder)

manage cache

setup maximum cache

val cacheSize =4194304 //4MiB

val imageLoader = Photon.getInstance(this , cacheSize)

clear cache

imageLoader.clearcache()

cancel Loading

- to cancel certain image loading task
imageLoader.cancel(url)

-to cancel all tasks

imageLoader.cancelAll()

how to add Photon to your Android Project

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

  dependencies {
       implementation 'com.github.mrabelwahed:photon:1.0.3'
  }

How to contribute

  • fork the repository
  • create branch and add feature or fix bug
  • create pull request