Search in sources :

Example 1 with ExifTask

use of com.aviary.android.feather.async_tasks.ExifTask in project mobile-android by photo.

the class FeatherActivity method loadExif.

/**
	 * load the original file EXIF data and store the result into the local data instance
	 */
protected void loadExif() {
    logger.log("loadExif");
    final LocalDataService data = mFilterManager.getService(LocalDataService.class);
    ThreadPoolService thread = mFilterManager.getService(ThreadPoolService.class);
    if (null != data && thread != null) {
        final String path = data.getSourceImagePath();
        FutureListener<Bundle> listener = new FutureListener<Bundle>() {

            @Override
            public void onFutureDone(Future<Bundle> future) {
                try {
                    Bundle result = future.get();
                    if (null != result) {
                        data.setOriginalExifBundle(result);
                    }
                } catch (Throwable e) {
                    e.printStackTrace();
                }
            }
        };
        if (null != path) {
            thread.submit(new ExifTask(), listener, path);
        } else {
            logger.warning("orinal file path not available");
        }
    }
}
Also used : FutureListener(com.aviary.android.feather.library.services.FutureListener) LocalDataService(com.aviary.android.feather.library.services.LocalDataService) Bundle(android.os.Bundle) ThreadPoolService(com.aviary.android.feather.library.services.ThreadPoolService) Future(java.util.concurrent.Future) ExifTask(com.aviary.android.feather.async_tasks.ExifTask)

Aggregations

Bundle (android.os.Bundle)1 ExifTask (com.aviary.android.feather.async_tasks.ExifTask)1 FutureListener (com.aviary.android.feather.library.services.FutureListener)1 LocalDataService (com.aviary.android.feather.library.services.LocalDataService)1 ThreadPoolService (com.aviary.android.feather.library.services.ThreadPoolService)1 Future (java.util.concurrent.Future)1