From 7052d72454704dbedd45eeec482b515881cf2d87 Mon Sep 17 00:00:00 2001 From: Abdullah Alhazmy Date: Tue, 12 Dec 2017 19:15:38 +0300 Subject: [PATCH] * update readme file * update appcompat version to 25.4.0 * update rxjava version to 1.3.0 --- README.md | 8 +-- app/build.gradle | 6 +- .../mediapickerexample/ImageFragment.java | 71 ++++++++++--------- .../mediapickerexample/VideoFragment.java | 2 - build.gradle | 8 +++ libary/build.gradle | 26 +++---- rxjava/build.gradle | 24 +++---- 7 files changed, 76 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index a4aaaa8..2da6aa2 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ # Media Picker ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg) ![](https://img.shields.io/hexpm/l/plug.svg) -![](https://img.shields.io/badge/version-2.3.3-blue.svg) +![](https://img.shields.io/badge/version-2.4.0-blue.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/ea51407d60d04c938c263de206095abf)](https://www.codacy.com/app/me_101/MediaPicker?utm_source=github.com&utm_medium=referral&utm_content=alhazmy13/MediaPicker&utm_campaign=badger) -[![ghit.me](https://ghit.me/badge.svg?repo=Alhazmy13/MediaPicker)](https://ghit.me/repo/Alhazmy13/MediaPicker) + **[Please let me know if your application go to production via this link](https://docs.google.com/forms/d/e/1FAIpQLSe4Y5Fwn1mlEoD4RxjXQzTvL4mofhESuBlTkAPQhI7J_WqMDQ/viewform?c=0&w=1)** ------ @@ -25,7 +25,7 @@ This build `2.x.x` will break backward compatibility and there are a lot of chan net.alhazmy13.MediaPicker libary -2.3.3 +2.4.0 ``` @@ -34,7 +34,7 @@ This build `2.x.x` will break backward compatibility and there are a lot of chan ```gradle dependencies { - compile 'net.alhazmy13.MediaPicker:libary:2.3.3' + compile 'net.alhazmy13.MediaPicker:libary:2.4.0' } ``` diff --git a/app/build.gradle b/app/build.gradle index aeff74d..088fce1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,9 +25,9 @@ android { } dependencies { - compile "com.android.support:appcompat-v7:25.3.1" - compile "com.android.support:design:25.3.1" - compile "com.android.support:support-v13:25.3.1" + compile "com.android.support:appcompat-v7:25.4.0" + compile "com.android.support:design:25.4.0" + compile "com.android.support:support-v13:25.4.0" compile project(':libary') compile project(':rxjava') } diff --git a/app/src/main/java/net/alhazmy13/mediapickerexample/ImageFragment.java b/app/src/main/java/net/alhazmy13/mediapickerexample/ImageFragment.java index e051a53..e31409c 100644 --- a/app/src/main/java/net/alhazmy13/mediapickerexample/ImageFragment.java +++ b/app/src/main/java/net/alhazmy13/mediapickerexample/ImageFragment.java @@ -1,7 +1,6 @@ package net.alhazmy13.mediapickerexample; import android.app.Fragment; -import android.content.Intent; import android.graphics.BitmapFactory; import android.os.Bundle; import android.util.Log; @@ -12,10 +11,13 @@ import android.widget.TextView; import net.alhazmy13.mediapicker.Image.ImagePicker; +import net.alhazmy13.mediapicker.rxjava.image.ImagePickerHelper; + import java.util.List; -import static android.app.Activity.RESULT_OK; +import rx.Subscriber; + /** * Created by alhazmy13 on 3/13/17. @@ -48,7 +50,7 @@ public void onClick(View v) { private void pickImage() { -// new ImagePickerHelper( + new ImagePickerHelper( new ImagePicker.Builder(getActivity()) .mode(ImagePicker.Mode.CAMERA_AND_GALLERY) .allowMultipleImages(true) @@ -58,41 +60,40 @@ private void pickImage() { .allowOnlineImages(false) .scale(600, 600) .allowMultipleImages(true) - .enableDebuggingMode(true) - .build(); -// .getObservable() -// .subscribe(new Subscriber>() { -// @Override -// public void onCompleted() { -// Log.d(TAG, "onCompleted() called with: " + ""); -// } -// -// @Override -// public void onError(Throwable e) { -// Log.d(TAG, "onError() called with: " + "e = [" + e + "]"); -// e.printStackTrace(); -// } -// -// @Override -// public void onNext(List imagePath) { -// Log.d(TAG, "onNext() called with: " + "imagePath = [" + imagePath + "]"); -// mPath = imagePath; -// loadImage(); -// } -// }); + .enableDebuggingMode(true)) + .getObservable() + .subscribe(new Subscriber>() { + @Override + public void onCompleted() { + Log.d(TAG, "onCompleted() called with: " + ""); + } + + @Override + public void onError(Throwable e) { + Log.d(TAG, "onError() called with: " + "e = [" + e + "]"); + e.printStackTrace(); + } + + @Override + public void onNext(List imagePath) { + Log.d(TAG, "onNext() called with: " + "imagePath = [" + imagePath + "]"); + mPath = imagePath; + loadImage(); + } + }); } - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - Log.d(TAG, "onActivityResult() called with: requestCode = [" + requestCode + "], resultCode = [" + resultCode + "], data = [" + data + "]"); - if (requestCode == ImagePicker.IMAGE_PICKER_REQUEST_CODE && resultCode == RESULT_OK) { - mPath = (List) data.getSerializableExtra(ImagePicker.EXTRA_IMAGE_PATH); - - loadImage(); - } - } +// @Override +// public void onActivityResult(int requestCode, int resultCode, Intent data) { +// super.onActivityResult(requestCode, resultCode, data); +// Log.d(TAG, "onActivityResult() called with: requestCode = [" + requestCode + "], resultCode = [" + resultCode + "], data = [" + data + "]"); +// if (requestCode == ImagePicker.IMAGE_PICKER_REQUEST_CODE && resultCode == RESULT_OK) { +// mPath = (List) data.getSerializableExtra(ImagePicker.EXTRA_IMAGE_PATH); +// +// loadImage(); +// } +// } private void loadImage() { Log.d(TAG, "loadImage: " + mPath.size()); diff --git a/app/src/main/java/net/alhazmy13/mediapickerexample/VideoFragment.java b/app/src/main/java/net/alhazmy13/mediapickerexample/VideoFragment.java index 943ec69..f3fe546 100644 --- a/app/src/main/java/net/alhazmy13/mediapickerexample/VideoFragment.java +++ b/app/src/main/java/net/alhazmy13/mediapickerexample/VideoFragment.java @@ -80,8 +80,6 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { private void loadVideo() { Log.d(TAG, "loadVideo: "+ (mPath == null)); if (mPath != null && mPath.size() > 0) { - Log.d(TAG, "loadVideo: "); - Log.d(TAG, "loadImage: " + mPath.size()); path.setText(mPath.get(0)); videoView.setVideoURI(Uri.parse(mPath.get(0))); videoView.start(); diff --git a/build.gradle b/build.gradle index a1b4dc7..2b7e731 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,10 @@ buildscript { repositories { jcenter() + maven { + url 'https://maven.google.com/' + name 'Google' + } } dependencies { classpath 'com.android.tools.build:gradle:2.2.3' @@ -12,6 +16,10 @@ buildscript { allprojects { repositories { jcenter() + maven { + url 'https://maven.google.com/' + name 'Google' + } } } diff --git a/libary/build.gradle b/libary/build.gradle index 385c9b5..194a48d 100644 --- a/libary/build.gradle +++ b/libary/build.gradle @@ -1,18 +1,18 @@ apply plugin: 'com.android.library' -//apply plugin: 'com.novoda.bintray-release' +apply plugin: 'com.novoda.bintray-release' //apply from: '../deps.gradle' -////./gradlew bintrayUpload -//publish { -// userOrg = 'alhazmy13' -// groupId = 'net.alhazmy13.MediaPicker' -// artifactId = 'libary' -// uploadName = 'MediaPicker' -// publishVersion = '2.3.3' -// desc = 'MediaPickerRx' -// dryRun = false -// website = 'https://github.com/alhzmy13/MediaPicker' -//} +//./gradlew bintrayUpload +publish { + userOrg = 'alhazmy13' + groupId = 'net.alhazmy13.MediaPicker' + artifactId = 'libary' + uploadName = 'MediaPicker' + publishVersion = '2.4.0' + desc = 'MediaPickerRx' + dryRun = false + website = 'https://github.com/alhzmy13/MediaPicker' +} android { compileSdkVersion 25 @@ -41,5 +41,5 @@ android { dependencies { - compile 'com.android.support:appcompat-v7:25.3.1' + compile 'com.android.support:appcompat-v7:25.4.0' } diff --git a/rxjava/build.gradle b/rxjava/build.gradle index 07f906c..8fcc5fd 100644 --- a/rxjava/build.gradle +++ b/rxjava/build.gradle @@ -1,19 +1,19 @@ apply plugin: 'com.android.library' //apply from: '../deps.gradle' -apply plugin: 'com.novoda.bintray-release' +//apply plugin: 'com.novoda.bintray-release' //./gradlew bintrayUpload -publish { - userOrg = 'alhazmy13' - groupId = 'net.alhazmy13.MediaPicker' - artifactId = 'rxjava' - uploadName = 'MediaPickerRx' - publishVersion = '2.3.3' - desc = 'MediaPickerRx' - dryRun = false - website = 'https://github.com/alhzmy13/MediaPicker' -} +//publish { +// userOrg = 'alhazmy13' +// groupId = 'net.alhazmy13.MediaPicker' +// artifactId = 'rxjava' +// uploadName = 'MediaPickerRx' +// publishVersion = '2.4.0' +// desc = 'MediaPickerRx' +// dryRun = false +// website = 'https://github.com/alhzmy13/MediaPicker' +//} android { compileSdkVersion 25 @@ -36,6 +36,6 @@ android { dependencies { compile 'io.reactivex:rxandroid:1.2.1' - compile 'io.reactivex:rxjava:1.1.6' + compile 'io.reactivex:rxjava:1.3.0' compile project(':libary') }