Search in sources :

Example 1 with ImagePreviewLayout

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);
}
Also used : ImagePreviewLayout(com.waz.zclient.pages.extendedcursor.image.ImagePreviewLayout)

Example 2 with ImagePreviewLayout

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);
}
Also used : SharedContentType(com.waz.zclient.controllers.sharing.SharedContentType) IConversation(com.waz.api.IConversation) Uri(android.net.Uri) ImagePreviewLayout(com.waz.zclient.pages.extendedcursor.image.ImagePreviewLayout) ImageAsset(com.waz.api.ImageAsset)

Example 3 with ImagePreviewLayout

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);
}
Also used : ImagePreviewLayout(com.waz.zclient.pages.extendedcursor.image.ImagePreviewLayout)

Aggregations

ImagePreviewLayout (com.waz.zclient.pages.extendedcursor.image.ImagePreviewLayout)3 Uri (android.net.Uri)1 IConversation (com.waz.api.IConversation)1 ImageAsset (com.waz.api.ImageAsset)1 SharedContentType (com.waz.zclient.controllers.sharing.SharedContentType)1