Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 600dcaf9 authored by Aurimas Liutikas's avatar Aurimas Liutikas Committed by Gerrit Code Review
Browse files

Merge "Fix incompatibilities with Kotlin 1.5.0"

parents 565f3fe5 b8ca1157
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ class ControlsUiControllerImpl @Inject constructor (
    private val onSeedingComplete = Consumer<Boolean> {
        accepted ->
            if (accepted) {
                selectedStructure = controlsController.get().getFavorites().maxBy {
                selectedStructure = controlsController.get().getFavorites().maxByOrNull {
                    it.controls.size
                } ?: EMPTY_STRUCTURE
                updatePreferences(selectedStructure)
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class PrivacyChipBuilder(private val context: Context, itemsList: List<PrivacyIt
        appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType })
                .toList()
                .sortedWith(compareBy({ -it.second.size }, // Sort by number of AppOps
                        { it.second.min() })) // Sort by "smallest" AppOpp (Location is largest)
                        { it.second.minOrNull() })) // Sort by "smallest" AppOpp (Location is largest)
        types = itemsList.map { it.privacyType }.distinct().sorted()
    }

+2 −2
Original line number Diff line number Diff line
@@ -43,8 +43,8 @@ inline infix fun Int.times(action: () -> Unit) {
 * cccc dd
 */
fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String {
    val col1w = map { (a, _) -> a.length }.max()!!
    val col2w = map { (_, b) -> b.length }.max()!!
    val col1w = map { (a, _) -> a.length }.maxOrNull()!!
    val col2w = map { (_, b) -> b.length }.maxOrNull()!!
    return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n")
}