This repository has been archived by the owner on May 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor rxjava module, * remove portrait orientation from image an…
…d video activity
- Loading branch information
Showing
13 changed files
with
185 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
rxjava/src/main/java/net/alhazmy13/mediapicker/rxjava/image/ImagePickerHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
rxjava/src/main/java/net/alhazmy13/mediapicker/rxjava/image/ImagePickerObservable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package net.alhazmy13.mediapicker.rxjava.image; | ||
|
||
|
||
import android.content.Context; | ||
import android.content.IntentFilter; | ||
|
||
import net.alhazmy13.mediapicker.Image.ImagePicker; | ||
import net.alhazmy13.mediapicker.Image.ImageTags; | ||
|
||
import java.lang.ref.WeakReference; | ||
import java.util.List; | ||
|
||
import io.reactivex.ObservableEmitter; | ||
import io.reactivex.ObservableOnSubscribe; | ||
import io.reactivex.disposables.Disposable; | ||
|
||
/** | ||
* Created by Alhazmy13 on 8/7/16. | ||
* MediaPicker | ||
*/ | ||
public class ImagePickerObservable implements ObservableOnSubscribe<List<String>>, Disposable { | ||
|
||
private static final String TAG = "ImagePickerObservable"; | ||
private ImagePicker.Builder imagePicker; | ||
private ImagePickerReceiver broadcastReceiver; | ||
private final WeakReference<Context> contextWeakReference; | ||
|
||
public ImagePickerObservable(ImagePicker.Builder imagePicker) { | ||
this.imagePicker = imagePicker; | ||
this.contextWeakReference = new WeakReference<Context>(imagePicker.getContext()); | ||
|
||
} | ||
|
||
|
||
@Override | ||
public void subscribe(ObservableEmitter<List<String>> emitter) { | ||
broadcastReceiver = new ImagePickerReceiver(emitter); | ||
imagePicker.build(); | ||
contextWeakReference.get().registerReceiver(broadcastReceiver, new IntentFilter(ImageTags.Action.SERVICE_ACTION)); | ||
} | ||
|
||
@Override | ||
public void dispose() { | ||
if (contextWeakReference != null && contextWeakReference.get() != null && broadcastReceiver != null) { | ||
contextWeakReference.get().unregisterReceiver(broadcastReceiver); | ||
|
||
} | ||
broadcastReceiver = null; | ||
} | ||
|
||
@Override | ||
public boolean isDisposed() { | ||
return broadcastReceiver == null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
...ain/java/net/alhazmy13/mediapicker/rxjava/image/observable/ImagePickerBaseObservable.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.