mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 15:13:50 +00:00
No sticker packs are available for use yet, but we now have the latent ability to send and receive.
39 lines
1.2 KiB
Java
39 lines
1.2 KiB
Java
package org.thoughtcrime.securesms.stickers;
|
|
|
|
import android.content.Context;
|
|
import android.support.annotation.NonNull;
|
|
import android.view.LayoutInflater;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.PopupWindow;
|
|
|
|
import org.thoughtcrime.securesms.R;
|
|
import org.thoughtcrime.securesms.database.model.StickerRecord;
|
|
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri;
|
|
import org.thoughtcrime.securesms.mms.GlideRequests;
|
|
|
|
|
|
/**
|
|
* A popup that shows a given sticker fullscreen.
|
|
*/
|
|
final class StickerPreviewPopup extends PopupWindow {
|
|
|
|
private final GlideRequests glideRequests;
|
|
private final ImageView image;
|
|
|
|
StickerPreviewPopup(@NonNull Context context, @NonNull GlideRequests glideRequests) {
|
|
super(LayoutInflater.from(context).inflate(R.layout.sticker_preview_popup, null),
|
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
ViewGroup.LayoutParams.MATCH_PARENT);
|
|
this.glideRequests = glideRequests;
|
|
this.image = getContentView().findViewById(R.id.sticker_popup_image);
|
|
|
|
setTouchable(false);
|
|
}
|
|
|
|
void presentSticker(@NonNull StickerRecord stickerRecord) {
|
|
glideRequests.load(new DecryptableUri(stickerRecord.getUri()))
|
|
.into(image);
|
|
}
|
|
}
|