chore: Cleanup Android codebase (#2415)

This commit is contained in:
Marc Rousavy
2024-01-18 18:55:49 +01:00
committed by GitHub
parent 5c5d629936
commit bae1f52d4a
7 changed files with 16 additions and 33 deletions

View File

@@ -1,27 +0,0 @@
package com.mrousavy.camera.extensions
import android.hardware.camera2.params.DynamicRangeProfiles
import android.os.Build
import androidx.annotation.RequiresApi
private fun Set<Long>.firstMatch(filter: Set<Long>): Long? {
filter.forEach { f ->
if (this.contains(f)) {
return f
}
}
return null
}
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
private val bestProfiles = setOf(
DynamicRangeProfiles.HDR10_PLUS,
DynamicRangeProfiles.HDR10,
DynamicRangeProfiles.HLG10
)
val DynamicRangeProfiles.bestProfile: Long?
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
get() {
return supportedProfiles.firstMatch(bestProfiles)
}

View File

@@ -1,3 +0,0 @@
package com.mrousavy.camera.extensions
fun <T> List<T>.containsAny(elements: List<T>): Boolean = elements.any { element -> this.contains(element) }