Camerax Preview shows half black screen in case of Custom View

585 views
Skip to first unread message
Assigned to xi...@google.com by eri...@google.com

Priyansh Kedia

unread,
Jan 22, 2021, 4:52:14 AM1/22/21
to Android CameraX Discussion Group
I have made a custom CameraX View to handle all CameraX related stuff inside it.

The user can now just add the xml code, and all the handling can be done by itself.

The preview shows half screen as black. The problem is not with the layout, it is something with the implementation of the preview (I guess).

#android-camerax
WhatsApp Image 2021-01-22 at 3.21.39 PM.jpeg
Screenshot from 2021-01-22 15-20-08.png

Julie Wu

unread,
Jan 22, 2021, 4:54:41 AM1/22/21
to Android CameraX Discussion Group, kediap...@gmail.com

Thanks for your feedback. Can you please let us know which library version and which device you're using?

Priyansh Kedia

unread,
Jan 22, 2021, 4:55:39 AM1/22/21
to Android CameraX Discussion Group, wuj...@google.com, Priyansh Kedia
Hello
Thanks for the quick reply

I am using OnePlus 6t 

These are the camerax dependencies I am using

def camerax_version = "1.0.0-beta09"
implementation "androidx.camera:camera-camera2:$camerax_version"
implementation "androidx.camera:camera-lifecycle:$camerax_version"
implementation "androidx.camera:camera-view:1.0.0-alpha16"

Xi Zhang (张熹)

unread,
Jan 23, 2021, 6:38:56 PM1/23/21
to Priyansh Kedia, Android CameraX Discussion Group, wuj...@google.com
Is the issue reproducible on other devices? Could you upgrade your CameraX libraries to the latest version and give it another try? If you are still seeing the issue, could you provide us a code sample? 

Thank you,

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/0a83ebec-4bce-41c5-855b-3b22465259dan%40android.com.

Priyansh Kedia

unread,
Jan 25, 2021, 12:55:26 AM1/25/21
to Android CameraX Discussion Group, Xi Zhang, Android CameraX Discussion Group, wuj...@google.com, Priyansh Kedia
Hello
I have the dependencies updated, but still the problem persists

How should I share the code sample?

Xi Zhang (张熹)

unread,
Jan 25, 2021, 12:33:55 PM1/25/21
to Priyansh Kedia, Android CameraX Discussion Group, wuj...@google.com
Could you try if you can reproduce the issue with CameraXBasic? If not, you can upload a minimal code sample to GitHub.

Also are you able to reproduce the issue with other devices?
Reply all
Reply to author
Forward
0 new messages