@Override
public void onClick(View view) {
fotoapparat.takePicture().toBitmap().transform(new Function1<BitmapPhoto, Bitmap>() {
@Override
public Bitmap invoke(BitmapPhoto bitmapPhoto) {
Log.e("my pick transform", bitmapPhoto.toString());
fotoapparat.stop();
return Utility.rotate(bitmapPhoto.bitmap, -bitmapPhoto.rotationDegrees);
}
}).whenAvailable(new Function1<Bitmap, Unit>() {
@Override
public Unit invoke(Bitmap bitmap) {
if (bitmap != null) {
Log.e("my pick", bitmap.toString());
synchronized (bitmap) {
File photo = Utility.writeImage(bitmap, options.getPath(), options.getImageQuality(), options.getWidth(), options.getHeight());
Log.e("my pick saved", bitmap.toString() + " -> " + photo.length() / 1024);
selectionList.clear();
selectionList.add(new Img("", "", photo.getAbsolutePath(), ""));
returnObjects();
}
}
return null;
}
});
}
});