qreader icon indicating copy to clipboard operation
qreader copied to clipboard

Add feature to TextureView

Open sanchan opened this issue 8 years ago • 6 comments

It would be great to add support for TextureView to be able to do this:

myTexture = (TextureView) findViewById(R.id.textureView);
myTexture.setSurfaceTextureListener(mSurfaceTextureListener);
// ...
QREader.getInstance().init(this, myTexture);

Why? Because for a better integration with the Camera2 API, it's recommended to use a TextureView, because:

Unlike SurfaceView, TextureView does not create a separate window but behaves as a regular View. This key difference allows a TextureView to be moved, transformed, animated, etc.

References:

https://developer.android.com/reference/android/hardware/camera2/package-summary.html https://developer.android.com/reference/android/view/TextureView.html

Thanks for the good work!

sanchan avatar May 18 '16 18:05 sanchan

I will look into this in the weekend.

Thank you :)

nisrulz avatar May 19 '16 03:05 nisrulz

Oh! Thanks to you! I was trying to do it by myself, and then send you a pull request but I'm completely junior with Android (I'm working on my second project), sorry :(

So, thanks sir! :)

sanchan avatar May 19 '16 13:05 sanchan

+1

Shusshu avatar Oct 18 '16 08:10 Shusshu

Hi @nisrulz , any news in this topic?

Thanks a lot.

matteotan avatar Dec 12 '16 11:12 matteotan

Haven't worked on the TextureView Integration part as of yet, any PR would be welcome. Otherwise I would try to push it out in the next release.

nisrulz avatar Dec 12 '16 12:12 nisrulz

Since QREader uses (and simplifies) Google Vision API to read QR Codes, it made sense to use what they use i.e SurfaceView. However its technically possible to use Texture View as per this issue.

nisrulz avatar Dec 15 '16 09:12 nisrulz