Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add picasso adapter #263

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FishBun/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ dependencies {

compileOnly "io.coil-kt:coil:$rootProject.coil_version"
compileOnly "com.github.bumptech.glide:glide:$rootProject.glide_version"
compileOnly "com.squareup.picasso:picasso:$rootProject.picasso_version"
}

tasks.withType(Javadoc).all {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class FishBunCreator(private val fishBun: FishBun, private val fishton: Fishton)
fishton.isStatusBarLight = isStatusBarLight
}

@Deprecated("instead setCamera(count)", ReplaceWith("hasCameraInPickerPage(mimeType)"))
@Deprecated("instead hasCameraInPickerPage(hasCamera)", ReplaceWith("hasCameraInPickerPage(hasCamera)"))
override fun setCamera(isCamera: Boolean): FishBunCreator = this.apply {
fishton.hasCameraInPickerPage = isCamera
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.sangcomz.fishbun.adapter.image.impl

import android.net.Uri
import android.widget.ImageView
import com.sangcomz.fishbun.adapter.image.ImageAdapter
import com.squareup.picasso.Picasso

class PicassoAdapter: ImageAdapter {
override fun loadImage(target: ImageView, loadUrl: Uri) {
Picasso.get()
.load(loadUrl)
.fit()
.centerCrop()
.into(target)
}
override fun loadDetailImage(target: ImageView, loadUrl: Uri) {
Picasso.get()
.load(loadUrl)
.into(target)
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ Setting up _FishBun_ requires to add this Gradle configuration:
implementation 'io.coil-kt:coil:0.11.0'
or
implementation 'com.github.bumptech.glide:glide:4.11.0'
or
implementation 'com.squareup.picasso:picasso:2.8'

}

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
material_version = '1.4.0'
coil_version = '0.11.0'
glide_version = '4.11.0'
picasso_version = '2.8'
constraint_version = '2.1.2'
}
repositories {
Expand Down