diff --git a/ImageLibrary/build.gradle b/ImageLibrary/build.gradle index 99e1c59..1cc61c7 100644 --- a/ImageLibrary/build.gradle +++ b/ImageLibrary/build.gradle @@ -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" @@ -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. diff --git a/ImageLibrary/src/main/java/com/renyu/imagelibrary/crop/CropUActivity.java b/ImageLibrary/src/main/java/com/renyu/imagelibrary/crop/CropUActivity.java index afccf0f..7b9cf0c 100644 --- a/ImageLibrary/src/main/java/com/renyu/imagelibrary/crop/CropUActivity.java +++ b/ImageLibrary/src/main/java/com/renyu/imagelibrary/crop/CropUActivity.java @@ -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; @@ -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; @@ -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 diff --git a/ImageLibrary/src/main/java/com/renyu/imagelibrary/photopicker/PhotoPickerActivity.java b/ImageLibrary/src/main/java/com/renyu/imagelibrary/photopicker/PhotoPickerActivity.java index c7ed316..8d937e9 100644 --- a/ImageLibrary/src/main/java/com/renyu/imagelibrary/photopicker/PhotoPickerActivity.java +++ b/ImageLibrary/src/main/java/com/renyu/imagelibrary/photopicker/PhotoPickerActivity.java @@ -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; @@ -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; @@ -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; @@ -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<>(); diff --git a/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/ImagePreviewFragment.java b/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/ImagePreviewFragment.java index 24ad372..ede6750 100644 --- a/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/ImagePreviewFragment.java +++ b/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/ImagePreviewFragment.java @@ -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; @@ -29,7 +27,6 @@ public class ImagePreviewFragment extends BaseFragment { - @BindView(R2.id.photo_view) PhotoDraweeView photoDraweeView; OnPicChangedListener onPicChangedListener; @@ -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)) diff --git a/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/SubsamplingActivity.java b/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/SubsamplingActivity.java index 33adcb2..45774fd 100644 --- a/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/SubsamplingActivity.java +++ b/ImageLibrary/src/main/java/com/renyu/imagelibrary/preview/SubsamplingActivity.java @@ -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; @@ -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, "", "正在加载文件"); } diff --git a/app/build.gradle b/app/build.gradle index 8cd19b4..13c9697 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" diff --git a/app/src/main/java/com/renyu/androidimagelibrary/MainActivity.java b/app/src/main/java/com/renyu/androidimagelibrary/MainActivity.java index fda1827..e73c4b3 100644 --- a/app/src/main/java/com/renyu/androidimagelibrary/MainActivity.java +++ b/app/src/main/java/com/renyu/androidimagelibrary/MainActivity.java @@ -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; @@ -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 strings=new ArrayList<>(); diff --git a/build.gradle b/build.gradle index 84648d5..4e8240b 100644 --- a/build.gradle +++ b/build.gradle @@ -2,15 +2,15 @@ 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' } @@ -18,6 +18,7 @@ buildscript { allprojects { repositories { + google() jcenter() maven { url 'https://jitpack.io' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a54176d..314e480 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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