Skip to content

Commit 656491b

Browse files
committed
Fix tutorial fileTemplates
Our templates were out of date, and our `install.sh` script doesn't work any more. Replaced with an IDE-produced zip file that the IDE is willing to import. Replaces `Layout Runner (ViewBinding)` with `Android Screen (ViewBinding)`: ```kotlin package ${PACKAGE_NAME} import com.squareup.workflow1.ui.AndroidScreen import com.squareup.workflow1.ui.ScreenViewFactory import com.squareup.workflow1.ui.ScreenViewRunner import com.squareup.workflow1.ui.ViewEnvironment import com.squareup.workflow1.ui.WorkflowUiExperimentalApi @OptIn(WorkflowUiExperimentalApi::class) data class $Name( // TODO: add properties needed to update $VIEW_BINDING_TYPE ) : AndroidScreen<$Name> { override val viewFactory = ScreenViewFactory.fromViewBinding($VIEW_BINDING_TYPE::inflate, ::${Name}Runner) } @OptIn(WorkflowUiExperimentalApi::class) private class ${Name}Runner( private val viewBinding: $VIEW_BINDING_TYPE ) : ScreenViewRunner<$Name> { override fun showRendering( rendering: $Name, environment: ViewEnvironment ) { TODO("Update viewBinding from rendering") } } ```
1 parent c8e0b29 commit 656491b

File tree

5 files changed

+8
-175
lines changed

5 files changed

+8
-175
lines changed

README-templates.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# File Templates
2+
3+
`workflow-file-templates.zip` can be imported into Android Studio / IntelliJ IDEA to add a few Workflow-specific file templates, via _File > Manage IDE Settings > Import Settings…_.
4+
5+
To update the templates:
6+
7+
* edit them in the IDE (_Settings > Editor > File and Code Templates_)
8+
* export them (_File > Manage IDE Settings > Import Settings…_), taking care to clear every checkbox except that for File Templates.

fileTemplates/Stateful Workflow.kt

Lines changed: 0 additions & 87 deletions
This file was deleted.

fileTemplates/Stateless Workflow.kt

Lines changed: 0 additions & 61 deletions
This file was deleted.

install-templates.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

workflow-file-templates.zip

2.74 KB
Binary file not shown.

0 commit comments

Comments
 (0)