Skip to content

Commit

Permalink
Merge branch 'release/0.8.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
seokwon.jeong committed Feb 5, 2018
2 parents d7c9912 + c96b55e commit b439355
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion FishBun/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
compile "com.android.support:recyclerview-v7:$rootProject.support_version"

testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.2.27'
testImplementation 'org.mockito:mockito-core:2.8.9'

compileOnly "com.squareup.picasso:picasso:$rootProject.picasso_version"
compileOnly "com.github.bumptech.glide:glide:$rootProject.glide_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@

public interface ImageAdapter {
void loadImage(Context context, ImageView target, Uri loadUrl);
void loadDetailImage(Context context, ImageView target, Uri loadUrl);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

public class GlideAdapter implements ImageAdapter {
@Override
public void loadImage(Context context, ImageView target, Uri loadUrl) {
public void loadImage(Context context,
ImageView target,
Uri loadUrl) {
RequestOptions options = new RequestOptions();
options.centerCrop();
Glide
Expand All @@ -23,4 +25,15 @@ public void loadImage(Context context, ImageView target, Uri loadUrl) {
.apply(options)
.into(target);
}

@Override
public void loadDetailImage(Context context, ImageView target, Uri loadUrl) {
RequestOptions options = new RequestOptions();
options.centerInside();
Glide
.with(context)
.load(loadUrl)
.apply(options)
.into(target);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ public void loadImage(Context context, ImageView target, Uri loadUrl) {
.centerCrop()
.into(target);
}

@Override
public void loadDetailImage(Context context, ImageView target, Uri loadUrl) {
Picasso
.with(context)
.load(loadUrl)
.fit()
.centerInside()
.into(target);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@
import android.view.View;
import android.view.ViewGroup;

import com.sangcomz.fishbun.Fishton;
import com.sangcomz.fishbun.R;
import com.sangcomz.fishbun.util.TouchImageView;
import com.squareup.picasso.Picasso;

/**
* Created by sangcomz on 15/06/2017.
*/

public class DetailViewPagerAdapter extends PagerAdapter {

private Fishton fishton;
private LayoutInflater inflater;
private Uri[] images;

public DetailViewPagerAdapter(LayoutInflater inflater, Uri[] images) {
this.inflater = inflater;
this.images = images;
fishton = Fishton.getInstance();
}


Expand All @@ -34,11 +37,12 @@ public Object instantiateItem(ViewGroup container, int position) {

TouchImageView imageView = itemView.findViewById(R.id.img_detail_image);

Picasso.with(itemView.getContext())
.load(images[position])
.fit()
.centerInside()
.into(imageView);
fishton
.imageAdapter
.loadDetailImage(itemView.getContext(),
imageView,
images[position]);

return itemView;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
case 0: {
FishBun.with(WithActivityActivity.this)
.setImageAdapter(new GlideAdapter())
.setIsUseDetailView(false)
.startAlbum();
break;
}
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ _FishBun_ is a highly customizable image picker for Android.
<img src="/pic/fishbuns.png">


## What's New in _FishBun_ 0.8.4?
## What's New in _FishBun_ 0.8.6?

- Fix TransactionTooLargeException ([#107](https://github.com/sangcomz/FishBun/issues/107))
- Add Image Adapter (Picasso, Glide) (Remove MultiPageMode())[Check How to Use](#how-to-use)
- Crash without Picasso ([#113](https://github.com/sangcomz/FishBun/issues/113))



Expand Down Expand Up @@ -112,13 +111,15 @@ Setting up _FishBun_ requires to add this Gradle configuration:

dependencies {
// Under the Android Plugin 3.0.0.
compile 'com.sangcomz:FishBun:0.8.4'
compile 'com.sangcomz:FishBun:0.8.6'
compile 'com.squareup.picasso:picasso:2.5.2'
or
compile 'com.github.bumptech.glide:glide:4.5.0'
// Android plugin 3.0.0 or higher.
implementation 'com.sangcomz:FishBun:0.8.4'
implementation 'com.sangcomz:FishBun:0.8.6'
implementation 'com.squareup.picasso:picasso:2.5.2'
or
implementation 'com.github.bumptech.glide:glide:4.5.0'
Expand Down
3 changes: 1 addition & 2 deletions gradle/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ if (project.rootProject.file('local.properties').isFile()) {
tagName = version
targetCommitish = 'master'
body = """## Release Note
* Fix TransactionTooLargeException (#107)
* Add Image Adapter (Picasso, Glide)"""
* Fix Deitail ImageView (#113)"""
name = version
}
}
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include ':FishBunDemo', ':FishBun'

gradle.ext.versionCode = 19
gradle.ext.versionName = '0.8.4'
gradle.ext.versionCode = 20
gradle.ext.versionName = '0.8.6'

gradle.ext.set('minSdk', 15)
gradle.ext.set('targetSdk', 27)
Expand Down

0 comments on commit b439355

Please sign in to comment.