kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix voice note UX issues.
rodzic
76383fe1bc
commit
01f477a587
|
@ -11,7 +11,7 @@ public abstract class AnimationCompleteListener implements Animator.AnimatorList
|
|||
public abstract void onAnimationEnd(Animator animation);
|
||||
|
||||
@Override
|
||||
public final void onAnimationCancel(Animator animation) {}
|
||||
public void onAnimationCancel(Animator animation) {}
|
||||
@Override
|
||||
public final void onAnimationRepeat(Animator animation) {}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package org.thoughtcrime.securesms.animation
|
||||
|
||||
import android.animation.Animator
|
||||
|
||||
abstract class AnimationStartListener : Animator.AnimatorListener {
|
||||
override fun onAnimationEnd(animation: Animator) = Unit
|
||||
override fun onAnimationCancel(animation: Animator) = Unit
|
||||
override fun onAnimationRepeat(animation: Animator) = Unit
|
||||
}
|
|
@ -54,7 +54,7 @@ public class AnimatingToggle extends FrameLayout {
|
|||
}
|
||||
|
||||
public void display(@Nullable View view) {
|
||||
if (view == current) return;
|
||||
if (view == current && current.getVisibility() == View.VISIBLE) return;
|
||||
if (current != null) ViewUtil.animateOut(current, outAnimation, View.GONE);
|
||||
if (view != null) ViewUtil.animateIn(view, inAnimation);
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class AnimatingToggle extends FrameLayout {
|
|||
}
|
||||
|
||||
public void displayQuick(@Nullable View view) {
|
||||
if (view == current) return;
|
||||
if (view == current && current.getVisibility() == View.VISIBLE) return;
|
||||
if (current != null) current.setVisibility(View.GONE);
|
||||
if (view != null) view.setVisibility(View.VISIBLE);
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.signal.core.util.ThreadUtil;
|
|||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.animation.AnimationCompleteListener;
|
||||
import org.thoughtcrime.securesms.animation.AnimationStartListener;
|
||||
import org.thoughtcrime.securesms.audio.AudioRecordingHandler;
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiEventListener;
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiToggle;
|
||||
|
@ -573,11 +574,39 @@ public class InputPanel extends LinearLayout
|
|||
}
|
||||
|
||||
private void fadeIn(@NonNull View v) {
|
||||
v.animate().alpha(1).setDuration(FADE_TIME).start();
|
||||
v.animate()
|
||||
.setListener(new AnimationStartListener() {
|
||||
@Override
|
||||
public void onAnimationStart(@NonNull Animator animation) {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(@NonNull Animator animation) {
|
||||
v.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
})
|
||||
.alpha(1)
|
||||
.setDuration(FADE_TIME)
|
||||
.start();
|
||||
}
|
||||
|
||||
private void fadeOut(@NonNull View v) {
|
||||
v.animate().alpha(0).setDuration(FADE_TIME).start();
|
||||
v.animate()
|
||||
.setListener(new AnimationCompleteListener() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
v.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
v.setVisibility(View.VISIBLE);
|
||||
}
|
||||
})
|
||||
.alpha(0)
|
||||
.setDuration(FADE_TIME)
|
||||
.start();
|
||||
}
|
||||
|
||||
private void updateVisibility() {
|
||||
|
|
|
@ -624,6 +624,8 @@ public class ConversationParentFragment extends Fragment
|
|||
if (SignalStore.rateLimit().needsRecaptcha()) {
|
||||
RecaptchaProofBottomSheetFragment.show(getChildFragmentManager());
|
||||
}
|
||||
|
||||
updateToggleButtonState();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Ładowanie…
Reference in New Issue