Skip to content

Instantly share code, notes, and snippets.

/** filling the area under the path */
val fillPath = android.graphics.Path(stroke.asAndroidPath())
.asComposePath()
.apply {
lineTo(xAxisSpace * xValues.last(), size.height - yAxisSpace)
lineTo(xAxisSpace, size.height - yAxisSpace)
close()
}
drawPath(
fillPath,
fun ltrCurve(size: Size) = Path().apply {
reset()
val width = size.width
val height = size.height
val radius = 100f
val upShift = height * (1f - 0.2f)
// arc C1
arcTo(
rect = Rect(
left = 0f,
fun rtlCurve(size: Size) = Path().apply {
reset()
val width = size.width
val height = size.height
val radius = 100f
val upShift = height * (1f - 0.5f)
// arc C1
arcTo(
rect = Rect(
left = 0f,
val loginY = density.run { 510.dp.toPx() }
Box(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
) {
Signup(
modifier = Modifier
.fillMaxWidth()
.height(600.dp)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Text(text = "Hello Saurabh!")
}
runBlocking { // CoroutineScope
Log.e("TAG","starting")
delay(1000) // 1 sec
Log.e("TAG","stopping")
TAG: starting
TAG: stopping
TAG: Printing normally on thread com.aqua30.parallelprocessingcoroutines.MainActivity
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Text(text = "Hello Saurabh!")
}
runBlocking { // CoroutineScope
Log.e("TAG","starting runBlocking")
launch { // CoroutineScope
Log.e("TAG","starting launch block")
TAG: starting runBlocking
TAG: starting launch block
TAG: stopping runBlocking
TAG: stopping launch block
TAG: Printing normally on thread com.aqua30.parallelprocessingcoroutines.MainActivity
launch(Dispatchers.Main) { // CoroutineScope
Log.e("TAG","starting - ${Thread.currentThread().name}")
delay(1000)
Log.e("TAG","stopping - ${Thread.currentThread().name}")
}
launch(Dispatchers.IO) { // CoroutineScope
Log.e("TAG","starting - ${Thread.currentThread().name}")
delay(1000)
Log.e("TAG","stopping - ${Thread.currentThread().name}")
runBlocking {
Log.e("TAG","starting runBlocking")
val job = launch {
Log.e("TAG","starting launch block")
repeat(1000) {
Log.e("TAG","$it")
delay(500)
}
}
delay(2000)