googlesamples / android-vision

Deprecated: The Mobile Vision API is now a part of ML Kit: Check out this repo:
https://github.com/firebase/quickstart-android/tree/master/mlkit
Apache License 2.0
2.93k stars 1.73k forks source link

Black Screen on CameraSourcePreview #355

Open krthk123 opened 6 years ago

krthk123 commented 6 years ago

I'm trying to change the visibility on CameraSourcePreview and a black screen appears for about 3-4 seconds when View.GONE is called. Appreciate any leads on this. I have tried Samsung Galaxy s7, Nexus 6P and Google Pixel2.

mingsayz commented 4 years ago

Have you solved it?

abdulmanum commented 4 years ago

I'm trying to change the visibility on CameraSourcePreview and a black screen appears for about 3-4 seconds when View.GONE is called. Appreciate any leads on this. I have tried Samsung Galaxy s7, Nexus 6P and Google Pixel2.

i solve it. you need to write your own package name. like this in ocr_capture.xml file : <com.packagename.ui.CameraSourcePreview and also change this tag <com.packagename.ui.GraphicOverlay e.g: In my case package name is : com.fastapk.textrecognition so files become <com.fastapk.textrecognition.ui.CameraSourcePreview android:id="@+id/preview" android:layout_width="match_parent" android:layout_height="match_parent">

    <com.fastapk.textrecognition.ui.GraphicOverlay
        android:id="@+id/graphicOverlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.fastapk.textrecognition.ui.CameraSourcePreview>
abdulmanum commented 4 years ago

Have you solved it?

yes i solved it check it. i solve it. you need to write your own package name. like this in ocr_capture.xml file : <com.packagename.ui.CameraSourcePreview and also change this tag <com.packagename.ui.GraphicOverlay e.g: In my case package name is : com.fastapk.textrecognition so files become <com.fastapk.textrecognition.ui.CameraSourcePreview android:id="@+id/preview" android:layout_width="match_parent" android:layout_height="match_parent">

<com.fastapk.textrecognition.ui.GraphicOverlay
    android:id="@+id/graphicOverlay"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

</com.fastapk.textrecognition.ui.CameraSourcePreview>