Search in sources :

Example 1 with ImageAsset

use of com.waz.api.ImageAsset in project wire-android by wireapp.

the class GiphyGridViewAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
    final ImageAsset imageAsset = giphyResults.get(position);
    holder.setImageAsset(imageAsset, position);
}
Also used : ImageAsset(com.waz.api.ImageAsset)

Example 2 with ImageAsset

use of com.waz.api.ImageAsset in project wire-android by wireapp.

the class ConversationFragment method sendImage.

private void sendImage(Uri uri) {
    ImageAsset imageAsset = ImageAssetFactory.getImageAsset(uri);
    getStoreFactory().getConversationStore().sendMessage(imageAsset);
}
Also used : ImageAsset(com.waz.api.ImageAsset)

Example 3 with ImageAsset

use of com.waz.api.ImageAsset 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)

Aggregations

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