-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a couple extra example projects, improves documentation
- Loading branch information
1 parent
f816903
commit 2ba9b04
Showing
83 changed files
with
12,244 additions
and
127 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
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
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
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
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
44 changes: 44 additions & 0 deletions
44
ballast-idea-plugin/src/main/resources/fileTemplates/j2ee/ComposeUi.kt.ft
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,44 @@ | ||
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME} | ||
#end | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.rememberCoroutineScope | ||
import com.copperleaf.ballast.BallastViewModelConfiguration | ||
import com.copperleaf.ballast.build | ||
import com.copperleaf.ballast.core.BasicViewModel | ||
import com.copperleaf.ballast.withViewModel | ||
|
||
#parse("File Header.java") | ||
${classVisibility}object ${featureName}Ui { | ||
|
||
@Composable | ||
${classVisibility}fun Content() { | ||
val viewModelCoroutineScope = rememberCoroutineScope() | ||
val vm: ${featureName}ViewModel = remember(viewModelCoroutineScope) { | ||
BasicViewModel( | ||
coroutineScope = viewModelCoroutineScope, | ||
config = BallastViewModelConfiguration.Builder() | ||
.withViewModel( | ||
initialState = ${featureName}Contract.State(), | ||
inputHandler = ${featureName}InputHandler(), | ||
) | ||
.build(), | ||
eventHandler = ${featureName}EventHandler(), | ||
) | ||
} | ||
val uiState by remember { vm.observeStates() }.collectAsState() | ||
|
||
Content(uiState) { vm.trySend(it) } | ||
} | ||
|
||
@Composable | ||
${classVisibility}fun Content( | ||
uiState: ${featureName}Contract.State, | ||
postInput: (${featureName}Contract.Inputs) -> Unit, | ||
) { | ||
|
||
} | ||
} |
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
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
Oops, something went wrong.