Add RGB overlays

debug-base
Mattia Iavarone 5 years ago
parent 3e0ae65dad
commit 41e3e7c1f5
  1. 16
      demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java
  2. 24
      demo/src/main/res/layout/activity_camera.xml

@ -145,22 +145,6 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis
b.setState(BottomSheetBehavior.STATE_HIDDEN);
}
});
// Animate the watermark just to show we record the animation in video snapshots
ValueAnimator animator = ValueAnimator.ofFloat(1F, 0.8F);
animator.setDuration(300);
animator.setRepeatCount(ValueAnimator.INFINITE);
animator.setRepeatMode(ValueAnimator.REVERSE);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float scale = (float) animation.getAnimatedValue();
watermark.setScaleX(scale);
watermark.setScaleY(scale);
watermark.setRotation(watermark.getRotation() + 2);
}
});
animator.start();
}
private void message(@NonNull String content, boolean important) {

@ -32,15 +32,27 @@
app:cameraAutoFocusMarker="@string/cameraview_default_autofocus_marker">
<!-- Watermark -->
<ImageView
<LinearLayout
android:id="@+id/watermark"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_gravity="bottom|end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:layout_drawOnPreview="true"
app:layout_drawOnVideoSnapshot="true"
app:layout_drawOnPictureSnapshot="true"
android:src="@mipmap/logo_foreground"/>
app:layout_drawOnPictureSnapshot="true">
<ImageView
android:src="#FF0000"
android:layout_width="40dp"
android:layout_height="40dp" />
<ImageView
android:src="#00FF00"
android:layout_width="40dp"
android:layout_height="40dp" />
<ImageView
android:src="#0000FF"
android:layout_width="40dp"
android:layout_height="40dp" />
</LinearLayout>
</com.otaliastudios.cameraview.CameraView>

Loading…
Cancel
Save