This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reads "One" -> "Two" -> "Three" | |
Row(modifier = Modifier.semantics(mergeDescendants = false) { }) { | |
Text("One") | |
Column { | |
Text("Two") | |
Text("Three") | |
} | |
} | |
// Reads "One Two Three" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `this test fails`() = runTest { | |
val number = (0..2).asFlow() | |
val intro = listOf("Hello").asFlow() | |
val combined = combine(intro, number) { first, second -> | |
"$first $second" | |
} | |
combined.test { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlin.random.Random | |
val myInt = Random.nextInt() | |
val myBool = Random.nextBoolean() | |
// Expression - Exhaustive Required | |
val result = when(myInt) { | |
1 -> "I'm #1!" | |
else -> "I'm something else" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dladukedev.themetest.ui.theme | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.size | |
import androidx.compose.material3.Text | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Alignment | |
import androidx.compose.ui.Modifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dladukedev.semanticsmatchertest | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.material3.Text | |
import androidx.compose.ui.test.assertCountEquals | |
import androidx.compose.ui.test.hasAnyAncestor | |
import androidx.compose.ui.test.hasText | |
import androidx.compose.ui.test.isDialog | |
import androidx.compose.ui.test.isRoot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun procedural() { | |
val numbers = (1..10).shuffled().toMutableList() | |
// Remove Even Numbers | |
var index = 0 | |
while(index < numbers.count()) { | |
if(numbers[index] % 2 == 0) { | |
numbers.removeAt(index) | |
} else { | |
index += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dladukedev.alignment | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.layout.size | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.CompositionLocalProvider | |
import androidx.compose.ui.AbsoluteAlignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dladukedev.passiveui | |
import android.util.Log | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.material3.Checkbox | |
import androidx.compose.material3.Text | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.LaunchedEffect | |
import androidx.compose.runtime.getValue | |
import androidx.compose.runtime.mutableStateOf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class AdditionClass(val str: String, val num: Int) { | |
fun add(addStr: String): String { | |
return str + addStr | |
} | |
fun add(addNum: Int): Int { | |
return num + addNum | |
} | |
} | |
OlderNewer