From a79bb59c6c25c665516ee350d9015bcfc243aced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jirka=20Hut=C3=A1rek?= Date: Thu, 26 Sep 2024 21:00:25 +0200 Subject: [PATCH 1/4] Simplify main activity layout example ConstrainLayout requires a separate dependency, and it's probably an overkill for this purpose. Also, the constraints for the fragment container view weren't correct anyway. --- _source/android/01_getting_started.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/_source/android/01_getting_started.md b/_source/android/01_getting_started.md index 7829c37..bb1fdca 100644 --- a/_source/android/01_getting_started.md +++ b/_source/android/01_getting_started.md @@ -42,20 +42,14 @@ Set up the app's layout by opening `activity_main.xml` and replace the entire fi ```xml - - - - - + android:layout_height="match_parent" + app:defaultNavHost="false" /> ``` Finally, open `MainActivity.kt` and replace the entire file with this code: From e227bb918ec19cdbc4eb2b336528f7feb93d0c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jirka=20Hut=C3=A1rek?= Date: Thu, 26 Sep 2024 21:01:37 +0200 Subject: [PATCH 2/4] Make the MainActivity instructions more precise Technically, you don't want to replace the entire file (including the package directive and the imports). --- _source/android/01_getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_source/android/01_getting_started.md b/_source/android/01_getting_started.md index bb1fdca..063d449 100644 --- a/_source/android/01_getting_started.md +++ b/_source/android/01_getting_started.md @@ -52,7 +52,7 @@ Set up the app's layout by opening `activity_main.xml` and replace the entire fi app:defaultNavHost="false" /> ``` -Finally, open `MainActivity.kt` and replace the entire file with this code: +Finally, open `MainActivity.kt` and replace the class with this code: ```kotlin class MainActivity : HotwireActivity() { From f0000d4aa6614d60a698b92e48b5e215ee59f0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jirka=20Hut=C3=A1rek?= Date: Thu, 26 Sep 2024 21:07:56 +0200 Subject: [PATCH 3/4] Add missing return type to code sample --- _source/android/03_bridge_components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_source/android/03_bridge_components.md b/_source/android/03_bridge_components.md index d975ed6..2bda586 100644 --- a/_source/android/03_bridge_components.md +++ b/_source/android/03_bridge_components.md @@ -82,7 +82,7 @@ class ButtonComponent( // incoming data.title to set the button title. } - private fun performButtonClick() { + private fun performButtonClick(): Boolean { return replyTo("connect") } From 20cbb2a399270602ee7395878e5ad33b66454bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jirka=20Hut=C3=A1rek?= Date: Thu, 26 Sep 2024 21:14:13 +0200 Subject: [PATCH 4/4] Fix syntax error in code sample --- _source/android/06_reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_source/android/06_reference.md b/_source/android/06_reference.md index 31efe36..5a6cdf5 100644 --- a/_source/android/06_reference.md +++ b/_source/android/06_reference.md @@ -16,7 +16,7 @@ The `Navigator` is the central coordinator in a Hotwire Native Android applicati You can customize and subclass the `HotwireWebView` class to provide custom behaviors in your app: ```kotlin -Hotwire.config.makeCustomWebView = { context +Hotwire.config.makeCustomWebView = { context -> MyCustomWebView(context, null) } ```