react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

❓ Camera View not show in Full Screen

Open DhrupalGajjar opened this issue 2 years ago • 8 comments

Question

How to show camera in full screen in android in Every Device in some device it's not show in full screen leave space Right or Bottom Side Please Give suggestion for this it's look like this 85062fa8-ea2f-427f-a804-8cf14191755e Any solution to resolve it?

What I tried

I tried "flex:1" in styles as well as "StyleSheet Absolute Fill" and "height width 100%" and also remove parent view also

VisionCamera Version

2.13.3

Additional information

DhrupalGajjar avatar Jun 09 '22 02:06 DhrupalGajjar

Hey, never seen that issue before - but it looks like a layout issue. Does it work if you replace the <Camera> with a normal <View> and give it a background color?

mrousavy avatar Jun 13 '22 08:06 mrousavy

@mrousavy i have the same issue on android and yes it work when replace <Camera> with normal <View>

hebamoustafa avatar Jul 09 '22 12:07 hebamoustafa

I got this issues

truongngodang avatar Jul 20 '22 02:07 truongngodang

@truongngodang any solution?

DevZatokio avatar Aug 22 '22 20:08 DevZatokio

Yes. Send me your android manifest file source code I will let you know

DhrupalGajjar avatar Aug 23 '22 05:08 DhrupalGajjar

Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx">

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

  <uses-permission android:name="android.permission.CAMERA" />
  <!-- optionally, if you want to record audio: -->
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <!-- storage -->
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


  <application android:requestLegacyExternalStorage="true" android:largeHeap="true" android:hardwareAccelerated="false" android:usesCleartextTraffic="true" android:allowBackup="false" android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/AppTheme">
    <!-- facebook -->
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
    <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token" />
    <activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" />
    <activity android:name="com.facebook.CustomTabActivity" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/fb_login_protocol_scheme" />
      </intent-filter>
    </activity>
    <!-- end facebook -->
    <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <!-- maps sdk -->
    <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/maps_sdk" />
  </application>
</manifest>

DevZatokio avatar Aug 23 '22 12:08 DevZatokio

Manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx">

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

  <uses-permission android:name="android.permission.CAMERA" />
  <!-- optionally, if you want to record audio: -->
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <!-- storage -->
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


  <application android:requestLegacyExternalStorage="true" android:largeHeap="true" android:hardwareAccelerated="false" android:usesCleartextTraffic="true" android:allowBackup="false" android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/AppTheme">
    <!-- facebook -->
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />
    <meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token" />
    <activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" />
    <activity android:name="com.facebook.CustomTabActivity" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/fb_login_protocol_scheme" />
      </intent-filter>
    </activity>
    <!-- end facebook -->
    <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <!-- maps sdk -->
    <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/maps_sdk" />
  </application>
</manifest>

you need to remove android:hardwareAccelerated="false" from this file then after it's working perfectly in my app I hope this solution also work for you.

DhrupalGajjar avatar Aug 23 '22 14:08 DhrupalGajjar

I tried this way, its worked. thank you.

truongngodang avatar Aug 26 '22 03:08 truongngodang

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.

mrousavy avatar Sep 30 '23 09:09 mrousavy