Search in sources :

Example 1 with IView

use of com.yydcdut.note.views.IView 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)

Example 2 with IView

use of com.yydcdut.note.views.IView in project PhotoNoter by yydcdut.

the class PermissionAspect method afterPermissionRequestBack.

@After("execution(* android.support.v4.app.FragmentActivity.onRequestPermissionsResult(..))")
public void afterPermissionRequestBack(JoinPoint joinPoint) {
    YLog.i(TAG, "afterPermissionRequestBack");
    Object[] objects = joinPoint.getArgs();
    Object object = joinPoint.getTarget();
    if (objects.length >= 1 && objects[0] instanceof Integer && object != null && object instanceof IView && ((IView) object).getPresenter() != null) {
        int requestCode = (int) objects[0];
        invokeMethod(((IView) object).getPresenter(), requestCode);
    } else {
        YLog.i(TAG, "afterPermissionRequestBack --> bad");
    }
}
Also used : IView(com.yydcdut.note.views.IView) JoinPoint(org.aspectj.lang.JoinPoint) ProceedingJoinPoint(org.aspectj.lang.ProceedingJoinPoint) After(org.aspectj.lang.annotation.After)

Example 3 with IView

use of com.yydcdut.note.views.IView in project PhotoNoter by yydcdut.

the class EditCategoryPresenterImpl method attachView.

@Override
public void attachView(IView iView) {
    mHandler = new Handler(this);
    mDeleteCategoryIdList = new ArrayList<>();
    mRenameCategoryLabelMap = new HashMap<>();
    mEditCategoryView = (IEditCategoryView) iView;
    mRxCategory.getAllCategories().observeOn(AndroidSchedulers.mainThread()).subscribe(categories -> mEditCategoryView.showCategoryList(categories), (throwable -> YLog.e(throwable)));
}
Also used : Context(android.content.Context) RxPhotoNote(com.yydcdut.note.model.rx.RxPhotoNote) AndroidSchedulers(rx.android.schedulers.AndroidSchedulers) HashMap(java.util.HashMap) IEditCategoryPresenter(com.yydcdut.note.presenters.setting.IEditCategoryPresenter) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) Handler(android.os.Handler) ContextLife(com.yydcdut.note.injector.ContextLife) EventBus(org.greenrobot.eventbus.EventBus) Map(java.util.Map) Category(com.yydcdut.note.entity.Category) FilePathUtils(com.yydcdut.note.utils.FilePathUtils) Schedulers(rx.schedulers.Schedulers) R(com.yydcdut.note.R) RxCategory(com.yydcdut.note.model.rx.RxCategory) Iterator(java.util.Iterator) CategoryEditEvent(com.yydcdut.note.bus.CategoryEditEvent) IEditCategoryView(com.yydcdut.note.views.setting.IEditCategoryView) List(java.util.List) Message(android.os.Message) ComparatorFactory(com.yydcdut.note.model.compare.ComparatorFactory) CategoryDeleteEvent(com.yydcdut.note.bus.CategoryDeleteEvent) PhotoNote(com.yydcdut.note.entity.PhotoNote) YLog(com.yydcdut.note.utils.YLog) IView(com.yydcdut.note.views.IView) Handler(android.os.Handler)

Example 4 with IView

use of com.yydcdut.note.views.IView in project PhotoNoter by yydcdut.

the class PermissionAspect method afterPermissionRequestBack4Fragment.

@After("execution(* android.app.Fragment.onRequestPermissionsResult(..))")
public void afterPermissionRequestBack4Fragment(JoinPoint joinPoint) {
    Object[] objects = joinPoint.getArgs();
    Object object = joinPoint.getTarget();
    if (objects.length >= 1 && objects[0] instanceof Integer && object != null && object instanceof IView && ((IView) object).getPresenter() != null) {
        int requestCode = (int) objects[0];
        invokeMethod(((IView) object).getPresenter(), requestCode);
    } else {
        YLog.i(TAG, "afterPermissionRequestBack4Fragment --> bad");
    }
}
Also used : IView(com.yydcdut.note.views.IView) JoinPoint(org.aspectj.lang.JoinPoint) ProceedingJoinPoint(org.aspectj.lang.ProceedingJoinPoint) After(org.aspectj.lang.annotation.After)

Aggregations

IView (com.yydcdut.note.views.IView)4 Handler (android.os.Handler)2 Message (android.os.Message)2 PhotoNote (com.yydcdut.note.entity.PhotoNote)2 RxPhotoNote (com.yydcdut.note.model.rx.RxPhotoNote)2 FilePathUtils (com.yydcdut.note.utils.FilePathUtils)2 YLog (com.yydcdut.note.utils.YLog)2 Inject (javax.inject.Inject)2 Context (android.content.Context)1 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 R (com.yydcdut.note.R)1 CategoryDeleteEvent (com.yydcdut.note.bus.CategoryDeleteEvent)1 CategoryEditEvent (com.yydcdut.note.bus.CategoryEditEvent)1 Category (com.yydcdut.note.entity.Category)1 SandExif (com.yydcdut.note.entity.SandExif)1