Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #48 from alhazmy13/develop
Browse files Browse the repository at this point in the history
version 2.4.0
  • Loading branch information
alhazmy13 authored Dec 12, 2017
2 parents 63912b9 + 7052d72 commit 516fdee
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 69 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)**
------
Expand All @@ -25,7 +25,7 @@ This build `2.x.x` will break backward compatibility and there are a lot of chan
<dependency>
<groupId>net.alhazmy13.MediaPicker</groupId>
<artifactId>libary</artifactId>
<version>2.3.3</version>
<version>2.4.0</version>
</dependency>
```

Expand All @@ -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'
}
```

Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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.
Expand Down Expand Up @@ -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)
Expand All @@ -58,41 +60,40 @@ private void pickImage() {
.allowOnlineImages(false)
.scale(600, 600)
.allowMultipleImages(true)
.enableDebuggingMode(true)
.build();
// .getObservable()
// .subscribe(new Subscriber<List<String>>() {
// @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<String> imagePath) {
// Log.d(TAG, "onNext() called with: " + "imagePath = [" + imagePath + "]");
// mPath = imagePath;
// loadImage();
// }
// });
.enableDebuggingMode(true))
.getObservable()
.subscribe(new Subscriber<List<String>>() {
@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<String> 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<String>) 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<String>) data.getSerializableExtra(ImagePicker.EXTRA_IMAGE_PATH);
//
// loadImage();
// }
// }

private void loadImage() {
Log.d(TAG, "loadImage: " + mPath.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -12,6 +16,10 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

Expand Down
26 changes: 13 additions & 13 deletions libary/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -41,5 +41,5 @@ android {


dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.4.0'
}
24 changes: 12 additions & 12 deletions rxjava/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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')
}

0 comments on commit 516fdee

Please sign in to comment.