Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,97 @@ ReactContextBaseJavaModule(reactContext), CameraMLKitFragment.CameraMLKitCallbac
override fun getName() = "SelfMRZScannerModule"

private var scanPromise: Promise? = null
private var currentContainer: FrameLayout? = null
private var currentFragment: CameraMLKitFragment? = null

@ReactMethod
fun startScanning(promise: Promise) {
scanPromise = promise
val activity = reactApplicationContext.currentActivity as? FragmentActivity ?: return

activity.runOnUiThread {
val container = FrameLayout(activity)
val containerId = View.generateViewId()
container.id = containerId

activity.addContentView(container, ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
))

activity.supportFragmentManager
.beginTransaction()
.replace(containerId, CameraMLKitFragment(this))
.commit()
scanPromise = promise
val activity = reactApplicationContext.currentActivity as? FragmentActivity
if (activity == null) {
promise.reject("E_NO_ACTIVITY", "No FragmentActivity found")
return
}


activity.runOnUiThread {
try {
val container = FrameLayout(activity)
// just using view.generateViewId() doesn't work.
val containerId = generateUnusedId(activity.window.decorView as ViewGroup)
container.id = containerId

container.layoutParams = ViewGroup.LayoutParams(
Comment on lines +44 to +49
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Prevent orphaned overlays on exceptions by storing container early.

If an exception occurs before currentContainer is set, the added view can stick. Set the reference immediately after assigning the ID.

                 val container = FrameLayout(activity)
                 // just using view.generateViewId() doesn't work.
                 val containerId = generateUnusedId(activity.window.decorView as ViewGroup)
                 container.id = containerId
+                // Ensure we can clean up even if later steps fail
+                currentContainer = container
@@
-                // Store references for cleanup
-                currentContainer = container
-                currentFragment = fragment
+                // Store fragment reference for cleanup
+                currentFragment = fragment

Also applies to: 66-68

🤖 Prompt for AI Agents
In
packages/mobile-sdk-alpha/android/src/main/java/com/selfxyz/selfSDK/SelfMRZScannerModule.kt
around lines 44-49 (and also apply the same change at lines ~66-68), the newly
created FrameLayout container is assigned an ID and added to the view hierarchy
but currentContainer isn’t set until later, which can leave an orphaned overlay
if an exception occurs; fix this by assigning currentContainer = container
immediately after setting container.id (before any operations that may throw) so
the reference exists for cleanup, and make the identical change at the other
location mentioned (lines 66-68).

ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)

container.isFocusable = true
container.isFocusableInTouchMode = true
container.setBackgroundColor(android.graphics.Color.BLACK)

activity.addContentView(container, ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
))

val fragment = CameraMLKitFragment(this@SelfMRZScannerModule)

// Store references for cleanup
currentContainer = container
currentFragment = fragment

activity.supportFragmentManager
.beginTransaction()
.replace(containerId, fragment)
.commitNow()

Comment on lines +69 to +73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid commitNow crashes when state is saved; guard and fall back.

commitNow() can throw if FragmentManager state is saved. Use isStateSaved and fall back to commitAllowingStateLoss().

-                activity.supportFragmentManager
-                    .beginTransaction()
-                    .replace(containerId, fragment)
-                    .commitNow()
+                val fm = activity.supportFragmentManager
+                val tx = fm.beginTransaction().replace(containerId, fragment)
+                if (fm.isStateSaved) {
+                    tx.commitAllowingStateLoss()
+                    android.util.Log.w("SelfMRZScannerModule", "Fragment committed with state loss due to saved state")
+                } else {
+                    tx.commitNow()
+                }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
activity.supportFragmentManager
.beginTransaction()
.replace(containerId, fragment)
.commitNow()
val fm = activity.supportFragmentManager
val tx = fm.beginTransaction().replace(containerId, fragment)
if (fm.isStateSaved) {
tx.commitAllowingStateLoss()
android.util.Log.w("SelfMRZScannerModule", "Fragment committed with state loss due to saved state")
} else {
tx.commitNow()
}
🤖 Prompt for AI Agents
In
packages/mobile-sdk-alpha/android/src/main/java/com/selfxyz/selfSDK/SelfMRZScannerModule.kt
around lines 69 to 73, the code calls fragment transactions with commitNow()
which can throw if the FragmentManager state is already saved; change the logic
to check activity.supportFragmentManager.isStateSaved() before committing and,
if true, use commitAllowingStateLoss() (or commitNowAllowingStateLoss() if
immediate behavior is required) as a safe fallback so the app doesn't crash when
state is saved.

} catch (e: Exception) {
android.util.Log.e("SelfMRZScannerModule", "Error in startScanning", e)
promise.reject("E_SCANNING_ERROR", e.message, e)
}
}
}

override fun onPassportRead(mrzInfo: MRZInfo) {
scanPromise?.resolve(mrzInfo.toString())
scanPromise = null
cleanup()
}
Comment on lines 82 to 86
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Don’t return raw MRZ string; minimize/structure PII.

MRZInfo.toString() can expose full passport details to JS/logs. Return a minimal, structured payload with masking.

-        scanPromise?.resolve(mrzInfo.toString())
+        val payload = com.facebook.react.bridge.Arguments.createMap().apply {
+            putString("documentType", mrzInfo.documentCode)
+            putString("issuingState", mrzInfo.issuingState)
+            putString("nationality", mrzInfo.nationality)
+            putString("documentNumberMasked", mrzInfo.documentNumber?.let { maskDoc(it) })
+            // Add more fields only if strictly required; avoid full MRZ dump.
+        }
+        scanPromise?.resolve(payload)

Add alongside the class (helper):

private fun maskDoc(v: String): String =
    if (v.length <= 3) "***" else "*".repeat(v.length - 3) + v.takeLast(3)

If JS currently expects a string, consider a temporary dual-path (behind a debug flag) or bumping the API contract with a clear migration note.


override fun onError(e: Exception) {
scanPromise?.reject(e)
scanPromise = null
cleanup()
}
Comment on lines 53 to +92
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Use explicit error code for JS contract consistency.

Promise.reject(e) yields unspecified codes; standardize to a named code to allow JS to handle reliably.

-    override fun onError(e: Exception) {
-        scanPromise?.reject(e)
+    override fun onError(e: Exception) {
+        scanPromise?.reject("E_MRZ_SCAN_ERROR", e.message, e)
         scanPromise = null
         cleanup()
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
override fun onError(e: Exception) {
scanPromise?.reject(e)
scanPromise = null
cleanup()
}
override fun onError(e: Exception) {
scanPromise?.reject("E_MRZ_SCAN_ERROR", e.message, e)
scanPromise = null
cleanup()
}
🤖 Prompt for AI Agents
In
packages/mobile-sdk-alpha/android/src/main/java/com/selfxyz/selfSDK/SelfMRZScannerModule.kt
around lines 88 to 92, the onError currently calls scanPromise?.reject(e) which
yields unspecified error codes to JS; change it to reject with an explicit
string error code (e.g. "SCAN_ERROR"), pass the exception message as the second
parameter, and include the original exception as the throwable/third parameter
so JS receives a stable code, readable message, and the underlying exception;
keep the subsequent scanPromise = null and cleanup() calls unchanged.


private fun generateUnusedId(root: ViewGroup): Int {
var id: Int
do { id = View.generateViewId() } while (root.findViewById<View>(id) != null)
return id
}

private fun cleanup() {
val activity = reactApplicationContext.currentActivity as? FragmentActivity
if (activity != null && currentFragment != null && currentContainer != null) {
activity.runOnUiThread {
try {
activity.supportFragmentManager
.beginTransaction()
.remove(currentFragment!!)
.commitNow()

val parent = currentContainer!!.parent as? ViewGroup
parent?.removeView(currentContainer)

android.util.Log.d("SelfMRZScannerModule", "Cleaned up fragment and container")
} catch (e: Exception) {
android.util.Log.e("SelfMRZScannerModule", "Error during cleanup", e)
}

currentFragment = null
currentContainer = null
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class SelfOCRViewManager(

override fun getName() = REACT_CLASS

override fun createViewInstance(reactContext: ThemedReactContext) =
FrameLayout(reactContext)
override fun createViewInstance(reactContext: ThemedReactContext): FrameLayout {
return FrameLayout(reactContext)
}

override fun getCommandsMap() = mapOf(
"create" to COMMAND_CREATE,
Expand All @@ -45,9 +46,38 @@ class SelfOCRViewManager(
super.receiveCommand(root, commandId, args)
val reactNativeViewId = requireNotNull(args).getInt(0)

when (commandId.toInt()) {
COMMAND_CREATE -> createFragment(root, reactNativeViewId)
COMMAND_DESTROY -> destroyFragment(root, reactNativeViewId)
when (commandId) {
"create" -> {
createFragment(root, reactNativeViewId)
}
"destroy" -> {
destroyFragment(root, reactNativeViewId)
}
else -> {
android.util.Log.w("SelfOCRViewManager", "Unknown command: $commandId")
}
}
}

// Alternative method signature for newer React Native versions
override fun receiveCommand(
root: FrameLayout,
commandId: Int,
args: ReadableArray?
) {
super.receiveCommand(root, commandId, args)
val reactNativeViewId = requireNotNull(args).getInt(0)

when (commandId) {
COMMAND_CREATE -> {
createFragment(root, reactNativeViewId)
}
COMMAND_DESTROY -> {
destroyFragment(root, reactNativeViewId)
}
else -> {
android.util.Log.w("SelfOCRViewManager", "Unknown command: $commandId")
}
}
}

Expand All @@ -57,18 +87,51 @@ class SelfOCRViewManager(
if (index == 1) propHeight = value
}

// @ReactProp(name = "width")
// fun setWidth(view: FrameLayout, width: Int) {
// propWidth = width
// }

// @ReactProp(name = "height")
// fun setHeight(view: FrameLayout, height: Int) {
// propHeight = height
// }

private fun createFragment(root: FrameLayout, reactNativeViewId: Int) {
this.reactNativeViewId = reactNativeViewId
val parentView = root.findViewById<ViewGroup>(reactNativeViewId)
setupLayout(parentView)

val activity = reactContext.currentActivity as? FragmentActivity
if (activity == null) {
android.util.Log.e("SelfOCRViewManager", "No FragmentActivity found")
return
}

// Check if activity is in a valid state
if (activity.isFinishing || activity.isDestroyed) {
android.util.Log.e("SelfOCRViewManager", "Activity is finishing or destroyed")
return
}

Comment on lines +119 to +130
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Null-check container before layout; bail early if missing

root.findViewById may return null; setupLayout(parentView) will then NPE and the subsequent fragment transaction will still run, risking IllegalArgumentException on replace().

-        val parentView = root.findViewById<ViewGroup>(reactNativeViewId)
-        setupLayout(parentView)
+        val parentView = root.findViewById<ViewGroup?>(reactNativeViewId)
+        if (parentView == null) {
+            android.util.Log.e("SelfOCRViewManager", "Container view $reactNativeViewId not found in root")
+            return
+        }
+        setupLayout(parentView)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val activity = reactContext.currentActivity as? FragmentActivity
if (activity == null) {
android.util.Log.e("SelfOCRViewManager", "No FragmentActivity found")
return
}
// Check if activity is in a valid state
if (activity.isFinishing || activity.isDestroyed) {
android.util.Log.e("SelfOCRViewManager", "Activity is finishing or destroyed")
return
}
val activity = reactContext.currentActivity as? FragmentActivity
if (activity == null) {
android.util.Log.e("SelfOCRViewManager", "No FragmentActivity found")
return
}
// Check if activity is in a valid state
if (activity.isFinishing || activity.isDestroyed) {
android.util.Log.e("SelfOCRViewManager", "Activity is finishing or destroyed")
return
}
val parentView = root.findViewById<ViewGroup?>(reactNativeViewId)
if (parentView == null) {
android.util.Log.e("SelfOCRViewManager", "Container view $reactNativeViewId not found in root")
return
}
setupLayout(parentView)
🤖 Prompt for AI Agents
In
packages/mobile-sdk-alpha/android/src/main/java/com/selfxyz/selfSDK/SelfOCRViewManager.kt
around lines 105 to 116, root.findViewById can return null so
setupLayout(parentView) may NPE and the fragment transaction could still run;
check the parentView returned by findViewById and if it's null log an error and
return early before calling setupLayout or performing any fragment transaction
so you don't attempt to replace a fragment into a null container.

val cameraFragment = CameraMLKitFragment(this)
// val cameraFragment = MyFragment()
val activity = reactContext.currentActivity as FragmentActivity
activity.supportFragmentManager
.beginTransaction()
.replace(reactNativeViewId, cameraFragment, reactNativeViewId.toString())
.commit()
android.util.Log.d("SelfOCRViewManager", "Starting fragment transaction")

// Post to ensure activity is fully ready
activity.window.decorView.post {
try {
if (!activity.isFinishing && !activity.isDestroyed) {
activity.supportFragmentManager
.beginTransaction()
.replace(reactNativeViewId, cameraFragment, reactNativeViewId.toString())
.commitNow()
} else {
android.util.Log.e("SelfOCRViewManager", "Activity no longer valid for fragment transaction")
}
} catch (e: Exception) {
android.util.Log.e("SelfOCRViewManager", "Fragment transaction failed", e)
}
}
Comment on lines +132 to +148
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid commitNow after state save; check isStateSaved and use reordering

commitNow() can throw IllegalStateException if state is saved. Check FragmentManager.isStateSaved and prefer commit() with setReorderingAllowed(true).

-        activity.window.decorView.post {
-            try {
-                if (!activity.isFinishing && !activity.isDestroyed) {
-                    activity.supportFragmentManager
-                        .beginTransaction()
-                        .replace(reactNativeViewId, cameraFragment, reactNativeViewId.toString())
-                        .commitNow()
-                } else {
-                    android.util.Log.e("SelfOCRViewManager", "Activity no longer valid for fragment transaction")
-                }
-            } catch (e: Exception) {
-                android.util.Log.e("SelfOCRViewManager", "Fragment transaction failed", e)
-            }
-        }
+        activity.window.decorView.post {
+            try {
+                if (!activity.isFinishing && !activity.isDestroyed) {
+                    val fm = activity.supportFragmentManager
+                    if (!fm.isStateSaved) {
+                        fm.beginTransaction()
+                            .setReorderingAllowed(true)
+                            .replace(reactNativeViewId, cameraFragment, reactNativeViewId.toString())
+                            .commit()
+                    } else {
+                        android.util.Log.w("SelfOCRViewManager", "FragmentManager state saved; aborting create for $reactNativeViewId")
+                    }
+                } else {
+                    android.util.Log.e("SelfOCRViewManager", "Activity no longer valid for fragment transaction")
+                }
+            } catch (e: Exception) {
+                android.util.Log.e("SelfOCRViewManager", "Fragment transaction failed", e)
+            }
+        }
🤖 Prompt for AI Agents
In
packages/mobile-sdk-alpha/android/src/main/java/com/selfxyz/selfSDK/SelfOCRViewManager.kt
around lines 132 to 148, the code uses supportFragmentManager.commitNow which
can throw if the FragmentManager state is saved; instead check
activity.supportFragmentManager.isStateSaved before committing and if state is
saved skip or defer the transaction, otherwise perform a normal asynchronous
transaction using
beginTransaction().setReorderingAllowed(true).replace(...).commit() (not
commitNow) so the transaction is safe across saved state and respects
reordering.

}

private fun destroyFragment(root: FrameLayout, reactNativeViewId: Int) {
Expand Down Expand Up @@ -97,8 +160,8 @@ class SelfOCRViewManager(

private fun manuallyLayoutChildren(view: View) {
// propWidth and propHeight coming from react-native props
val width = requireNotNull(propWidth)
val height = requireNotNull(propHeight)
val width = propWidth ?: 800 // Default fallback
val height = propHeight ?: 800 // Default fallback

Comment on lines +177 to 179
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Default 800x800 sizing may fight RN layout and cause over/under-sizing

Hard defaults in native (px) can conflict with RN dp sizing, especially since RCTFragment passes PixelRatio.getPixelSizeForLayoutSize(800) on the JS side. Consider deriving from view.measuredWidth/Height when available, falling back only if zero.

-        val width = propWidth ?: 800 // Default fallback
-        val height = propHeight ?: 800 // Default fallback
+        val measuredW = if (view.measuredWidth > 0) view.measuredWidth else null
+        val measuredH = if (view.measuredHeight > 0) view.measuredHeight else null
+        val width = propWidth ?: measuredW ?: 800
+        val height = propHeight ?: measuredH ?: 800
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val width = propWidth ?: 800 // Default fallback
val height = propHeight ?: 800 // Default fallback
val measuredW = if (view.measuredWidth > 0) view.measuredWidth else null
val measuredH = if (view.measuredHeight > 0) view.measuredHeight else null
val width = propWidth ?: measuredW ?: 800
val height = propHeight ?: measuredH ?: 800
🤖 Prompt for AI Agents
In
packages/mobile-sdk-alpha/android/src/main/java/com/selfxyz/selfSDK/SelfOCRViewManager.kt
around lines 163-165, the code currently hard-sets width/height to 800 which can
conflict with React Native layout; change the logic to use propWidth/propHeight
if provided, otherwise use the view's measuredWidth/measuredHeight when > 0, and
only fall back to the hard default (e.g., 800) if both prop and measured values
are zero; ensure the values are treated as pixels and, if necessary, convert
from DP to pixels consistently with RN before using them.

view.measure(
View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ abstract class CameraFragment : androidx.fragment.app.Fragment(), ActivityCompat
buildCamera(cameraPreview!!, initialLensPosition)

hasCameraPermission = hasCameraPermission()
if (hasCameraPermission) {
if (!hasCameraPermission) {
checkPermissions(requestedPermissions)
} else {
fotoapparat?.start()
Expand All @@ -157,7 +157,7 @@ abstract class CameraFragment : androidx.fragment.app.Fragment(), ActivityCompat

override fun onPause() {
hasCameraPermission = hasCameraPermission()
if (!hasCameraPermission) {
if (hasCameraPermission) {
fotoapparat?.stop()
}
fotoapparat = null;
Expand Down Expand Up @@ -246,7 +246,8 @@ abstract class CameraFragment : androidx.fragment.app.Fragment(), ActivityCompat
////////////////////////////////////////////////////////////////////////////////////////

protected fun hasCameraPermission(): Boolean {
return ContextCompat.checkSelfPermission(context!!, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED
val hasPermission = ContextCompat.checkSelfPermission(context!!, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED
return hasPermission
}
Comment on lines 248 to 251
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid context!! in permission check (potential NPE)

Using context!! can crash if the Fragment is detached. Prefer requireContext() only when you truly want to throw, or gracefully handle null.

-    protected fun hasCameraPermission(): Boolean {
-        val hasPermission = ContextCompat.checkSelfPermission(context!!, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED
-        return hasPermission
-    }
+    protected fun hasCameraPermission(): Boolean {
+        val ctx = context ?: return false
+        return ContextCompat.checkSelfPermission(ctx, Manifest.permission.CAMERA) ==
+            PackageManager.PERMISSION_GRANTED
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
protected fun hasCameraPermission(): Boolean {
return ContextCompat.checkSelfPermission(context!!, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED
val hasPermission = ContextCompat.checkSelfPermission(context!!, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED
return hasPermission
}
protected fun hasCameraPermission(): Boolean {
val ctx = context ?: return false
return ContextCompat.checkSelfPermission(ctx, Manifest.permission.CAMERA) ==
PackageManager.PERMISSION_GRANTED
}
🤖 Prompt for AI Agents
In
packages/mobile-sdk-alpha/android/src/main/java/com/selfxyz/selfSDK/ui/CameraFragment.kt
around lines 248–251, the permission check uses context!! which can throw an NPE
if the Fragment is detached; replace the forced unwrap with a safe check: either
use requireContext() if you intend to throw when context is missing, or
preferably use a nullable-safe form (e.g., context?.let {
ContextCompat.checkSelfPermission(it, Manifest.permission.CAMERA) ==
PackageManager.PERMISSION_GRANTED } ?: false) so the method returns false when
context is null.


protected fun checkPermissions(permissions: ArrayList<String> = ArrayList()) {
Expand Down
71 changes: 0 additions & 71 deletions packages/mobile-sdk-alpha/android/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,75 +21,4 @@
</style>


<style name="Text">

</style>

<style name="Text.SubHead">
<item name="android:textSize">@dimen/text_size_medium</item>
<item name="android:fontFamily">@font/regular</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="Text.SubHead.Light" parent="Text.SubHead">
<item name="android:textColor">@color/white</item>
<item name="android:fontFamily">@font/bold</item>
</style>

<style name="Text.Body3">
<item name="android:fontFamily">@font/regular</item>
<item name="android:textSize">@dimen/text_size_small</item>
<item name="android:textColor">@color/grey_mid</item>
<item name="android:lineSpacingExtra">0sp</item>
</style>
<style name="Text.Body3.Light" parent="Text.Body3">
<item name="android:textColor">@color/white</item>
</style>

<style name="Text.Body3.Light.Bold" parent="Text.Body3.Light">
<item name="android:fontFamily">@font/bold</item>
</style>

<style name="CardViewStyle">
<item name="cardBackgroundColor">@color/white</item>
<item name="cardCornerRadius">0dp</item>
<item name="android:layout_marginLeft">@dimen/margin_none</item>
<item name="android:layout_marginRight">@dimen/margin_none</item>
<item name="android:elevation">2dp</item>
</style>

<style name="ToggleButtonText">
<item name="android:textSize">@dimen/text_size_default</item>
<item name="android:fontFamily">@font/medium</item>
</style>
<style name="ToogleButton" parent="@android:style/Widget.CompoundButton.RadioButton">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">match_parent</item>
<item name="android:padding">@dimen/toggle_padding</item>
<item name="android:layout_marginTop">@dimen/tiny_margin</item>
<item name="android:layout_marginBottom">@dimen/tiny_margin</item>
<item name="android:textAppearance">@style/ToggleButtonText</item>
<item name="android:textAllCaps">true</item>
<item name="android:textColor">@color/colorPrimary</item>
<item name="android:button">@null</item>
<item name="android:gravity">center</item>
<item name="android:layout_weight">1</item>
</style>
<style name="ToogleButton.Left">
<item name="android:background">@drawable/toggle_background_left</item>
</style>
<style name="ToogleButton.Right">
<item name="android:background">@drawable/toggle_background_right</item>
</style>
<style name="ToogleGroup">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/toggle_height</item>
<item name="android:background">@drawable/toggle_background_border</item>
</style>

<style name="InputLabel" parent="TextAppearance.AppCompat.Small">
<item name="android:paddingBottom">@dimen/input_label_padding_bottom</item>
<item name="android:paddingLeft">@dimen/input_label_horizontal_spacing</item>
<item name="android:paddingRight">@dimen/input_label_horizontal_spacing</item>
</style>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const MRZScannerView: React.FC<MRZScannerViewProps> = ({
<View style={containerStyle}>
<RCTFragment
RCTFragmentViewManager={NativeMRZScannerView as any}
fragmentComponentName="PassportOCRViewManager"
fragmentComponentName="SelfOCRViewManager"
isMounted={true}
style={{
height: PixelRatio.getPixelSizeForLayoutSize(800),
Expand Down
Loading