diff --git a/app/src/main/java/cn/finalteam/galleryfinal/sample/MainActivity.java b/app/src/main/java/cn/finalteam/galleryfinal/sample/MainActivity.java index ded5013..e989b5a 100644 --- a/app/src/main/java/cn/finalteam/galleryfinal/sample/MainActivity.java +++ b/app/src/main/java/cn/finalteam/galleryfinal/sample/MainActivity.java @@ -381,9 +381,9 @@ public void onOtherButtonClick(ActionSheet actionSheet, int index) { x.Ext.init(getApplication()); } - private GalleryFinal.OnHanlderResultCallback mOnHanlderResultCallback = new GalleryFinal.OnHanlderResultCallback() { + private GalleryFinal.OnHandlerResultCallback mOnHanlderResultCallback = new GalleryFinal.OnHandlerResultCallback() { @Override - public void onHanlderSuccess(int reqeustCode, List resultList) { + public void onHandlerSuccess(int requestCode, List resultList) { if (resultList != null) { mPhotoList.addAll(resultList); mChoosePhotoListAdapter.notifyDataSetChanged(); @@ -391,7 +391,7 @@ public void onHanlderSuccess(int reqeustCode, List resultList) { } @Override - public void onHanlderFailure(int requestCode, String errorMsg) { + public void onHandlerFailure(int requestCode, String errorMsg) { Toast.makeText(MainActivity.this, errorMsg, Toast.LENGTH_SHORT).show(); } }; diff --git a/build.gradle b/build.gradle index 8f8d66c..17b122b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.android.tools.build:gradle:2.0.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.3.1' diff --git a/galleryfinal/src/main/java/cn/finalteam/galleryfinal/GalleryFinal.java b/galleryfinal/src/main/java/cn/finalteam/galleryfinal/GalleryFinal.java index 38b29b8..f0dafe1 100644 --- a/galleryfinal/src/main/java/cn/finalteam/galleryfinal/GalleryFinal.java +++ b/galleryfinal/src/main/java/cn/finalteam/galleryfinal/GalleryFinal.java @@ -46,7 +46,7 @@ public class GalleryFinal { private static ThemeConfig mThemeConfig; private static CoreConfig mCoreConfig; - private static OnHanlderResultCallback mCallback; + private static OnHandlerResultCallback mCallback; private static int mRequestCode; public static void init(CoreConfig coreConfig) { @@ -55,7 +55,7 @@ public static void init(CoreConfig coreConfig) { mGlobalFunctionConfig = coreConfig.getFunctionConfig(); } - public static FunctionConfig copyGlobalFuncationConfig() { + public static FunctionConfig copyGlobalFunctionConfig() { if ( mGlobalFunctionConfig != null ) { return mGlobalFunctionConfig.clone(); } @@ -83,13 +83,13 @@ public static ThemeConfig getGalleryTheme() { * @param requestCode * @param callback */ - public static void openGallerySingle(int requestCode, OnHanlderResultCallback callback) { - FunctionConfig config = copyGlobalFuncationConfig(); + public static void openGallerySingle(int requestCode, OnHandlerResultCallback callback) { + FunctionConfig config = copyGlobalFunctionConfig(); if (config != null) { openGallerySingle(requestCode, config, callback); } else { if(callback != null) { - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } ILogger.e("FunctionConfig null"); } @@ -101,18 +101,18 @@ public static void openGallerySingle(int requestCode, OnHanlderResultCallback ca * @param config * @param callback */ - public static void openGallerySingle(int requestCode, FunctionConfig config, OnHanlderResultCallback callback) { + public static void openGallerySingle(int requestCode, FunctionConfig config, OnHandlerResultCallback callback) { if ( mCoreConfig.getImageLoader() == null ) { ILogger.e("Please init GalleryFinal."); if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } if ( config == null && mGlobalFunctionConfig == null) { if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } @@ -137,14 +137,14 @@ public static void openGallerySingle(int requestCode, FunctionConfig config, OnH * @param maxSize * @param callback */ - public static void openGalleryMuti(int requestCode, int maxSize, OnHanlderResultCallback callback) { - FunctionConfig config = copyGlobalFuncationConfig(); + public static void openGalleryMuti(int requestCode, int maxSize, OnHandlerResultCallback callback) { + FunctionConfig config = copyGlobalFunctionConfig(); if (config != null) { config.maxSize = maxSize; openGalleryMuti(requestCode, config, callback); } else { if(callback != null) { - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } ILogger.e("Please init GalleryFinal."); } @@ -156,32 +156,32 @@ public static void openGalleryMuti(int requestCode, int maxSize, OnHanlderResult * @param config * @param callback */ - public static void openGalleryMuti(int requestCode, FunctionConfig config, OnHanlderResultCallback callback) { - if ( mCoreConfig.getImageLoader() == null ) { + public static void openGalleryMuti(int requestCode, FunctionConfig config, OnHandlerResultCallback callback) { + if (mCoreConfig.getImageLoader() == null ) { ILogger.e("Please init GalleryFinal."); if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } - if ( config == null && mGlobalFunctionConfig == null) { + if (config == null && mGlobalFunctionConfig == null) { if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } - if ( config.getMaxSize() <= 0) { + if (config.getMaxSize() <= 0) { if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.maxsize_zero_tip)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.maxsize_zero_tip)); } return; } if (config.getSelectedList() != null && config.getSelectedList().size() > config.getMaxSize()) { if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.select_max_tips)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.select_max_tips)); } return; } @@ -208,13 +208,13 @@ public static void openGalleryMuti(int requestCode, FunctionConfig config, OnHan * @param requestCode * @param callback */ - public static void openCamera(int requestCode, OnHanlderResultCallback callback) { - FunctionConfig config = copyGlobalFuncationConfig(); + public static void openCamera(int requestCode, OnHandlerResultCallback callback) { + FunctionConfig config = copyGlobalFunctionConfig(); if (config != null) { openCamera(requestCode, config, callback); } else { if(callback != null) { - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } ILogger.e("Please init GalleryFinal."); } @@ -225,18 +225,18 @@ public static void openCamera(int requestCode, OnHanlderResultCallback callback) * @param config * @param callback */ - public static void openCamera(int requestCode, FunctionConfig config, OnHanlderResultCallback callback) { + public static void openCamera(int requestCode, FunctionConfig config, OnHandlerResultCallback callback) { if ( mCoreConfig.getImageLoader() == null ) { ILogger.e("Please init GalleryFinal."); if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } if ( config == null && mGlobalFunctionConfig == null) { if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } @@ -264,13 +264,13 @@ public static void openCamera(int requestCode, FunctionConfig config, OnHanlderR * @param photoPath * @param callback */ - public static void openCrop(int requestCode, String photoPath, OnHanlderResultCallback callback) { - FunctionConfig config = copyGlobalFuncationConfig(); + public static void openCrop(int requestCode, String photoPath, OnHandlerResultCallback callback) { + FunctionConfig config = copyGlobalFunctionConfig(); if (config != null) { openCrop(requestCode, config, photoPath, callback); } else { if(callback != null) { - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } ILogger.e("Please init GalleryFinal."); } @@ -283,18 +283,18 @@ public static void openCrop(int requestCode, String photoPath, OnHanlderResultCa * @param photoPath * @param callback */ - public static void openCrop(int requestCode, FunctionConfig config, String photoPath, OnHanlderResultCallback callback) { + public static void openCrop(int requestCode, FunctionConfig config, String photoPath, OnHandlerResultCallback callback) { if ( mCoreConfig.getImageLoader() == null ) { ILogger.e("Please init GalleryFinal."); if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } if ( config == null && mGlobalFunctionConfig == null) { if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } @@ -335,13 +335,13 @@ public static void openCrop(int requestCode, FunctionConfig config, String photo * @param photoPath * @param callback */ - public static void openEdit(int requestCode, String photoPath, OnHanlderResultCallback callback) { - FunctionConfig config = copyGlobalFuncationConfig(); + public static void openEdit(int requestCode, String photoPath, OnHandlerResultCallback callback) { + FunctionConfig config = copyGlobalFunctionConfig(); if (config != null) { openEdit(requestCode, config, photoPath, callback); } else { if(callback != null) { - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } ILogger.e("Please init GalleryFinal."); } @@ -354,18 +354,18 @@ public static void openEdit(int requestCode, String photoPath, OnHanlderResultCa * @param photoPath * @param callback */ - public static void openEdit(int requestCode, FunctionConfig config, String photoPath, OnHanlderResultCallback callback) { + public static void openEdit(int requestCode, FunctionConfig config, String photoPath, OnHandlerResultCallback callback) { if ( mCoreConfig.getImageLoader() == null ) { ILogger.e("Please init GalleryFinal."); if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } if ( config == null && mGlobalFunctionConfig == null) { if(callback != null){ - callback.onHanlderFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); + callback.onHandlerFailure(requestCode, mCoreConfig.getContext().getString(R.string.open_gallery_fail)); } return; } @@ -421,26 +421,26 @@ public static int getRequestCode() { return mRequestCode; } - public static OnHanlderResultCallback getCallback() { + public static OnHandlerResultCallback getCallback() { return mCallback; } /** * 处理结果 */ - public static interface OnHanlderResultCallback { + public interface OnHandlerResultCallback { /** * 处理成功 - * @param reqeustCode + * @param requestCode * @param resultList */ - public void onHanlderSuccess(int reqeustCode, List resultList); + void onHandlerSuccess(int requestCode, List resultList); /** * 处理失败或异常 * @param requestCode * @param errorMsg */ - public void onHanlderFailure(int requestCode, String errorMsg); + void onHandlerFailure(int requestCode, String errorMsg); } } diff --git a/galleryfinal/src/main/java/cn/finalteam/galleryfinal/PhotoBaseActivity.java b/galleryfinal/src/main/java/cn/finalteam/galleryfinal/PhotoBaseActivity.java index e048c0f..a248adb 100644 --- a/galleryfinal/src/main/java/cn/finalteam/galleryfinal/PhotoBaseActivity.java +++ b/galleryfinal/src/main/java/cn/finalteam/galleryfinal/PhotoBaseActivity.java @@ -179,23 +179,23 @@ private void updateGallery(String filePath) { } protected void resultData(ArrayList photoList) { - GalleryFinal.OnHanlderResultCallback callback = GalleryFinal.getCallback(); + GalleryFinal.OnHandlerResultCallback callback = GalleryFinal.getCallback(); int requestCode = GalleryFinal.getRequestCode(); if (callback != null) { if ( photoList != null && photoList.size() > 0 ) { - callback.onHanlderSuccess(requestCode, photoList); + callback.onHandlerSuccess(requestCode, photoList); } else { - callback.onHanlderFailure(requestCode, getString(R.string.photo_list_empty)); + callback.onHandlerFailure(requestCode, getString(R.string.photo_list_empty)); } } finishGalleryFinalPage(); } protected void resultFailureDelayed(String errormsg, boolean delayFinish) { - GalleryFinal.OnHanlderResultCallback callback = GalleryFinal.getCallback(); + GalleryFinal.OnHandlerResultCallback callback = GalleryFinal.getCallback(); int requestCode = GalleryFinal.getRequestCode(); if ( callback != null ) { - callback.onHanlderFailure(requestCode, errormsg); + callback.onHandlerFailure(requestCode, errormsg); } if(delayFinish) { mFinishHanlder.sendEmptyMessageDelayed(0, 500); @@ -205,10 +205,10 @@ protected void resultFailureDelayed(String errormsg, boolean delayFinish) { } protected void resultFailure(String errormsg, boolean delayFinish) { - GalleryFinal.OnHanlderResultCallback callback = GalleryFinal.getCallback(); + GalleryFinal.OnHandlerResultCallback callback = GalleryFinal.getCallback(); int requestCode = GalleryFinal.getRequestCode(); if ( callback != null ) { - callback.onHanlderFailure(requestCode, errormsg); + callback.onHandlerFailure(requestCode, errormsg); } if(delayFinish) { finishGalleryFinalPage(); diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2ee5d0e..d70c43e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Oct 10 10:03:53 CST 2015 +#Fri Apr 08 21:41:17 CST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip