Photon

Additional

Language
Kotlin
Version
1.0.3 (Apr 30, 2019)
Created
Dec 28, 2018
Updated
Jul 3, 2020 (Retired)
Owner
Mahmoud Ramadan (mrabelwahed)
Contributors
Mahmoud Ramadan (mrabelwahed)
mahmoud-ramadan-abdelwahed
2
Activity
Badge
Generate
Download
Source code

Advertisement

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