use of com.waz.zclient.pages.extendedcursor.image.ImagePreviewLayout in project wire-android by wireapp.
the class CameraFragment method showPreview.
private void showPreview(ImageAsset imageAsset, boolean bitmapFromCamera) {
pictureFromCamera = bitmapFromCamera;
hideCameraFeed();
previewProgressBar.setVisibility(View.GONE);
ImagePreviewLayout imagePreviewLayout = (ImagePreviewLayout) LayoutInflater.from(getContext()).inflate(R.layout.fragment_cursor_images_preview, imagePreviewContainer, false);
imagePreviewLayout.showSketch(cameraContext == CameraContext.MESSAGE);
String previewTitle = cameraContext == CameraContext.MESSAGE ? getStoreFactory().getConversationStore().getCurrentConversation().getName() : "";
imagePreviewLayout.setImageAsset(imageAsset, ImagePreviewLayout.Source.CAMERA, this);
imagePreviewLayout.setAccentColor(getControllerFactory().getAccentColorController().getAccentColor().getColor());
imagePreviewLayout.setTitle(previewTitle);
imagePreviewContainer.addView(imagePreviewLayout);
imagePreviewContainer.setVisibility(View.VISIBLE);
ObjectAnimator.ofFloat(imagePreviewContainer, View.ALPHA, 0, 1).setDuration(cameraPreviewAnimationDuration).start();
cameraBottomControl.setVisibility(View.GONE);
}
use of com.waz.zclient.pages.extendedcursor.image.ImagePreviewLayout in project wire-android by wireapp.
the class ImageSharingPreviewFragment method showShareImagePreview.
private void showShareImagePreview() {
SharedContentType sharedContentType = getControllerFactory().getSharingController().getSharedContentType();
if (sharedContentType == null) {
return;
}
String title = "";
IConversation currentConversation = getControllerFactory().getSharingController().getDestination();
List<Uri> sharedImageUris = getControllerFactory().getSharingController().getSharedFileUris();
Uri previewImageUri = sharedImageUris.get(0);
switch(sharedContentType) {
case IMAGE:
title = String.format(getString(R.string.sharing__image_preview__title__single), currentConversation.getName().toUpperCase(getResources().getConfiguration().locale));
break;
}
ImagePreviewLayout imagePreview = (ImagePreviewLayout) LayoutInflater.from(getContext()).inflate(R.layout.fragment_cursor_images_preview, imagePreviewContainer, false);
imagePreview.showSketch(false);
ImageAsset imageAsset = ImageAssetFactory.getImageAsset(previewImageUri);
imagePreview.setImageAsset(imageAsset, ImagePreviewLayout.Source.CAMERA, this);
imagePreview.setAccentColor(getControllerFactory().getAccentColorController().getAccentColor().getColor());
imagePreview.setTitle(title);
imagePreview.hightlightTitle();
imagePreview.setTitleIsSingleLine(false);
imagePreviewContainer.addView(imagePreview);
}
use of com.waz.zclient.pages.extendedcursor.image.ImagePreviewLayout in project wire-android by wireapp.
the class ConversationFragment method showImagePreview.
private void showImagePreview(ImageAsset asset, ImagePreviewLayout.Source source) {
ImagePreviewLayout imagePreviewLayout = createPreviewLayout();
imagePreviewLayout.setImageAsset(asset, source, this);
imagePreviewLayout.setAccentColor(getControllerFactory().getAccentColorController().getAccentColor().getColor());
imagePreviewLayout.setTitle(getStoreFactory().getConversationStore().getCurrentConversation().getName());
containerPreview.addView(imagePreviewLayout);
openPreview(containerPreview);
}
Aggregations