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);
|
public abstract void onAnimationEnd(Animator animation);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void onAnimationCancel(Animator animation) {}
|
public void onAnimationCancel(Animator animation) {}
|
||||||
@Override
|
@Override
|
||||||
public final void onAnimationRepeat(Animator animation) {}
|
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) {
|
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 (current != null) ViewUtil.animateOut(current, outAnimation, View.GONE);
|
||||||
if (view != null) ViewUtil.animateIn(view, inAnimation);
|
if (view != null) ViewUtil.animateIn(view, inAnimation);
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ public class AnimatingToggle extends FrameLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void displayQuick(@Nullable View view) {
|
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 (current != null) current.setVisibility(View.GONE);
|
||||||
if (view != null) view.setVisibility(View.VISIBLE);
|
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.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.animation.AnimationCompleteListener;
|
import org.thoughtcrime.securesms.animation.AnimationCompleteListener;
|
||||||
|
import org.thoughtcrime.securesms.animation.AnimationStartListener;
|
||||||
import org.thoughtcrime.securesms.audio.AudioRecordingHandler;
|
import org.thoughtcrime.securesms.audio.AudioRecordingHandler;
|
||||||
import org.thoughtcrime.securesms.components.emoji.EmojiEventListener;
|
import org.thoughtcrime.securesms.components.emoji.EmojiEventListener;
|
||||||
import org.thoughtcrime.securesms.components.emoji.EmojiToggle;
|
import org.thoughtcrime.securesms.components.emoji.EmojiToggle;
|
||||||
|
@ -573,11 +574,39 @@ public class InputPanel extends LinearLayout
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fadeIn(@NonNull View v) {
|
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) {
|
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() {
|
private void updateVisibility() {
|
||||||
|
|
|
@ -624,6 +624,8 @@ public class ConversationParentFragment extends Fragment
|
||||||
if (SignalStore.rateLimit().needsRecaptcha()) {
|
if (SignalStore.rateLimit().needsRecaptcha()) {
|
||||||
RecaptchaProofBottomSheetFragment.show(getChildFragmentManager());
|
RecaptchaProofBottomSheetFragment.show(getChildFragmentManager());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateToggleButtonState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Ładowanie…
Reference in New Issue