Search in sources :

Example 1 with ISandBoxServiceView

use of com.yydcdut.note.views.service.ISandBoxServiceView in project PhotoNoter by yydcdut.

the class SandBoxServicePresenterImpl method attachView.

@Override
public void attachView(IView iView) {
    mSandBoxServiceView = (ISandBoxServiceView) iView;
    mSandBoxServiceView.notification();
    mHandler = new Handler() {

        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            finishSandBoxService();
        }
    };
    mRxSandBox.findAll().flatMap(sandPhotos -> Observable.from(sandPhotos)).subscribe((sandPhoto -> makePhoto(sandPhoto)), (throwable -> YLog.e(throwable)), (() -> mHandler.sendEmptyMessageDelayed(0, 4000)));
}
Also used : Rect(android.graphics.Rect) RxPhotoNote(com.yydcdut.note.model.rx.RxPhotoNote) ByteArrayOutputStream(java.io.ByteArrayOutputStream) SandPhoto(com.yydcdut.note.entity.SandPhoto) BitmapFactory(android.graphics.BitmapFactory) ExifInterface(android.media.ExifInterface) Observable(rx.Observable) Inject(javax.inject.Inject) Const(com.yydcdut.note.utils.Const) RxSandBox(com.yydcdut.note.model.rx.RxSandBox) Handler(android.os.Handler) FilePathUtils(com.yydcdut.note.utils.FilePathUtils) Utils(com.yydcdut.note.utils.Utils) ImageFormat(android.graphics.ImageFormat) IOException(java.io.IOException) FileInputStream(java.io.FileInputStream) SandExif(com.yydcdut.note.entity.SandExif) File(java.io.File) FileNotFoundException(java.io.FileNotFoundException) Message(android.os.Message) Bitmap(android.graphics.Bitmap) YuvImage(android.graphics.YuvImage) ISandBoxServiceView(com.yydcdut.note.views.service.ISandBoxServiceView) PhotoNote(com.yydcdut.note.entity.PhotoNote) ISandBoxServicePresenter(com.yydcdut.note.presenters.service.ISandBoxServicePresenter) YLog(com.yydcdut.note.utils.YLog) IView(com.yydcdut.note.views.IView) InputStream(java.io.InputStream) Message(android.os.Message) Handler(android.os.Handler)

Aggregations

Bitmap (android.graphics.Bitmap)1 BitmapFactory (android.graphics.BitmapFactory)1 ImageFormat (android.graphics.ImageFormat)1 Rect (android.graphics.Rect)1 YuvImage (android.graphics.YuvImage)1 ExifInterface (android.media.ExifInterface)1 Handler (android.os.Handler)1 Message (android.os.Message)1 PhotoNote (com.yydcdut.note.entity.PhotoNote)1 SandExif (com.yydcdut.note.entity.SandExif)1 SandPhoto (com.yydcdut.note.entity.SandPhoto)1 RxPhotoNote (com.yydcdut.note.model.rx.RxPhotoNote)1 RxSandBox (com.yydcdut.note.model.rx.RxSandBox)1 ISandBoxServicePresenter (com.yydcdut.note.presenters.service.ISandBoxServicePresenter)1 Const (com.yydcdut.note.utils.Const)1 FilePathUtils (com.yydcdut.note.utils.FilePathUtils)1 Utils (com.yydcdut.note.utils.Utils)1 YLog (com.yydcdut.note.utils.YLog)1 IView (com.yydcdut.note.views.IView)1 ISandBoxServiceView (com.yydcdut.note.views.service.ISandBoxServiceView)1