1

I tried making the preview match parent and tried the fill but I cannot make it work. There is a large grey line to the right of the screen

Darian B
  • 317
  • 2
  • 3
  • 15

2 Answers2

3

I had the same problem. The solution from @Mindshifter worked for me, but you can have a look here for more comments (and I've posted a similar solution there too):

https://github.com/googlesamples/android-vision/issues/23

mmagician
  • 1,970
  • 2
  • 15
  • 26
2

In CameraSourcePreview.java comment this lines of code:

    if (childHeight > layoutHeight) {
        childHeight = layoutHeight;
        childWidth = (int)(((float) layoutHeight / (float) height) * width);
    }