Skip to content

Commit

Permalink
Merge pull request #45 from hotwired/android-copy-changes
Browse files Browse the repository at this point in the history
Android copy changes
  • Loading branch information
jayohms authored Sep 27, 2024
2 parents f7f3eaf + 20cbb2a commit dd49233
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
18 changes: 6 additions & 12 deletions _source/android/01_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,17 @@ Set up the app's layout by opening `activity_main.xml` and replace the entire fi

```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.fragment.app.FragmentContainerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_nav_host"
android:name="dev.hotwire.navigation.navigator.NavigatorHost"
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/main_nav_host"
android:name="dev.hotwire.navigation.navigator.NavigatorHost"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="false" />

</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_height="match_parent"
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
import android.os.Bundle
Expand Down
2 changes: 1 addition & 1 deletion _source/android/03_bridge_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ButtonComponent(
// incoming data.title to set the button title.
}

private fun performButtonClick() {
private fun performButtonClick(): Boolean {
return replyTo("connect")
}

Expand Down
2 changes: 1 addition & 1 deletion _source/android/06_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
```
Expand Down

0 comments on commit dd49233

Please sign in to comment.