Skip to content

Instantly share code, notes, and snippets.

@ismailgungor
Last active April 4, 2019 18:05
Show Gist options
  • Save ismailgungor/7cf7bdcc9ee4966dae65b97306e824e6 to your computer and use it in GitHub Desktop.
Save ismailgungor/7cf7bdcc9ee4966dae65b97306e824e6 to your computer and use it in GitHub Desktop.
/**
* Responsible to manage image process
* @author ismailgungor
* @since 1.0
*/
interface IImageProcess {
/**
* This method loads image to target with by using url
*
* @param url as String
* @param targetView as ImageView
* @author ismailgungor
* @since 1.0
*/
fun loadUrl(url: String, targetView: ImageView)
/**
* This method loads image to target with by using uri
*
* @param uri as Uri
* @param targetView as ImageView
* @author ismailgungor
* @since 1.0
*/
fun loadUri(uri: Uri, targetView: ImageView)
/**
* This method loads image to target with by using url
*
* @param url as String
* @param targetView as ImageView
* @param placeHolderRes as Int,
* The resource id for an image to be seen on the screen
* until the main picture is loaded
*
* @author ismailgungor
* @since 1.0
*/
fun loadUrlWithPlaceHolder(url: String, targetView: ImageView, placeHolderRes: Int)
/**
* This method loads image with error image to target with by using url
*
* @param url as String
* @param targetView as ImageView
* @param errorImageRes as Int,
* The resource id for an image to be seen on the screen
* if there is an error while loading the main picture
*
* @author ismailgungor
* @since 1.0
*/
fun loadUrlWithError(url: String, targetView: ImageView, errorImageRes: Int)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment