Git Product home page Git Product logo

photon's Introduction

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

photon's People

Contributors

mahmoud-ramadan-abdelwahed avatar mrabelwahed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

photon's Issues

Photon is not usable after calling clearcache()

java.lang.IllegalStateException: cache is closed
at com.jakewharton.disklrucache.DiskLruCache.checkNotClosed(DiskLruCache.java:614)
at com.jakewharton.disklrucache.DiskLruCache.get(DiskLruCache.java:405)
at com.imageloadinglib.cache.DiskCache.get(DiskCache.kt:19)
at com.imageloadinglib.cache.CacheRepository.get(CacheRepository.kt:16)
at com.imageloadinglib.core.Photon.displayImage(Photon.kt:20)
at com.vinyassistant.app.activity.HomeActivity$startAdTask$$inlined$fixedRateTimer$1$lambda$1.run(HomeActivity.kt:305)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.