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
| /* | |
| * Copyright 2026 Kyriakos Georgiopoulos | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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
| @Stable | |
| data class Particle( | |
| val id: Int, // stable key | |
| val type: MutableState<RPS>, | |
| val x: MutableState<Float>, | |
| val y: MutableState<Float>, | |
| val dx: MutableState<Float>, | |
| val dy: MutableState<Float> | |
| ) |
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
| enum class CellType { | |
| Space, Wall | |
| } | |
| data class MazeTile(val x: Int, val y: Int, var type: CellType = CellType.Wall) | |
| @RequiresApi(Build.VERSION_CODES.VANILLA_ICE_CREAM) | |
| class Maze(private val width: Int, private val height: Int) { | |
| val maze: Array<Array<MazeTile>> = Array(height) { y -> | |
| Array(width) { x -> MazeTile(x, y) } |
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
| @Composable | |
| fun AnimatedTextSwitcher() { | |
| var isYellowBoxVisibility by remember { mutableStateOf(true) } | |
| LaunchedEffect(Unit) { | |
| while (true) { | |
| delay(3000) | |
| isYellowBoxVisibility = !isYellowBoxVisibility | |
| } | |
| } |
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
| @Composable | |
| private fun MainContent( | |
| changeSystemBarStyle: (SystemBarStyle) -> Unit | |
| ) { | |
| Scaffold( | |
| modifier = Modifier.fillMaxSize(), | |
| containerColor = Color.Black | |
| ) { paddingValues -> | |
| LaunchedEffect(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
| import androidx.annotation.FloatRange | |
| import androidx.compose.animation.core.Animatable | |
| import androidx.compose.animation.core.LinearOutSlowInEasing | |
| import androidx.compose.animation.core.tween | |
| import androidx.compose.foundation.Canvas | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.padding | |
| import androidx.compose.foundation.layout.requiredSize | |
| import androidx.compose.material3.MaterialTheme | |
| import androidx.compose.material3.Slider |
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
| Apache License | |
| Version 2.0, January 2004 | |
| http://www.apache.org/licenses/ | |
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
| 1. Definitions. | |
| "License" shall mean the terms and conditions for use, reproduction, | |
| and distribution as defined by Sections 1 through 9 of this document. |
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
| class CertificateHelper @Inject constructor(@ApplicationContext context: Context) { | |
| private val applicationContext = context | |
| fun createTrustManagers(): Array<TrustManager> { | |
| val certificateInputStream = applicationContext.resources.openRawResource( | |
| R.raw.test) | |
| val certificateFactory = CertificateFactory.getInstance("X.509") | |
| val certificate = certificateFactory.generateCertificate(certificateInputStream) | |
| val trustManagerFactory = TrustManagerFactory.getInstance( | |
| TrustManagerFactory.getDefaultAlgorithm()) | |
| val keyStore = KeyStore.getInstance(KeyStore.getDefaultType()) |
NewerOlder