Skip to content

Commit

Permalink
Review android 1.10 (#776)
Browse files Browse the repository at this point in the history
* Update prepare-release.yml (#751)

Adds "Read secrets from AWS Secrets Manager into environment variables" step

* Update prepare-release.yml (#752)

Updates the steps:
* Upload FAQ
* Upload Portuguese FAQ
* S3 upload

* Update index (#754)

* fix icons

Signed-off-by: carlossteinzup <carlos.stein@zup.com.br>

* Update README.md (#753)

* updates release notes icons and index for main page

Signed-off-by: carlossteinzup <carlos.stein@zup.com.br>

* Update _index.md (#759)

Changed platform name from Android do iOS.

* Fix a typo (#762)

I believe the word scratch was misspelled.

* Reviewed Android section

* ajusts PR check

Signed-off-by: carlossteinzup <carlos.stein@zup.com.br>

* Update rootview.md

Co-authored-by: Dairan <dairan@dairan.com>
Co-authored-by: Kolmar Kafran <kafran@users.noreply.github.com>
Co-authored-by: jessica.olinda@zup.com.br <jessica.olinda@zup.com.br>
  • Loading branch information
4 people committed Sep 20, 2021
1 parent 81b70d5 commit 1a04515
Show file tree
Hide file tree
Showing 75 changed files with 395 additions and 335 deletions.
2 changes: 1 addition & 1 deletion content/en/android/customization/action/async-action.md
Expand Up @@ -7,7 +7,7 @@ description: In this section, you will find how to create a custom async action.
**Topics covered:**
- How to create an Async Action

**Requirements:**
**Requirements:**
- A project with Beagle configured;
- Simple actions. For more information, check out [how to create simple actions]({{< ref path="/android/customization/action/simple-action" lang="en">}})

Expand Down
1 change: 0 additions & 1 deletion content/en/android/customization/action/overview.md
Expand Up @@ -16,7 +16,6 @@ Beagle already has some predefined actions, however it is possible to create cus




{{% alert color="danger" %}}
It is **mandatory** to add the `@Transient` tag for **all attributes** in the classes that will represent the actions so that they are not taken into account in the component serialization and deserialization.
{{% /alert %}}
6 changes: 3 additions & 3 deletions content/en/android/customization/action/simple-action.md
Expand Up @@ -15,7 +15,7 @@ description: Creating and executing a custom action

## What is?

On Beagle, an action deals with behaviours \(functions\), that are performed in your application when an event is triggered. These actions can be a Beagle's default or customized by you.
On Beagle, an action deals with behaviors \(functions\), that are performed in your application when an event is triggered. These actions can be a Beagle's default or customized by you.

## How to create an action

Expand Down Expand Up @@ -48,11 +48,11 @@ data class CustomActionAndroid(

There are two ways to register your action, check them below:

- Using Annotation Processor:
1. Using Annotation Processor:

For this, annotate your action class with `@RegisterAction("className")` where className is your class name.

- Without the Annotation Processor
2. Without the Annotation Processor.

## How to use your action

Expand Down
4 changes: 2 additions & 2 deletions content/en/android/customization/beagleexception.md
Expand Up @@ -2,14 +2,14 @@
title: BeagleException
weight: 121
description: >-
This section shows details about the BeagleException class.
In this section, you will find information about the BeagleException class.
---

---

## Introduction

The Beagle exception is an exception class thrown when an error occurs in Beagle.
Beagle exception is an exception class thrown when an error occurs in Beagle:

```kotlin
open class BeagleException
Expand Down
3 changes: 1 addition & 2 deletions content/en/android/customization/beagleimagedownloader.md
Expand Up @@ -2,8 +2,7 @@
title: BeagleImageDownloader
weight: 121
description: >-
In this section, you will find the description of the BeagleImageDownloader class and details of the
methods that implement it.
In this section, you will find the description of the BeagleImageDownloader class and details of the methods that implement it.
---

---
Expand Down
9 changes: 4 additions & 5 deletions content/en/android/customization/custom-beagle-activity.md
Expand Up @@ -2,8 +2,7 @@
title: Custom Beagle Activity
weight: 109
description: >-
You will find here how to use BeagleActivity to customize your server-driven
activity.
In this section, you will find how to use BeagleActivity to customize your server-driven activity.
---

---
Expand All @@ -12,7 +11,7 @@ description: >-

`BeagleActivity` is a class that helps you manage where your server-driven components will be placed. Its structure works like an Android activity.

In order to Beagle understand that you're working with an `BeagleAcitivity`'s class, it's necessary to use **`@RegisterController`** annotation and implement their respective methods.
In order to Beagle understand that you're working with an `BeagleActivity`'s class, it's necessary to use **`@RegisterController`** annotation and implement their respective methods.

## What is customizable?

Expand Down Expand Up @@ -110,7 +109,7 @@ override fun getToolbar(): Toolbar = findViewById<Toolbar>(R.id.toolbar)

You can watch the state and treat the errors from **`onServerDrivenContainerStateChanged()`**

You can observe a server-driven activity status and handle errors using the function [`onServerDrivenContainerStateChanged()`]({{< ref path="/android/customization/loading-and-errors-treatment" lang="pt" >}}). This function has as parameter that indicates the status of a server-driven activity, and when any error occurs, the state `ServerDrivenState.Error` will be received at this function.
You can observe a server-driven activity status and handle errors using the function [`onServerDrivenContainerStateChanged()`]({{< ref path="/android/customization/loading-and-errors-treatment" lang="pt" >}}). This function has as parameter that indicates the status of a server-driven activity, and when any error occurs, the state `ServerDrivenState.Error` will be received at this function:

```kotlin
override fun onServerDrivenContainerStateChanged(state: ServerDrivenState) {
Expand All @@ -122,7 +121,7 @@ override fun onServerDrivenContainerStateChanged(state: ServerDrivenState) {

### 4. ProgressBar

Like when you handled errors, you can check if the server-driven container status is `Started` or` Finished` and thus define the visibility of a *ProgressBar*. When the activity loading starts, the `onServerDrivenContainerStateChanged` function receives the` ServerDrivenState.Started` parameter (which represents the activity status). Likewise, when the loading ends without errors, the `ServerDrivenState.Finished` parameter is received. You can check below how we can use these two states to change the progress bar visibility.
Like when you handled errors, you can check if the server-driven container status is `Started` or` Finished` and thus define the visibility of a *ProgressBar*. When the activity loading starts, the `onServerDrivenContainerStateChanged` function receives the` ServerDrivenState.Started` parameter (which represents the activity status). Likewise, when the loading ends without errors, the `ServerDrivenState.Finished` parameter is received. You can check below how you can use these two states to change the progress bar visibility:

```kotlin
override fun onServerDrivenContainerStateChanged(state: ServerDrivenState) {
Expand Down
9 changes: 4 additions & 5 deletions content/en/android/customization/custom-validator.md
Expand Up @@ -2,8 +2,7 @@
title: Custom Validator
weight: 111
description: >-
You will find here a description on how to validate a form. This component is
deprecated.
In this section, you will find a description on how to validate a form. This component is deprecated.
---

---
Expand All @@ -20,15 +19,15 @@ A **validator** component is used when it is necessary to validate some form inf

The **Form** component capture data informed by the user and validates and send them to BFF. This validation can happen when the user activates FormSubmit or when notifies its status to `InputWidget(FormInput).`

**Validator** receives two generic parameters and it has only on isValid method that returns a boolean value.
**Validator** receives two generic parameters and it has only on isValid method that returns a boolean value:

```kotlin
interface Validator<in I, in W> {
fun isValid(input: I, widget: W): Boolean
}
```

- **input:** represents the value `inputWidget` sends as data to be validated.
- **input:** represents the value `inputWidget` sends as data to be validated;
- **widget:** refers to `InputWidget` that sent the data.

## Implementing a validator
Expand Down Expand Up @@ -58,7 +57,7 @@ FormInput(
)
```

The follow example, the `InputWidget` implementation will run the Validator calling the **`notifyChanges()`** method.
The follow example, the `InputWidget` implementation will run the Validator calling the **`notifyChanges()`** method:

```kotlin
@RegisterWidget
Expand Down
12 changes: 5 additions & 7 deletions content/en/android/customization/deep-link-handler.md
Expand Up @@ -2,16 +2,14 @@
title: Deep Link Handler
weight: 122
description: >-
You will find a description about DeepLinkHandler class and methods
details.
In this section, you will find a description about DeepLinkHandler class and its methods details.
---

---

## Introduction

**`DeepLinkHandler`** is a **interface** that defines how to configure navigation between a
**Server-Driven screen** and a **native screen.**
**`DeepLinkHandler`** is a **interface** that defines how to configure navigation between a **Server-Driven screen** and a **native screen.**

## Example

Expand All @@ -31,7 +29,7 @@ class AppDeepLinkHandler : DeepLinkHandler {
}
```

In the **getDeepLinkIntent** method, you can configure the navigation screens of the server-driven ui flows to their native screens, making sure that Beagle recognizes your rule.
In the **getDeepLinkIntent** method, you can configure the navigation screens of the server-driven UI flows to their native screens, making sure that Beagle recognizes your rule.

| **Attribute** | **Type** | **Definition** |
| :--------------------- | :------------------- | :----------------------------------------------------------------------------------------------------------------------: |
Expand All @@ -42,8 +40,8 @@ In the **getDeepLinkIntent** method, you can configure the navigation screens of

Once you made it, it's necessary to modify the Android manifest file:

1. **Step 1:** You must add an `intent filter` at the activity you wish to navigate to.
2. **Step 2:** You will add an `action tag` that will identify this activity. The `id name` you used here is `"navigate.myview"`
1. **Step 1:** You must add an `intent filter` at the activity you wish to navigate to;
2. **Step 2:** You will add an `action tag` that will identify this activity. The `id name` you used here is `"navigate.myview"`;
3. **Step 3:** Add an `category tag` and name it `"android.intent.category.DEFAULT" ,` like the example below:

```markup
Expand Down
4 changes: 2 additions & 2 deletions content/en/android/customization/design-system.md
@@ -1,7 +1,7 @@
---
title: Design System
weight: 124
description: You will find here Design System class description and methods details.
description: In this section, you will find Design System class description and methods details.
---

---
Expand Down Expand Up @@ -66,7 +66,7 @@ class AppDesignSystem : DesignSystem() {
When a class extends the `Open Class DesignSystem` it is able to manage styles that will be applied to the server-driven components. It is necessary to implement a class to register the styles on Beagle, only this way it will be able to see the styles and apply them.
{{% /alert %}}

As an Android pattern, the styles can be defined in the `style` file and referenced inside a class that understands Design System.
As an Android pattern, the styles can be defined in the `style` file and referenced inside a class that understands Design System:

```markup
<resources>
Expand Down
Expand Up @@ -2,8 +2,7 @@
title: Loading and errors treatment
weight: 128
description: >-
You will find here information on how to customize Beagle's behaviour to each
loading screens and errors treatments.
In this section, you will find information on how to customize Beagle's behavior to each loading screens and errors treatments.
---

---
Expand Down Expand Up @@ -52,7 +51,7 @@ class AppBeagleActivity : BeagleActivity() {
```


On the `loadView`, you can also see that these states shows the loadView implementation, it is possible to define when to show or to hide Load. And you can also define other action to the states `ServerDrivenState`, that are`Started`, `Success` , `Finished` and `Error`
On the `loadView`, you can see these states show the loadView implementation, it is possible to define when to show or to hide Load. And you can also define other action to the states `ServerDrivenState`, that are`Started`, `Success` , `Finished` and `Error`:

```kotlin
sealed class ServerDrivenState {
Expand All @@ -66,7 +65,7 @@ sealed class ServerDrivenState {
}
```

See more details about each state:
Check out more details about each state:

* **Started:** Indicates that a server-driven component fetch has begun.
* **Finished:** Indicates that a server-driven component fetch has finished.
Expand Down
3 changes: 1 addition & 2 deletions content/en/android/customization/log-system.md
Expand Up @@ -2,8 +2,7 @@
title: Log System
weight: 130
description: >-
You will find here the BeagleLogger class description, customization and
configuration details.
In this section, you will find the BeagleLogger class description, customization and configuration details.
---

---
Expand Down
13 changes: 7 additions & 6 deletions content/en/android/customization/manage-cache.md
Expand Up @@ -9,7 +9,7 @@ description: >-

## Introduction

The StoreHandler interface defines a protocol that allows you to customize how the cache is handled in the database and in the memory.
The StoreHandler interface defines a protocol that allows you to customize how the cache is handled in the database and in the memory:

```kotlin
interface StoreHandler {
Expand All @@ -24,7 +24,7 @@ interface StoreHandler {
}
```

The StoreType enum defines through attributes whether data will be manipulated on disk or memory
The StoreType enum defines through attributes whether data manipulation will be on disk or memory:

* `DATABASE` represents the disk.
* `MEMORY` represents memory.
Expand All @@ -41,7 +41,8 @@ enum class StoreType {
LocalStore interface allows you to map the actions of saving, restoring, deleting and the getting all.

This interface allows you to create rules for how data will be handled in a class.
For example: create a class and use this interface to make a rule of how data will be handled on the disk.

- For example: create a class and use this interface to make rules on how to handle data on the disk:

```kotlin
interface LocalStore {
Expand All @@ -58,9 +59,9 @@ To create a custom cache manage, just follow the next steps:

### Step 1: Create an object MemoryLocalStore

First, it is necessary to create two classes that will implement the `LocalStore` interface: the MemoryLocalStore and the DatabseLocalStore.
Create two classes that will implement the `LocalStore` interface: the MemoryLocalStore and the DatabseLocalStore.

With the LocalStore interface, you to map the actions of saving, restoring, deleting and getAll, as shown on the example below:
With the LocalStore interface, you to map the actions of saving, restoring, deleting and getAll, as you can see on the example below:


```kotlin
Expand Down Expand Up @@ -247,7 +248,7 @@ internal object BeagleMessageLogs {

### Step 3: Create a StoreHandlerDefault class

The StoreHandler class defines a protocol that allows you to customize how the cache is handled in the database and in memory.
The StoreHandler class defines a protocol that allows you to customize how to handle the cache in the database and the memory.

After the `MemoryLocalStore` and `DatabaseLocalStore` classes definition, you can define `StoreHandler`. See how in the example below:

Expand Down
5 changes: 2 additions & 3 deletions content/en/android/customization/navigation-animation.md
Expand Up @@ -2,8 +2,7 @@
title: Navigation Animation
weight: 132
description: >-
You will learn in this section about how it is possible to customize Beagle's
navigation screen
In this section, you will find information about how it is possible to customize Beagle's navigation screen.
---

---
Expand All @@ -16,7 +15,7 @@ Besides these configuration, you can also customize the navigation of your appli

There are two customization options:

1. According to Android's default animation.
1. According to Android's default animation;
2. Fragments transition provided by Beagle, that it can be customized according to your preference and design system. They are:

* [**PushView**]({{< ref path="/api/actions/navigate/pushview" lang="en" >}})
Expand Down
21 changes: 12 additions & 9 deletions content/en/android/customization/network-client.md
Expand Up @@ -2,17 +2,17 @@
title: Network Client
weight: 126
description: >-
You will find here, information about Beagle's network client and how to
modify it
In this section, you will find information about Beagle's network client and how to
modify it.
---

---

## Introduction

This interface defines how the services requests are configured, to use it, you need to create a class that implements a `HttpClient` interface.
This interface defines how the services requests are configured, and to use it, you need to create a class that implements a `HttpClient` interface.

You can add headers to your requests, define method request, body response, data response, run cryptography, etc.
You can add headers to your requests, define method request, body response, data response, run cryptography, etc. See:

```kotlin
interface HttpClient {
Expand Down Expand Up @@ -89,7 +89,7 @@ This dependency is necessary, because the class that implements `HttpClient` wil

Create an object and choose a name for it, for example, `CoroutineDispatchers`.

This object is responsible for configuring **CoroutineDispatchers** and will dictate which thread the tasks will run.
This object is responsible for configuring **CoroutineDispatchers** and will dictate which thread the tasks will run:

```kotlin
import kotlinx.coroutines.CoroutineDispatcher
Expand All @@ -116,7 +116,7 @@ internal object CoroutineDispatchers {
### Step 3: Create a HttpURLConnectionExtensions file

Create a file and choose a name for it, for example,`HttpURLConnectionExtensions`.
This file is responsible for containing methods returning the **HttpURLConnection** rule, so you will use these methods in the HttpClientDefault class.
This file is responsible for containing methods returning the **HttpURLConnection** rule, so you will use these methods in the HttpClientDefault class:

```kotlin
import java.lang.Exception
Expand Down Expand Up @@ -151,7 +151,7 @@ Create a class and choose a name for it, for example `HttpClientDefault`.

HttpClientDefault class defines how the services requests are configured. To use it, you need to create a class that implements the `HttpClient` interface.

This configuration is long, so copy and paste the class below. You may modify it later.
This configuration is long, so copy and paste the class below. You may modify it later:

```kotlin
import br.com.zup.beagle.android.annotation.BeagleComponent
Expand Down Expand Up @@ -290,9 +290,12 @@ class HttpClientDefault : HttpClient, CoroutineScope {

Create a class and choose a name for it, for example `HttpClientFactoryDefault`.

HttpClientFactoryDefault class is responsible for creating the HttpClient instance for Beagle. This class is particularly useful when you need to configure or pass parameters in your HttpClient instantiation. To use it, you need to create a class that implements the `HttpClientFactory` interface.
HttpClientFactoryDefault class is responsible for creating the HttpClient instance for Beagle. This class is particularly useful when you need to configure or pass parameters in your HttpClient instantiation.

As an example, you can copy and paste the class below. You may modify it later.
To use it:
- Create a class that implements the `HttpClientFactory` interface.

As an example, you can copy and paste the class below. You may modify it later:

```kotlin
import br.com.zup.beagle.android.annotation.BeagleComponent
Expand Down
2 changes: 1 addition & 1 deletion content/en/android/customization/proguard-configuration.md
@@ -1,7 +1,7 @@
---
title: Proguard configuration
weight: 136
description: 'You will find here, ProGuard description and configuration for Beagle.'
description: 'In this section, you will find information about ProGuard description and configuration for Beagle.'
---

---
Expand Down

0 comments on commit 1a04515

Please sign in to comment.