mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-25 04:06:14 +00:00
Support hiding image caption with press and hold.
This commit is contained in:
@@ -9,6 +9,7 @@ import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
|
||||
import com.bumptech.glide.RequestManager;
|
||||
@@ -80,6 +81,12 @@ public class ZoomingImageView extends FrameLayout {
|
||||
this.subsamplingImageView.setOnClickListener(v -> ZoomingImageView.this.callOnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnLongClickListener(@Nullable OnLongClickListener l) {
|
||||
this.gifView.setOnLongClickListener(l);
|
||||
this.subsamplingImageView.setOnLongClickListener(l);
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public void setImageUri(@NonNull RequestManager requestManager, @NonNull Uri uri, @NonNull String contentType, @NonNull Runnable onMediaReady) {
|
||||
if (MediaUtil.isGif(contentType)) {
|
||||
|
||||
@@ -53,6 +53,7 @@ public final class ImageMediaPreviewFragment extends MediaPreviewFragment {
|
||||
zoomingImageView.setImageUri(requestManager, uri, contentType, () -> events.onMediaReady());
|
||||
|
||||
zoomingImageView.setOnClickListener(v -> events.singleTapOnMedia());
|
||||
zoomingImageView.setOnLongClickListener(v -> events.singleTapOnMedia());
|
||||
|
||||
lifecycleDisposable.add(viewModel.getState().distinctUntilChanged().subscribe(state -> {
|
||||
zoomingImageView.setAlpha(state.isInSharedAnimation() ? 0f : 1f);
|
||||
|
||||
Reference in New Issue
Block a user