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
| /** 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, |
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
| 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, |
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
| 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, |
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 loginY = density.run { 510.dp.toPx() } | |
| Box( | |
| modifier = Modifier | |
| .fillMaxSize() | |
| .padding(16.dp), | |
| ) { | |
| Signup( | |
| modifier = Modifier | |
| .fillMaxWidth() | |
| .height(600.dp) |
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
| 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") |
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
| TAG: starting | |
| TAG: stopping | |
| TAG: Printing normally on thread com.aqua30.parallelprocessingcoroutines.MainActivity |
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
| 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") |
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
| TAG: starting runBlocking | |
| TAG: starting launch block | |
| TAG: stopping runBlocking | |
| TAG: stopping launch block | |
| TAG: Printing normally on thread com.aqua30.parallelprocessingcoroutines.MainActivity |
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
| 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}") |
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
| 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) |