Instantly share code, notes, and snippets.
A Native Android developer with a unique twist
Jaseemakhtar
/ CicularRevealMenu.kt
Created
December 5, 2021 04:21
Android Jetpack Compose Custom menu, which align items in circular fashion.
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 CircularRevealMenu( | |
modifier: Modifier, | |
contentPadding: Dp = 16.dp, | |
circleRadius: () -> Float, | |
content: @Composable () -> Unit | |
) { | |
val configuration = LocalConfiguration.current | |
Layout(content = content, modifier = modifier) { children, constraints -> |
ardakazanci
/ CircularMainMenuGroup.kt
Created
January 13, 2024 05:54
Circular Menu Group for jetpack compose
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 MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
enableEdgeToEdge() | |
setContent { | |
CircularMenuGroupTheme { | |
MainMenuCanvas() | |
} | |
} | |
} |
ardakazanci
/ CircularMenuGroup.kt
Created
April 10, 2024 07:33
Circular Menu Group with Jetpack Compose
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 CircularMenuGroup( | |
icons: List<ImageVector>, | |
baseRadius: Float, | |
modifier: Modifier = Modifier, | |
backgroundColor: Color = Color(0xFF21FA90), | |
shadowElevation: Dp = 4.dp | |
) { | |
var selectedIndex by remember { mutableIntStateOf(-1) } | |
var sizeSliderValue by remember { mutableFloatStateOf(1f) } |