Skip to content

Commit 4fe70dc

Browse files
committed
Release rn_83
1 parent d1552f5 commit 4fe70dc

39 files changed

Lines changed: 1158 additions & 1154 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Build files
22
node_modules
33
package-lock.json
4+
build
5+
buildinfo.json
6+
coverage
47

58
# Other files
69
*.iml

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.18.1
1+
22.22.2

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Key features include:
2121
* Practical examples of focus management in complex layouts.
2222

2323

24-
**Note**: While this app contains recommendations, there will always be different approaches on how to build the components or screen or libraries used (FlashList). This guide is a starting point for what needs to be done, but we encourage you to explore and adopt best practices that suit your specific project requirements but always [think in React](https://react.dev/learn/thinking-in-react).
24+
**Note**: While this app contains recommendations, there will always be different approaches on how to build the components or screen or libraries used (FlashList). This guide is a starting point for what must be done, and you should explore and adopt best practices that suit your specific project requirements but always [think in React](https://react.dev/learn/thinking-in-react).
2525

2626

2727
### Why TV interfaces are different
2828
29-
TV applications are navigated primarily with directional controls (up, down, left, right) rather than touch. This fundamentally changes how users interact with your app:
29+
TV applications are navigated primarily with directional controls (up, down, left, right) rather than touch. This difference fundamentally changes how users interact with your app:
3030

3131
* Users can only interact with one element at a time (the focused element).
3232
* Navigation paths between elements must be clear and predictable.
@@ -73,7 +73,7 @@ You can also use [Vega Studio](https://developer.amazon.com/docs/vega/latest/set
7373

7474
1. At the command prompt, navigate to the Vega TV Interfaces Sample App source code directory.
7575

76-
2. To install the app dependencies, run the following command.
76+
2. To install the app dependencies, run the following command. The installation can take several minutes to complete.
7777

7878
```
7979
npm install
@@ -95,21 +95,21 @@ You can also use [Vega Studio](https://developer.amazon.com/docs/vega/latest/set
9595

9696
#### Vega Virtual Device
9797

98-
1. To start the Vega Virtual Device, at the command prompt, run the following command.
98+
1. To start the Vega Virtual Device at the command prompt, run the following command.
9999

100100
```
101101
vega virtual-device start
102102
```
103103

104104
2. To install and launch the app on the Vega Virtual Device, run the following command, depending on your device architecture.
105105

106-
- On Mac M-series based devices.
106+
- On Mac M-series-based devices.
107107

108108
```
109109
vega run-app build/aarch64-release/keplertvinterfaces_aarch64.vpkg
110110
```
111111
112-
- On x86_64 based devices.
112+
- On x86_64-based devices.
113113
114114
```
115115
vega run-app build/x86_64-release/keplertvinterfaces_x86_64.vpkg
@@ -164,7 +164,7 @@ Testing the app
164164
165165
### React Native Testing Library (RNTL)
166166
167-
RNTL allows us to write tests that closely resemble how users interact with our app. It provides utilities for rendering components, finding elements, and simulating user actions.
167+
RNTL lets you write tests that closely resemble how users interact with the app. It provides utilities for rendering components, finding elements, and simulating user actions.
168168
169169
### Test Commands
170170
@@ -185,7 +185,7 @@ For more detailed information about our testing setup, best practices, and custo
185185
Services
186186
--------
187187
188-
The app is structured to delegate specific tasks to encapsulated units of logic known as services. Each service is designed to handle a particular functionality, allowing for clean separation of concerns and ensuring that the logic is reusable and maintainable. This approach allows services to be potentially extracted and used in other applications with ease.
188+
The app is structured to delegate specific tasks to encapsulated units of logic known as services. Each service is designed to handle a particular functionality, enabling clean separation of concerns and ensuring that the logic is reusable and maintainable. This approach enables services to be potentially extracted and used in other applications with ease.
189189
190190
- [**AppConfig Service**](src/services/appConfig/README.md): Manages environment variables defined in the `.env` file, enabling the app to read and apply configuration settings.
191191
@@ -210,9 +210,9 @@ You can customize the UI by changing the color scheme and font settings.
210210
211211
**To customize the color theme**
212212
213-
1. Open any color scheme generator for Material Design, for example, https://material-foundation.github.io/material-theme-builder/ and create color scheme that you prefer.
213+
1. Open any color scheme generator for Material Design, for example, https://material-foundation.github.io/material-theme-builder/ and create a color scheme that you prefer.
214214
215-
2. Export created theme as a JSON file.
215+
2. Export the created theme as a JSON file.
216216
217217
3. Go to the **palette.ts** (../../src/theme/palette.ts) file and replace the `lightPalette` and `darkPalette` objects to the generated.
218218
@@ -245,7 +245,7 @@ You can customize the UI by changing the color scheme and font settings.
245245

246246
### Detailed theming information
247247

248-
As a part of the Navigation Interface Focus Examples app, the `kepler-ui-components` library is used for the UI layer. All files related to the configuration of the theme should be kept in the **src/theme** directory.
248+
The Navigation Interface Focus Examples app uses the `kepler-ui-components` library for the UI layer. Keep all files related to theme configuration in the **src/theme** directory.
249249

250250
**The src/theme/ directory structure:**
251251

@@ -264,7 +264,7 @@ src/theme/
264264

265265
### Create tokens for components
266266

267-
**To modify pre-defined tokens and follow defined palette**
267+
**To modify predefined tokens and follow a defined palette**
268268

269269
1. Create a new file using the following format.
270270

@@ -331,9 +331,9 @@ New tokens are visible after you reload your app.
331331
Components
332332
----------
333333

334-
To provide default props and customize components, importing directly from `@amazon-devices/kepler-ui-components` is blocked across the app.
334+
To provide default props and customize components, the app blocks direct imports from `@amazon-devices/kepler-ui-components`.
335335

336-
Every component from UI library should have a created abstraction in the `src/components/core` directory. Please use components from `@AppComponents/core` or create a new one if it doesn't exist.
336+
Every component from the UI library should have a created abstraction in the `src/components/core` directory. Use components from `@AppComponents/core` or create a new one if it doesn't exist.
337337

338338

339339
```jsx
@@ -355,7 +355,7 @@ import { Button } from '@amazon-devices/kepler-ui-components';
355355

356356
#### `useAppTheme`
357357

358-
The `useAppTheme` hook is a custom hook built on top of the `useTheme` hook from the `@amazon-devices/kepler-ui-components` package. It provides an easy way to access the the colors of the current theme, and typography from the theme of your application, which conforms to the `AppTheme` type.
358+
The `useAppTheme` hook is a custom hook built on top of the `useTheme` hook from the `@amazon-devices/kepler-ui-components` package. It provides an easy way to access the colors of the current theme and typography from the theme of your application, which conforms to the `AppTheme` type.
359359

360360
##### Usage
361361

@@ -371,7 +371,7 @@ const { isDarkTheme, colors, typography } = useAppTheme();
371371

372372
#### Returns
373373

374-
* **`isDarkTheme: boolean`**: Indicates whether the current theme is a dark theme by checking the theme `type` of the metadata.
374+
* **`isDarkTheme: boolean`**: Shows whether the current theme is a dark theme by checking the theme `type` of the metadata.
375375
* **`colors: object`**: Contains the color palette defined in the theme.
376376
* **`typography: object`**: Contains the typography settings such as typeface, type sizes, and other related properties.
377377

@@ -382,7 +382,7 @@ const { isDarkTheme, colors, typography } = useAppTheme();
382382

383383
#### `useThemedStyles`
384384

385-
The `useThemedStyles` hook allows you to generate dynamic styles in the component theme. It leverages the `useAppTheme` hook to get the current theme and applies a callback function to generate a `NamedStyles` object.
385+
The `useThemedStyles` hook lets you generate dynamic styles in the component theme. It leverages the `useAppTheme` hook to get the current theme and applies a callback function to generate a `NamedStyles` object.
386386

387387
#### Usage
388388

@@ -403,7 +403,7 @@ const styles = useThemedStyles(({colors}: AppTheme) => StyleSheet.create({
403403

404404
#### Parameters
405405

406-
* **`callback: (theme: AppTheme) => NamedStyles<T>`**: A function that takes the current theme and returns a `NamedStyles` object. This function can be used to generate styles that react to theme changes.
406+
* **`callback: (theme: AppTheme) => NamedStyles<T>`**: A function that takes the current theme and returns a `NamedStyles` object. Use this function to generate styles that react to theme changes.
407407

408408
#### Returns
409409

@@ -412,7 +412,7 @@ const styles = useThemedStyles(({colors}: AppTheme) => StyleSheet.create({
412412
##### Dependencies
413413

414414
* **`useAppTheme()`**: A custom hook that provides the colors of the current themes and typography.
415-
* **`StyleSheet.NamedStyles`**: A type from React Native's `StyleSheet` API for defining strongly-typed styles.
415+
* **`StyleSheet.NamedStyles`**: A type from React Native's `StyleSheet` API for defining strongly typed styles.
416416

417417

418418
Set up translations
@@ -422,7 +422,7 @@ This section describes how to adjust existing translations to your needs and inc
422422

423423
### Language list
424424

425-
All available languages are defined in the **languages.ts** file (../../src/services/i18n/languages.ts).
425+
The **languages.ts** file (../../src/services/i18n/languages.ts) defines all available languages.
426426

427427
```js
428428
export const languages = [
@@ -437,7 +437,7 @@ All items must correspond with directories in the **assets/text** directory.
437437

438438
### Change existing translations
439439

440-
All translations are located in **assets/text** directory using the following structure.
440+
All translations are located in the **assets/text** directory using the following structure.
441441

442442

443443
```
@@ -467,16 +467,16 @@ To change translations, you must change all needed values in the translation fil
467467
npm run i18n:sync
468468
```
469469

470-
4. Adjust values of the new keys to a specific language.
470+
4. Adjust the values of the new keys to a specific language.
471471

472472

473473
### i18n Service details
474474

475-
The i18n Service details section provides a React Native context and custom hook for internationalization (i18n) in the Navigation Interface Focus Examples app. This allows for setting and retrieving the current locale and provides a translation function to fetch and format localized messages.
475+
The i18n Service details section provides a React Native context and custom hook for internationalization (i18n) in the Navigation Interface Focus Examples app. This service enables setting and retrieving the current locale and provides a translation function to fetch and format localized messages.
476476

477477
#### Structure
478478

479-
Th Navigation Interface Focus Examples app uses the`PUFF-J` files as resources for translation. All files should be created in the **assets/text** directory. New translations should be added in directory with name of language code, for example, **assets/text/es/strings.puff.json**.>
479+
Th Navigation Interface Focus Examples app uses the `PUFF-J` files as resources for translation. Create all files in the **assets/text** directory. Add new translations in the directory named with the language code, for example, **assets/text/es/strings.puff.json**.
480480

481481
```
482482
assets
@@ -524,29 +524,29 @@ The `useTranslation` hook returns an object containing the following methods:
524524

525525
* **`t(translationId: string, params?: { [key: string]: TranslationParamValue })`**
526526

527-
Fetches the translation for the given `translationId` based on the current locale. This method accepts an optional `params` object that provides dynamic values to inject into the translation string. If the translation can't be found or fails, the `translationId` is returned as a fallback.
527+
Fetches the translation for the given `translationId` based on the current locale. This method accepts an optional `params` object that provides dynamic values to inject into the translation string. If the translation can't be found or fails, the method returns the `translationId` as a fallback.
528528

529529
* **`locale`**
530530

531-
The current locale, for example, `en-US`. This is the language and region format used to resolve translations.
531+
The current locale, for example, `en-US`. This value represents the language and region format used to resolve translations.
532532

533533
* **`setLocale(locale: string)`**
534534

535535
A method to change the current locale. When called, it updates the locale across the application.
536536

537537
##### `TranslationProvider` component
538538

539-
The `TranslationProvider` component is a context provider that wraps your app to supply localization features. It allows for managing the current locale and provides a mechanism to update it across your app.
539+
The `TranslationProvider` component is a context provider that wraps your app to supply localization features. It manages the current locale and provides a mechanism to update it across your app.
540540

541541
#### `TranslationProviderProps`
542542

543543
* **`children: ReactNode`**
544544

545-
The child components that are wrapped by the `TranslationProvider`, and have access to the translation context.
545+
The child components wrapped by the `TranslationProvider`, which have access to the translation context.
546546

547547
* **`defaultLocale?: Languages`**
548548

549-
(Optional) The default locale to be set when the provider initializes. If not provided, the default locale is set to `'en-US'`.
549+
(Optional) The default locale to use when the provider initializes. If not provided, the default locale defaults to `'en-US'`.
550550

551551
#### Usage
552552

@@ -563,7 +563,7 @@ const App = () => (
563563

564564
#### Syncing translation files
565565

566-
To keep all translation files with the same shape, we provide a script to sync the files automatically. After adding default translations (en-US), to generate the same keys for other languages and provide proper values, run the following command.
566+
To keep all translation files with the same shape, the project provides a script to sync the files automatically. After adding default translations (en-US), to generate the same keys for other languages and provide proper values, run the following command.
567567

568568
```
569569
npm run i18n:sync

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module.exports = (api) => {
5757
plugins.push('transform-remove-console');
5858
}
5959

60-
const presets = ['module:metro-react-native-babel-preset'];
60+
const presets = ['module:@react-native/babel-preset'];
6161

6262
return {
6363
presets,

jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
],
3232
"testPathIgnorePatterns": ["src/w3cmedia/shakaplayer/dist"],
3333
"transformIgnorePatterns": [
34-
"node_modules/(?!(jest-)?react-native|@react-native|@amazon-devices/kepler-ui-components|@amazon-devices/react-native-kepler|@amazon-devices/lottie-react-native|@amazon-devices/react-navigation|@amazon-devices/react-native-reanimated|@amazon-devices/react-native-gesture-handler|@amazon-devices/react-navigation__drawer|@amazon-devices/react-linear-gradient|iso-639-3)"
34+
"node_modules/(?!(jest-)?react-native|@react-native|@amazon-devices|@shopify/flash-list|recyclerlistview|iso-639-3)"
3535
],
3636
"coverageDirectory": ".tmp/coverage",
3737
"globals": {

0 commit comments

Comments
 (0)