call: improve ripple quality
Change-Id: Ie83af8d6b642053adea8799a8c8a65c9a714ee76
diff --git a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java
index d98a9d46..af36e56 100644
--- a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java
+++ b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java
@@ -53,7 +53,8 @@
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
-import com.skyfishjy.library.RippleBackground;
+import com.rodolfonavalon.shaperipplelibrary.ShapeRipple;
+import com.rodolfonavalon.shaperipplelibrary.model.Circle;
import java.util.ArrayList;
import java.util.Locale;
@@ -119,8 +120,8 @@
@BindView(R.id.dialpad_edit_text)
protected EditText mNumeralDialEditText;
- @BindView(R.id.ripple_animation)
- protected RippleBackground mPulseAnimation;
+ @BindView(R.id.shape_ripple)
+ protected ShapeRipple shapeRipple = null;
@BindView(R.id.video_preview_surface)
protected SurfaceView mVideoSurface = null;
@@ -136,6 +137,7 @@
private PowerManager.WakeLock mScreenWakeLock;
private DisplayManager.DisplayListener displayListener;
private int mCurrentOrientation = Configuration.ORIENTATION_UNDEFINED;
+ private boolean firstUpdate = true;
public static CallFragment newInstance(@NonNull String action, @Nullable String accountID, @Nullable String contactRingId, boolean audioOnly) {
Bundle bundle = new Bundle();
@@ -318,6 +320,8 @@
}
});
mVideoPreview.setZOrderMediaOverlay(true);
+
+ shapeRipple.setRippleShape(new Circle());
}
@Override
@@ -486,13 +490,7 @@
RequestOptions glideOptions = AvatarFactory.getGlideOptions(true, false);
getActivity().runOnUiThread(() -> {
- Glide.with(getActivity())
- .load(contactPicture)
- .apply(glideOptions)
- .into(contactBubbleView);
-
boolean hasProfileName = displayName != null && !displayName.contentEquals(username);
- boolean firstShow = contactBubbleTxt.getText() != null && contactBubbleTxt.getText().length() > 0;
if (hasProfileName) {
contactBubbleNumTxt.setVisibility(View.VISIBLE);
@@ -503,8 +501,13 @@
contactBubbleTxt.setText(username);
}
- if (firstShow) {
- mPulseAnimation.startRippleAnimation();
+ if (firstUpdate) {
+ firstUpdate = false;
+
+ Glide.with(getActivity())
+ .load(contactPicture)
+ .apply(glideOptions)
+ .into(contactBubbleView);
}
});
}
@@ -546,6 +549,8 @@
@Override
public void initNormalStateDisplay(final boolean audioOnly) {
getActivity().runOnUiThread(() -> {
+ shapeRipple.stopRipple();
+
acceptButton.setVisibility(View.GONE);
refuseButton.setVisibility(View.GONE);
hangupButton.setVisibility(View.VISIBLE);