This file contains hidden or 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
private const val MAX_SPEED = 25 | |
private const val MIN_SPEED = 7 | |
private const val MAX_FONT_SIZE = 64f | |
private const val MIN_FONT_SIZE = 24f | |
private val characters = listOf("ジ", "ェ", "ッ", "ト", "パ", "ッ", "ク", "構", "成") | |
private val colors = listOf(0xffcefbe4, 0xff81ec72, 0xff5cd646, 0xff54d13c, 0xff4ccc32, 0xff43c728) | |
@Composable | |
fun MatrixText( | |
stripCount: Int = 25, | |
lettersPerStrip: Int = 20, |
This file contains hidden or 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 androidx.compose.animation.animatedFloat | |
import androidx.compose.animation.core.AnimationConstants | |
import androidx.compose.animation.core.LinearEasing | |
import androidx.compose.animation.core.repeatable | |
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.material.MaterialTheme | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.onActive | |
import androidx.compose.ui.Modifier |
This file contains hidden or 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
val miles = 1.kilometers.to(Distance.Mile) | |
val kilometers = 1.miles.to(Distance.Kilometer) | |
val total = 2.kilometers + 1.miles + 10.meters + 1.centimeter + 1.millimeter | |
Log.d("MainActivity", "Total distance is ${total.meters.amount} meters") | |
val totalTime = 2.hours + 2.minutes + 2.seconds + 2.milliseconds | |
Log.d("MainActivity", "Total time is ${totalTime.amount} ${totalTime.unit}") |
This file contains hidden or 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
let nArray : NSArray = ["1", "2", "3"] | |
nArray.enumerateObjectsUsingBlock {(obj, index, stop) in | |
println("Object \(obj) Index \(index)") | |
if index == 1 { | |
stop.withUnsafePointer { $0.memory = true } | |
} | |
} |