mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
clear drafts immediately upon sending or new intent
fixes #3843 closes #3850 Closes #4571 // FREEBIE
This commit is contained in:
parent
25da3525fa
commit
bcd08956bd
@ -29,8 +29,6 @@ import android.support.annotation.NonNull;
|
|||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.AlphaAnimation;
|
|
||||||
import android.view.animation.Animation;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
@ -42,9 +40,11 @@ import org.thoughtcrime.securesms.providers.PersistentBlobProvider;
|
|||||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||||
|
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture.Listener;
|
||||||
import org.whispersystems.libaxolotl.util.guava.Optional;
|
import org.whispersystems.libaxolotl.util.guava.Optional;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public class AttachmentManager {
|
public class AttachmentManager {
|
||||||
|
|
||||||
@ -72,25 +72,18 @@ public class AttachmentManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f);
|
ViewUtil.fadeOut(attachmentView, 200).addListener(new Listener<Boolean>() {
|
||||||
animation.setDuration(200);
|
|
||||||
animation.setAnimationListener(new Animation.AnimationListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animation animation) {}
|
public void onSuccess(Boolean result) {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationRepeat(Animation animation) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animation animation) {
|
|
||||||
slide = Optional.absent();
|
|
||||||
thumbnail.clear();
|
thumbnail.clear();
|
||||||
attachmentView.setVisibility(View.GONE);
|
attachmentView.setVisibility(View.GONE);
|
||||||
attachmentListener.onAttachmentChanged();
|
attachmentListener.onAttachmentChanged();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
attachmentView.startAnimation(animation);
|
@Override
|
||||||
|
public void onFailure(ExecutionException e) {}
|
||||||
|
});
|
||||||
|
slide = Optional.absent();
|
||||||
audioView.cleanup();
|
audioView.cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,8 +129,8 @@ public class ViewUtil {
|
|||||||
animateIn(view, getAlphaAnimation(0f, 1f, duration));
|
animateIn(view, getAlphaAnimation(0f, 1f, duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fadeOut(final @NonNull View view, final int duration) {
|
public static ListenableFuture<Boolean> fadeOut(final @NonNull View view, final int duration) {
|
||||||
animateOut(view, getAlphaAnimation(1f, 0f, duration));
|
return animateOut(view, getAlphaAnimation(1f, 0f, duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ListenableFuture<Boolean> animateOut(final @NonNull View view, final @NonNull Animation animation) {
|
public static ListenableFuture<Boolean> animateOut(final @NonNull View view, final @NonNull Animation animation) {
|
||||||
|
Loading…
Reference in New Issue
Block a user