Skip to content

Commit

Permalink
支持gradle 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
r17171709 committed Oct 29, 2017
1 parent 0829cc0 commit d068be9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 40 deletions.
11 changes: 4 additions & 7 deletions ImageLibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
apply plugin: 'com.android.library'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'android-apt'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.renyu'

android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
compileSdkVersion 26

defaultConfig {
minSdkVersion 19
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"

Expand All @@ -35,13 +32,13 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.github.r17171709:AndroidCommonLibrary:v1.6.7'
compile 'com.github.r17171709:AndroidCommonLibrary:v1.7.0'
// CircleIndicator A lightweight viewpager indicator like in nexus 5 launcher
compile 'me.relex:circleindicator:1.2.2@aar'
// PhotoDraweeView PhotoView For Fresco
compile 'me.relex:photodraweeview:1.1.3'
// butterknife
apt 'com.jakewharton:butterknife-compiler:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// uCrop Image Cropping Library for Android
compile 'com.github.yalantis:ucrop:2.2.1'
// subsampling-scale-image-view Highly configurable, easily extendable view with pan and zoom gestures for displaying huge images without loss of detail. Perfect for photo galleries, maps, building plans etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.renyu.commonlibrary.baseact.BaseActivity;
import com.renyu.imagelibrary.R;
import com.renyu.imagelibrary.R2;
import com.yalantis.ucrop.UCrop;
import com.yalantis.ucrop.UCropActivity;
import com.yalantis.ucrop.callback.BitmapCropCallback;
Expand All @@ -28,21 +27,15 @@

import java.util.ArrayList;

import butterknife.BindView;

/**
* Created by renyu on 2017/3/7.
*/

public class CropUActivity extends BaseActivity {

@BindView(R2.id.nav_layout)
RelativeLayout nav_layout;
@BindView(R2.id.ib_nav_left)
ImageButton ib_nav_left;
@BindView(R2.id.tv_nav_right)
TextView tv_nav_right;
@BindView(R2.id.cv_crop)
UCropView cv_crop;
private GestureCropImageView mGestureCropImageView;
private OverlayView mOverlayView;
Expand All @@ -59,6 +52,11 @@ public int initViews() {

@Override
public void initParams() {
nav_layout = findViewById(R.id.nav_layout);
ib_nav_left = findViewById(R.id.ib_nav_left);
tv_nav_right = findViewById(R.id.tv_nav_right);
cv_crop = findViewById(R.id.cv_crop);

nav_layout.setBackgroundColor(Color.parseColor("#80000000"));
ib_nav_left.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
import com.renyu.commonlibrary.baseact.BaseActivity;
import com.renyu.commonlibrary.commonutils.BarUtils;
import com.renyu.imagelibrary.R;
import com.renyu.imagelibrary.R2;
import com.renyu.imagelibrary.bean.Photo;
import com.renyu.imagelibrary.bean.PhotoDirectory;
import com.renyu.imagelibrary.camera.CameraActivity;
import com.renyu.imagelibrary.commonutils.PhotoDirectoryLoader;
import com.renyu.imagelibrary.commonutils.Utils;
import com.renyu.imagelibrary.bean.Photo;
import com.renyu.imagelibrary.bean.PhotoDirectory;
import com.renyu.imagelibrary.params.CommonParams;
import com.renyu.imagelibrary.preview.ImagePreviewActivity;

Expand All @@ -38,7 +37,6 @@
import java.util.List;
import java.util.Map;

import butterknife.BindView;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
Expand All @@ -56,18 +54,12 @@
*/
public class PhotoPickerActivity extends BaseActivity {

@BindView(R2.id.ib_nav_left)
ImageView ib_nav_left;
@BindView(R2.id.tv_nav_title)
TextView tv_nav_title;
@BindView(R2.id.tv_nav_right)
TextView tv_nav_right;
@BindView(R2.id.photopicker_rv)
RecyclerView photopicker_rv;
PhotoPickerAdapter adapter;
@BindView(R2.id.photopicker_dict)
TextView photopicker_dict;
@BindView(R2.id.photopicker_preview)
TextView photopicker_preview;
ListPopupWindow popupWindow;
DictAdapter dictAdapter;
Expand Down Expand Up @@ -107,6 +99,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

@Override
public void initParams() {
ib_nav_left = findViewById(R.id.ib_nav_left);
tv_nav_title = findViewById(R.id.tv_nav_title);
tv_nav_right = findViewById(R.id.tv_nav_right);
photopicker_rv = findViewById(R.id.photopicker_rv);
photopicker_dict = findViewById(R.id.photopicker_dict);
photopicker_preview = findViewById(R.id.photopicker_preview);

allHashMap=new LinkedHashMap<>();
models=new ArrayList<>();
dictModels=new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
import com.facebook.imagepipeline.request.ImageRequestBuilder;
import com.renyu.commonlibrary.basefrag.BaseFragment;
import com.renyu.imagelibrary.R;
import com.renyu.imagelibrary.R2;

import butterknife.BindView;
import me.relex.photodraweeview.OnPhotoTapListener;
import me.relex.photodraweeview.PhotoDraweeView;

Expand All @@ -29,7 +27,6 @@

public class ImagePreviewFragment extends BaseFragment {

@BindView(R2.id.photo_view)
PhotoDraweeView photoDraweeView;

OnPicChangedListener onPicChangedListener;
Expand All @@ -53,6 +50,8 @@ public static ImagePreviewFragment newInstance(String url, int position) {

@Override
public void initParams() {
photoDraweeView = view.findViewById(R.id.photo_view);

String url=getArguments().getString("url");
PipelineDraweeControllerBuilder controller = Fresco.newDraweeControllerBuilder();
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url.indexOf("http")!=-1?url:"file://"+url))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,15 @@
import com.renyu.commonlibrary.baseact.BaseActivity;
import com.renyu.commonlibrary.network.OKHttpHelper;
import com.renyu.imagelibrary.R;
import com.renyu.imagelibrary.R2;

import java.io.File;

import butterknife.BindView;

/**
* Created by renyu on 2017/8/10.
*/

public class SubsamplingActivity extends BaseActivity {

@BindView(R2.id.iv_sub)
SubsamplingScaleImageView iv_sub;

OKHttpHelper httpHelper;
Expand All @@ -46,6 +42,8 @@ public class SubsamplingActivity extends BaseActivity {

@Override
public void initParams() {
iv_sub = findViewById(R.id.iv_sub);

httpHelper=new OKHttpHelper();
progressDialog=ProgressDialog.show(SubsamplingActivity.this, "", "正在加载文件");
}
Expand Down
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
compileSdkVersion 26
defaultConfig {
applicationId "com.renyu.androidimagelibrary"
minSdkVersion 19
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.renyu.imagelibrary.commonutils.Utils;
import com.renyu.imagelibrary.preview.ImagePreviewActivity;

import java.util.ArrayList;
Expand All @@ -18,7 +16,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

com.blankj.utilcode.util.Utils.init(this);
com.blankj.utilcode.util.Utils.init(getApplication());
Fresco.initialize(this);

ArrayList<String> strings=new ArrayList<>();
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}

allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

0 comments on commit d068be9

Please sign in to comment.