-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
semplified the view and sample, added README
- Loading branch information
luca
committed
Dec 16, 2019
1 parent
cec598c
commit 11ecdb5
Showing
8 changed files
with
188 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
LargeImageView | ||
===== | ||
|
||
LargeImageView is a custom view for Android, written in Kotlin, helping you manage a [SubsamplingImageView](https://github.com/davemorrissey/subsampling-scale-image-view). | ||
|
||
With LIV is easy to show a thumbnail while loading the source image in the background, | ||
show an error view in case something goes wrong. | ||
|
||
LIV makes it easy to use the subsampling, zooming and gestures capabilities of SSIV in combination with a transition or shared-element-transition, | ||
allowing you to animate the thumbnail and delay the loading of source image until the animation is complete. | ||
|
||
|
||
### Usage | ||
|
||
To manage the beahviour of LIV you must provide an ImageLoader, like so: | ||
|
||
``` | ||
liv_basic.setImageLoader(object : ImageLoader { | ||
override fun getThumbnailView(context: Context): View { | ||
... | ||
} | ||
override fun loadThumbnail(view: View, url: String) { | ||
... | ||
} | ||
override fun getErrorView(context: Context): View { | ||
... | ||
} | ||
override fun preloadSource(url: String, callback: ImageReadyCallback) { | ||
... | ||
callback.onImageReady(file) | ||
... | ||
callback.onImageErrored() | ||
} | ||
}) | ||
``` | ||
|
||
after doing that, start the process with: | ||
|
||
``` | ||
liv.startLoading() | ||
``` | ||
|
||
It's that simple! | ||
|
||
### License | ||
This project is licensed under the MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.