Skip to content

Commit

Permalink
Update documentation to bring it in line with strada-ios changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jayohms committed Sep 16, 2023
1 parent 75a35bb commit 9d350fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

**[Strada](https://strada.hotwired.dev)** lets you create high fidelity native features driven by your web app. It's a set of libraries that work across your [web](https://github.com/hotwired/strada-web), [iOS](https://github.com/hotwired/strada-ios), and Android apps to help you build features that make your [Turbo Native](https://turbo.hotwired.dev/handbook/native) hybrid apps stand out. Turn HTML elements that exist in the WebView into native components and communicate messages across your native and web code.

**Strada Android** enables you to create native components that receive and reply to messages from web components that are present on the page. Native components use received messages to run native code, whether it's to build high fidelity native UI or call platform APIs.
**Strada Android** enables you to create native components that receive and reply to messages from web components that are present on the page. Native components receive messages to run native code, whether it's to build high fidelity native UI or call platform APIs.

## Features
- **Level up** your [Turbo Native](https://turbo.hotwired.dev/handbook/native) hybrid apps with high-fidelity native components, driven by web components.
- **Reuse web components** for your [iOS](https://github.com/hotwired/strada-ios) and Android apps.
- **Communicate with the WebView** and its web components without writing any javascript in your app.
- **Communicate with the WebView** and its web components without writing any JavaScript in your app.

## Requirements

Expand Down
6 changes: 4 additions & 2 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ repositories {
}
dependencies {
implementation 'dev.hotwire:strada:1.0.0-beta01'
implementation 'dev.hotwire:strada:<latest-version>'
}
```

See the [latest version](https://bintray.com/hotwire/maven/strada-android) available on Bintray/JCenter.

**Note:** `strada-android` works seamlessly with [turbo-android](https://github.com/hotwired/turbo-android) and the documentation provides instructions for integrating Strada with your [Turbo Native](https://turbo.hotwired.dev/handbook/native) app. Keep in mind that `turbo-android` is not automatically included as a dependency in `strada-android`, so you'll want to setup your `turbo-android` app first.

## Required `minSdkVersion`
Android SDK 24 (or greater) is required as the `minSdkVersion` in your app module's `build.gradle` file:
```groovy
Expand Down Expand Up @@ -54,6 +56,6 @@ repositories {
}
dependencies {
implementation 'dev.hotwire:strada:1.0.0-alpha01'
implementation 'dev.hotwire:strada:<pre-release-version>'
}
```
10 changes: 5 additions & 5 deletions docs/QUICK-START.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _NOTE: You can find the code in this guide fully implemented in the `turbo-andro

For now, create an empty (global) list of registered component factories, so we have a reference. You'll need to populate this list with each bridge component that your app supports.

**`BridgeComponentFactories.kt`:**
**`BridgeComponentFactories.kt`**
```kotlin
val bridgeComponentFactories = listOf(
// Add registered components here later
Expand All @@ -23,7 +23,7 @@ For Strada to work properly across your web and native app, you'll need to make

The place to do this is in each `TurboSessionNavHostFragment` in your app:

**`MainSessionNavHostFragment.kt`:**
**`MainSessionNavHostFragment.kt`**
```kotlin
class MainSessionNavHostFragment : TurboSessionNavHostFragment() {

Expand Down Expand Up @@ -53,7 +53,7 @@ class MainSessionNavHostFragment : TurboSessionNavHostFragment() {
## Configure a JSON converter
Strada passes messages with json serialized `data` between the `WebView` and native code. If you'd like to take advantage of automatic de/serialization between your own `data` models and `strada-android`, you must set a converter class that implements `StradaJsonConverter`. We suggest using the [kotlinx.serialization](https://kotlinlang.org/docs/serialization.html#example-json-serialization) library. If you decide to use `kotlinx.serialization`, `strada-android` provides an automatic `KotlinXJsonConverter()` class that you can use with no extra work:

**`MainActivity.kt`:**
**`MainActivity.kt`**
```kotlin
class MainActivity : AppCompatActivity(), TurboActivity {

Expand All @@ -77,7 +77,7 @@ If you'd rather use another de/serialization library like [Moshi](https://github
## Implement the `BridgeDestination` interface
You'll need to implement the `BridgeDestination` interface where your `TurboNavDestination` is present:

**`NavDestination.kt`:**
**`NavDestination.kt`**
```kotlin
interface NavDestination : TurboNavDestination, BridgeDestination {

Expand All @@ -92,7 +92,7 @@ interface NavDestination : TurboNavDestination, BridgeDestination {
## Delegate to the `BridgeDelegate` class
You'll need to delegate the `TurboWebFragment` lifecycle callbacks to the `BridgeDelegate` class:

**`WebFragment.kt`:**
**`WebFragment.kt`**
```kotlin
class WebFragment : TurboWebFragment(), NavDestination {
private val bridgeDelegate by lazy {
Expand Down

0 comments on commit 9d350fb

Please sign in to comment.