Add Android

This commit is contained in:
Marc Rousavy
2021-02-19 16:28:14 +01:00
parent 00c8970366
commit 4d42be6436
28 changed files with 1742 additions and 29 deletions

View File

@@ -0,0 +1,15 @@
package com.cuvent.experiences.friends.camera.parsers
import android.hardware.camera2.CameraCharacteristics
/**
* Parses Lens Facing int to a string representation useable for the TypeScript types.
*/
fun parseLensFacing(lensFacing: Int?): String? {
return when (lensFacing) {
CameraCharacteristics.LENS_FACING_BACK -> "back"
CameraCharacteristics.LENS_FACING_FRONT -> "front"
CameraCharacteristics.LENS_FACING_EXTERNAL -> "external"
else -> null
}
}

View File

@@ -0,0 +1,21 @@
package com.cuvent.experiences.friends.camera.parsers
import android.util.Size
import android.util.SizeF
import com.reactnativenavigation.options.params.Bool
import kotlin.math.max
import kotlin.math.min
val Size.bigger: Int
get() = max(this.width, this.height)
val Size.smaller: Int
get() = min(this.width, this.height)
val SizeF.bigger: Float
get() = max(this.width, this.height)
val SizeF.smaller: Float
get() = min(this.width, this.height)
fun areUltimatelyEqual(size1: Size, size2: Size): Boolean {
return size1.width * size1.height == size2.width * size2.height
}