Skip to content

Commit

Permalink
- ADD "ComponentState" feature in the feature builder.
Browse files Browse the repository at this point in the history
  • Loading branch information
MayconCardoso committed Feb 18, 2020
1 parent 8093cb9 commit 57fcc8b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ However, we know how many boilerplate we need to write to create a new ```featur
## Download Generator

```groovy
implementation 'com.mctech.architecture:generator:1.0.3'
implementation 'com.mctech.architecture:generator:1.0.4'
```

Creating an empty feature
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ext {
siteUrl = 'https://github.com/MayconCardoso/ArchitectureBoilerplateGenerator'
gitUrl = 'https://github.com/MayconCardoso/ArchitectureBoilerplateGenerator.git'

libraryVersion = '1.0.3'
libraryVersion = '1.0.4'

developerId = 'mayconcardoso'
developerName = 'Maycon Cardoso'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ open class ActvityTemplate(modulePath: ModuleFilePath) : PresentationKotlinTempl

// Create observable to states handlers.
foreachComponentState {
output.printTabulate("private fun handle${it.getMethodName()}Data(state: ${it.type.getType()}) {")
output.printTabulate("private fun handle${it.getMethodName()}State(state: ComponentState<${it.type.getType()}>) {")
output.printDoubleTabulate("when(state){")
output.printTripleTabulate("is ComponentState.Initializing -> TODO()")
output.printTripleTabulate("is ComponentState.Loading -> TODO()")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ open class FragmentTemplate(modulePath: ModuleFilePath) : PresentationKotlinTem

// Create observable to states handlers.
foreachComponentState {
output.printTabulate("private fun handle${it.getMethodName()}Data(state: ${it.type.getType()}) {")
output.printTabulate("private fun handle${it.getMethodName()}State(state: ComponentState<${it.type.getType()}>) {")
output.printDoubleTabulate("when(state){")
output.printTripleTabulate("is ComponentState.Initializing -> TODO()")
output.printTripleTabulate("is ComponentState.Loading -> TODO()")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ open class ViewModelTemplate(modulePath: ModuleFilePath) : PresentationKotlinTem

// Components
foreachComponentState {
output.printTabulate("private val _${it.name} = MutableLiveData<ComponentState<${it.type.getType()}>()")
output.printTabulate("private val _${it.name} : MutableLiveData<ComponentState<${it.type.getType()}>> = MutableLiveData(ComponentState.Initializing)")
output.printTabulate("val ${it.name} : LiveData<ComponentState<${it.type.getType()}>> = _${it.name}")
output.blankLine()
}
Expand Down

0 comments on commit 57fcc8b

Please sign in to comment.