add call recording animation

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-12-06 13:28:19 +01:00
parent bafe9198eb
commit fcef4b9c9b
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B

View file

@ -52,6 +52,9 @@ import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.Toast; import android.widget.Toast;
@ -183,6 +186,7 @@ public class CallActivity extends CallBaseActivity {
public static final String VIDEO_STREAM_TYPE_SCREEN = "screen"; public static final String VIDEO_STREAM_TYPE_SCREEN = "screen";
public static final String VIDEO_STREAM_TYPE_VIDEO = "video"; public static final String VIDEO_STREAM_TYPE_VIDEO = "video";
private static final Long RECORDING_ANIMATION_DURATION = 1000L;
@Inject @Inject
NcApi ncApi; NcApi ncApi;
@ -2923,9 +2927,16 @@ public class CallActivity extends CallBaseActivity {
public void showCallRecordingIndicator() { public void showCallRecordingIndicator() {
binding.callRecordingIndicator.setVisibility(View.VISIBLE); binding.callRecordingIndicator.setVisibility(View.VISIBLE);
Animation animation = new AlphaAnimation(1.0f, 0.0f);
animation.setDuration(RECORDING_ANIMATION_DURATION);
animation.setInterpolator(new LinearInterpolator());
animation.setRepeatCount(Animation.INFINITE);
animation.setRepeatMode(Animation.REVERSE);
binding.callRecordingIndicator.startAnimation(animation);
} }
public void hideCallRecordingIndicator() { public void hideCallRecordingIndicator() {
binding.callRecordingIndicator.clearAnimation();
binding.callRecordingIndicator.setVisibility(View.GONE); binding.callRecordingIndicator.setVisibility(View.GONE);
} }