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

update library version #265

Open
wants to merge 1 commit into
base: master
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
17 changes: 6 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.5.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}


// Exclude the version that the android plugin depends on.
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
}

allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#AT
#Mon Sep 03 16:48:40 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
40 changes: 14 additions & 26 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

version = "1.1.3"

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'

// compileSdkVersion 24
// buildToolsVersion '24'
compileSdkVersion 27

defaultConfig {
minSdkVersion 14
targetSdkVersion 25
// targetSdkVersion 24
targetSdkVersion 27
versionCode 3
versionName version

vectorDrawables.useSupportLibrary = true
}
compileOptions {
Expand All @@ -28,30 +21,25 @@ android {
lintOptions {
abortOnError false
checkReleaseBuilds false

}
resourcePrefix "gallery_"
}



dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'com.yalantis:ucrop:2.2.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile "com.android.support:exifinterface:25.3.1"
/* compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
compile "com.android.support:exifinterface:25.1.0"*/
provided 'com.squareup.picasso:picasso:2.5.2'
provided 'com.facebook.fresco:fresco:1.3.0'
provided 'com.facebook.fresco:animated-gif:1.3.0'
provided 'com.github.bumptech.glide:glide:3.7.0'
provided 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
api fileTree(include: ['*.jar'], dir: 'libs')
api 'io.reactivex.rxjava2:rxandroid:2.1.0'
api 'io.reactivex.rxjava2:rxjava:2.2.1'
api 'com.android.support:recyclerview-v7:27.1.1'
api 'com.android.support:appcompat-v7:27.1.1'
api 'com.android.support:exifinterface:27.1.1'
api 'com.yalantis:ucrop:2.2.0'
compileOnly 'com.squareup.picasso:picasso:2.71828'
compileOnly 'com.facebook.fresco:fresco:1.10.0'
compileOnly 'com.facebook.fresco:animated-gif:1.10.0'
compileOnly 'com.github.bumptech.glide:glide:4.7.1'
compileOnly 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
}

//===================================upload jcenter=================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;

import cn.finalteam.rxgalleryfinal.imageloader.rotate.RotateTransformation;
import cn.finalteam.rxgalleryfinal.ui.widget.FixImageView;
Expand All @@ -15,49 +16,31 @@
*/
public class GlideImageLoader implements AbsImageLoader {


@Override
public void displayImage(Context context, String path, FixImageView imageView, Drawable defaultDrawable, Bitmap.Config config, boolean resize, boolean isGif, int width, int height, int rotate) {
// DrawableRequestBuilder builder;
// if (path != null) {
// builder = Glide.with(context)
// .load(new File(path)).
// .placeholder(defaultDrawable);
//
// } else {
// builder = Glide.with(context)
// .load(new File("/sdcard"))
// .placeholder(defaultDrawable);
// }
// if (resize) {
// builder = builder.override(width, height);
// }
// builder
// .crossFade()
// .transform(new RotateTransformation(context, rotate))
// .diskCacheStrategy(DiskCacheStrategy.NONE)
// .into(imageView);

if (isGif) {
Glide
.with(context)
.load(path)
.placeholder(defaultDrawable)
.error(defaultDrawable)
.override(width, height)
.crossFade()
.transform(new RotateTransformation(context, rotate))
.diskCacheStrategy(DiskCacheStrategy.NONE)
.apply(new RequestOptions()
.placeholder(defaultDrawable)
.error(defaultDrawable)
.override(width, height)
.transform(new RotateTransformation(rotate))
.diskCacheStrategy(DiskCacheStrategy.NONE))
.into(imageView);
} else {
Glide
.with(context)
.load(path)
.asBitmap()
.placeholder(defaultDrawable)
.error(defaultDrawable)
.override(width, height)
.transform(new RotateTransformation(context, rotate))
.diskCacheStrategy(DiskCacheStrategy.NONE)
.load(path)
.apply(new RequestOptions()
.placeholder(defaultDrawable)
.error(defaultDrawable)
.override(width, height)
.transform(new RotateTransformation(rotate))
.diskCacheStrategy(DiskCacheStrategy.NONE))
.into(imageView);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class PicassoImageLoader implements AbsImageLoader {

@Override
public void displayImage(Context context, String path, FixImageView imageView, Drawable defaultDrawable, Bitmap.Config config, boolean resize, boolean isGif, int width, int height, int rotate) {
RequestCreator creator = Picasso.with(context)
RequestCreator creator = Picasso.get()
.load(new File(path))
.placeholder(defaultDrawable)
.error(defaultDrawable)
Expand All @@ -32,8 +32,7 @@ public void displayImage(Context context, String path, FixImageView imageView, D
.config(config)
.tag(context);
if (resize) {
creator = creator.resize(width, height)
.centerCrop();
creator = creator.resize(width, height).centerCrop();
}
creator.into(imageView);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
package cn.finalteam.rxgalleryfinal.imageloader.rotate;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.support.annotation.NonNull;

import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;

import java.security.MessageDigest;

/**
* Created by pengjianbo Dujinyang on 2016/8/16 0016.
*/
public class RotateTransformation extends BitmapTransformation {

private float rotateRotationAngle = 0f;

public RotateTransformation(Context context, float rotateRotationAngle) {
super(context);
private float rotateRotationAngle;

public RotateTransformation(float rotateRotationAngle) {
this.rotateRotationAngle = rotateRotationAngle;
}

@Override
protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) {
protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
Matrix matrix = new Matrix();
matrix.postRotate(rotateRotationAngle);
return Bitmap.createBitmap(toTransform, 0, 0, toTransform.getWidth(), toTransform.getHeight(), matrix, true);
}

@Override
public String getId() {
return "rotate" + rotateRotationAngle;
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
}
}
36 changes: 16 additions & 20 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'com.getkeepsafe.dexcount'

android {
compileSdkVersion 24
buildToolsVersion '25.0.3'
// buildToolsVersion '24'

compileSdkVersion 27
defaultConfig {
applicationId "cn.finalteam.rxgalleryfinal.sample"
minSdkVersion 14
targetSdkVersion 25
// targetSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
Expand All @@ -19,28 +14,29 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.fresco:fresco:1.3.0'
compile 'com.facebook.fresco:animated-gif:1.3.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
compile project(':library')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.facebook.fresco:fresco:1.10.0'
implementation 'com.facebook.fresco:animated-gif:1.10.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
androidTestImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
implementation project(':library')
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatCheckBox;
import android.view.View;
import android.widget.Toast;

import cn.finalteam.rxgalleryfinal.RxGalleryFinal;
Expand All @@ -27,31 +26,11 @@ public class ImageLoaderActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_imageloader);
appCompatCheckBox = (AppCompatCheckBox) findViewById(R.id.cb_gif);
findViewById(R.id.btn_glide).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
start(ImageLoaderType.GLIDE);
}
});
findViewById(R.id.btn_picasso).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
start(ImageLoaderType.PICASSO);
}
});
findViewById(R.id.btn_fresco).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
start(ImageLoaderType.FRESCO);
}
});
findViewById(R.id.btn_universal).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
start(ImageLoaderType.UNIVERSAL);
}
});
appCompatCheckBox = findViewById(R.id.cb_gif);
findViewById(R.id.btn_glide).setOnClickListener(v -> start(ImageLoaderType.GLIDE));
findViewById(R.id.btn_picasso).setOnClickListener(v -> start(ImageLoaderType.PICASSO));
findViewById(R.id.btn_fresco).setOnClickListener(v -> start(ImageLoaderType.FRESCO));
findViewById(R.id.btn_universal).setOnClickListener(v -> start(ImageLoaderType.UNIVERSAL));
}

private void start(ImageLoaderType imageLoaderType) {
Expand All @@ -69,7 +48,7 @@ private void start(ImageLoaderType imageLoaderType) {
.imageLoader(imageLoaderType)
.subscribe(new RxBusResultDisposable<ImageRadioResultEvent>() {
@Override
protected void onEvent(ImageRadioResultEvent imageRadioResultEvent) throws Exception {
protected void onEvent(ImageRadioResultEvent imageRadioResultEvent) {
Toast.makeText(getBaseContext(), "选中了图片路径:" + imageRadioResultEvent.getResult().getOriginalPath(), Toast.LENGTH_SHORT).show();
}
}).openGallery();
Expand Down

This file was deleted.