Devops: KTLint to lint Kotlin code (#6)
* Adds KTLint as a GitHub action * Adds KTLint to the gradle project for IDE integration * Adds .editorconfig to configure KTLint (android/)
This commit is contained in:
@@ -6,10 +6,10 @@ 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
|
||||
}
|
||||
return when (lensFacing) {
|
||||
CameraCharacteristics.LENS_FACING_BACK -> "back"
|
||||
CameraCharacteristics.LENS_FACING_FRONT -> "front"
|
||||
CameraCharacteristics.LENS_FACING_EXTERNAL -> "external"
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@ import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
val Size.bigger: Int
|
||||
get() = max(this.width, this.height)
|
||||
get() = max(this.width, this.height)
|
||||
val Size.smaller: Int
|
||||
get() = min(this.width, this.height)
|
||||
get() = min(this.width, this.height)
|
||||
|
||||
val SizeF.bigger: Float
|
||||
get() = max(this.width, this.height)
|
||||
get() = max(this.width, this.height)
|
||||
val SizeF.smaller: Float
|
||||
get() = min(this.width, this.height)
|
||||
get() = min(this.width, this.height)
|
||||
|
||||
fun areUltimatelyEqual(size1: Size, size2: Size): Boolean {
|
||||
return size1.width * size1.height == size2.width * size2.height
|
||||
return size1.width * size1.height == size2.width * size2.height
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user