generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2496554
commit 0168edf
Showing
4 changed files
with
128 additions
and
109 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
114 changes: 114 additions & 0 deletions
114
src/main/kotlin/com/ivyapps/composehammer/m3content/Layouts.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
package com.ivyapps.composehammer.m3content | ||
|
||
import com.ivyapps.composehammer.domain.ContentScope | ||
import com.ivyapps.composehammer.domain.component | ||
import com.ivyapps.composehammer.domain.group | ||
|
||
fun ContentScope.layouts() = group( | ||
title = "⚡ Layouts", | ||
showInToolWindow = false | ||
) { | ||
component { | ||
showInToolWindow = false | ||
name = "Column" | ||
imports = listOf( | ||
"androidx.compose.ui.Modifier", | ||
"androidx.compose.foundation.layout.Column" | ||
) | ||
code = """ | ||
Column( | ||
modifier = Modifier, | ||
) { | ||
} | ||
""".trimIndent() | ||
} | ||
|
||
component { | ||
showInToolWindow = false | ||
name = "Row" | ||
imports = listOf( | ||
"androidx.compose.ui.Modifier", | ||
"androidx.compose.foundation.layout.Row", | ||
"androidx.compose.ui.Alignment", | ||
) | ||
code = """ | ||
Row( | ||
modifier = Modifier, | ||
verticalAlignment = Alignment.CenterVertically, | ||
) { | ||
} | ||
""".trimIndent() | ||
} | ||
|
||
component { | ||
showInToolWindow = false | ||
name = "Box" | ||
imports = listOf( | ||
"androidx.compose.ui.Modifier", | ||
"androidx.compose.foundation.layout.Box", | ||
"androidx.compose.ui.Alignment", | ||
) | ||
code = """ | ||
Box( | ||
modifier = Modifier, | ||
contentAlignment = Alignment.Center, | ||
) { | ||
} | ||
""".trimIndent() | ||
} | ||
|
||
component { | ||
showInToolWindow = false | ||
name = "Lazy Column" | ||
imports = listOf( | ||
"androidx.compose.foundation.layout.PaddingValues", | ||
"androidx.compose.foundation.lazy.LazyColumn", | ||
"androidx.compose.foundation.lazy.items", | ||
"androidx.compose.ui.Modifier", | ||
"androidx.compose.ui.unit.dp", | ||
) | ||
code = """ | ||
LazyColumn( | ||
modifier = Modifier, | ||
contentPadding = PaddingValues(vertical = 8.dp) // 8.dp between each item | ||
) { | ||
item { | ||
// If you want a single item | ||
} | ||
items(items = listOf<Any>()) { item -> | ||
// display a single list item | ||
// it's like forEach {} | ||
} | ||
} | ||
""".trimIndent() | ||
} | ||
|
||
component { | ||
showInToolWindow = false | ||
name = "Lazy Row" | ||
imports = listOf( | ||
"androidx.compose.foundation.layout.PaddingValues", | ||
"androidx.compose.foundation.lazy.LazyRow", | ||
"androidx.compose.foundation.lazy.items", | ||
"androidx.compose.ui.Modifier", | ||
"androidx.compose.ui.unit.dp", | ||
) | ||
code = """ | ||
LazyRow( | ||
modifier = Modifier, | ||
contentPadding = PaddingValues(horizontal = 8.dp) // 8.dp between each item | ||
) { | ||
item { | ||
// If you want a single item | ||
} | ||
items(items = listOf<Any>()) { item -> | ||
// display a single list item | ||
// it's like forEach {} | ||
} | ||
} | ||
""".trimIndent() | ||
} | ||
} |
This file contains 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