Refresh media selection and sending flow with a shiny new UX.

This commit is contained in:
Alex Hart
2021-09-02 17:04:43 -03:00
committed by Greyson Parrelli
parent a940487611
commit 664d6475d9
195 changed files with 7075 additions and 4812 deletions

View File

@@ -0,0 +1,23 @@
package org.thoughtcrime.securesms.util
import android.view.animation.Animation
fun Animation.setListeners(
onAnimationStart: (animation: Animation?) -> Unit = { },
onAnimationEnd: (animation: Animation?) -> Unit = { },
onAnimationRepeat: (animation: Animation?) -> Unit = { }
) {
this.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation?) {
onAnimationStart(animation)
}
override fun onAnimationEnd(animation: Animation?) {
onAnimationEnd(animation)
}
override fun onAnimationRepeat(animation: Animation?) {
onAnimationRepeat(animation)
}
})
}

View File

@@ -25,6 +25,7 @@ import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.attachments.Attachment;
import org.thoughtcrime.securesms.attachments.AttachmentId;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.mediasend.Media;
import org.thoughtcrime.securesms.mms.AudioSlide;
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri;
import org.thoughtcrime.securesms.mms.DocumentSlide;
@@ -283,6 +284,10 @@ public class MediaUtil {
return (null != contentType) && contentType.startsWith("text/");
}
public static boolean isNonGifVideo(Media media) {
return isVideo(media.getMimeType()) && !media.isVideoGif();
}
public static boolean isImageType(String contentType) {
if (contentType == null) {
return false;