Skip to content

Commit 3d55fb0

Browse files
committed
Update merged docs via GitHub Action
1 parent 5f09d71 commit 3d55fb0

3 files changed

Lines changed: 175 additions & 0 deletions

File tree

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Ensemble provides a browser-based IDE, [Ensemble Studio](https://studio.ensemble
218218
- [stopTimer](#stoptimer)
219219
- [takeScreenshot](#takescreenshot)
220220
- [uploadFiles](#uploadfiles)
221+
- [wakelock](#wakelock)
221222
- **Utilities**
222223
- [Formatter](#formatter)
223224
- [Device](#device)
@@ -16246,6 +16247,71 @@ complete example [here](https://studio.ensembleui.com/app/e24402cb-75e2-404c-866
1624616247

1624716248
---
1624816249

16250+
# wakelock
16251+
16252+
The wakelock action controls the device's screen wakelock, preventing the screen from automatically turning off while the app is in use. This is particularly useful for apps that display information users need to view continuously without interaction, such as recipe apps, navigation, or presentation modes.
16253+
16254+
### Properties
16255+
16256+
| Property | Type | Description |
16257+
| :--------- | :------ | :---------------------------------------------------------------------------------------------------- |
16258+
| enable | boolean | Controls the wakelock state. `true` to keep screen on, `false` to allow normal screen timeout. (default: true) |
16259+
| onComplete | action | Callback Action executed after the wakelock state is successfully changed |
16260+
| onError | action | Callback Action if wakelock operation fails. Error details available under 'error' field |
16261+
16262+
**Example**
16263+
16264+
```yaml
16265+
View:
16266+
header:
16267+
title: Wakelock Control
16268+
body:
16269+
Column:
16270+
styles: { gap: 16, padding: 24 }
16271+
children:
16272+
- Button:
16273+
label: Enable Wakelock
16274+
onTap:
16275+
wakelock:
16276+
enable: true
16277+
onComplete: |
16278+
//@code
16279+
status.text = 'Wakelock enabled - screen will stay on';
16280+
onError: |
16281+
//@code
16282+
status.text = 'Error: ' + error;
16283+
- Button:
16284+
label: Disable Wakelock
16285+
onTap:
16286+
wakelock:
16287+
enable: false
16288+
onComplete: |
16289+
//@code
16290+
status.text = 'Wakelock disabled - normal screen timeout';
16291+
- Button:
16292+
label: Check Wakelock Status
16293+
onTap: |
16294+
//@code
16295+
status.text = 'Wakelock is ' + (device.wakelockEnabled ? 'enabled' : 'disabled');
16296+
- Text:
16297+
id: status
16298+
text: Press a button to control wakelock
16299+
```
16300+
16301+
### Use Cases
16302+
16303+
- **Recipe/Cooking Apps**: Keep the screen on while users are following cooking instructions
16304+
- **Navigation**: Prevent screen timeout during route guidance
16305+
- **Presentations**: Keep display active during slideshows or demonstrations
16306+
- **Reading Apps**: Allow continuous reading without screen dimming
16307+
- **Fitness Apps**: Keep workout instructions visible during exercise sessions
16308+
16309+
### Note
16310+
16311+
The wakelock state can be checked at any time using `device.wakelockEnabled`, which returns `true` if the wakelock is currently active and `false` otherwise.
16312+
16313+
---
16314+
1624916315
# Formatter
1625016316

1625116317
Ensemble provide convenience formatter utilities for handling date/time and common tasks.
@@ -20300,6 +20366,27 @@ View:
2030020366
text: Size of bottom area used by device is ${device.safeAreaBottom}
2030120367
```
2030220368

20369+
## device.wakelockEnabled
20370+
20371+
Returns a boolean indicating whether the device's screen wakelock is currently active. When the wakelock is enabled (`true`), the screen will not automatically turn off due to inactivity. When disabled (`false`), the device follows its normal screen timeout settings.
20372+
20373+
```yaml
20374+
View:
20375+
body:
20376+
Column:
20377+
styles: { gap: 16, padding: 24 }
20378+
children:
20379+
- Text:
20380+
text: Wakelock is ${device.wakelockEnabled ? 'enabled' : 'disabled'}
20381+
- Button:
20382+
label: Toggle Wakelock
20383+
onTap:
20384+
wakelock:
20385+
enable: ${!device.wakelockEnabled}
20386+
```
20387+
20388+
This property is useful for checking the current wakelock state before toggling it or displaying the status to users. See the [wakelock action](#wakelock) for controlling the wakelock state.
20389+
2030320390
---
2030420391

2030520392
# Getting help from Ensemble team

public/llms-full.txt

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Ensemble provides a browser-based IDE, [Ensemble Studio](https://studio.ensemble
218218
- [stopTimer](#stoptimer)
219219
- [takeScreenshot](#takescreenshot)
220220
- [uploadFiles](#uploadfiles)
221+
- [wakelock](#wakelock)
221222
- **Utilities**
222223
- [Formatter](#formatter)
223224
- [Device](#device)
@@ -16246,6 +16247,71 @@ complete example [here](https://studio.ensembleui.com/app/e24402cb-75e2-404c-866
1624616247

1624716248
---
1624816249

16250+
# wakelock
16251+
16252+
The wakelock action controls the device's screen wakelock, preventing the screen from automatically turning off while the app is in use. This is particularly useful for apps that display information users need to view continuously without interaction, such as recipe apps, navigation, or presentation modes.
16253+
16254+
### Properties
16255+
16256+
| Property | Type | Description |
16257+
| :--------- | :------ | :---------------------------------------------------------------------------------------------------- |
16258+
| enable | boolean | Controls the wakelock state. `true` to keep screen on, `false` to allow normal screen timeout. (default: true) |
16259+
| onComplete | action | Callback Action executed after the wakelock state is successfully changed |
16260+
| onError | action | Callback Action if wakelock operation fails. Error details available under 'error' field |
16261+
16262+
**Example**
16263+
16264+
```yaml
16265+
View:
16266+
header:
16267+
title: Wakelock Control
16268+
body:
16269+
Column:
16270+
styles: { gap: 16, padding: 24 }
16271+
children:
16272+
- Button:
16273+
label: Enable Wakelock
16274+
onTap:
16275+
wakelock:
16276+
enable: true
16277+
onComplete: |
16278+
//@code
16279+
status.text = 'Wakelock enabled - screen will stay on';
16280+
onError: |
16281+
//@code
16282+
status.text = 'Error: ' + error;
16283+
- Button:
16284+
label: Disable Wakelock
16285+
onTap:
16286+
wakelock:
16287+
enable: false
16288+
onComplete: |
16289+
//@code
16290+
status.text = 'Wakelock disabled - normal screen timeout';
16291+
- Button:
16292+
label: Check Wakelock Status
16293+
onTap: |
16294+
//@code
16295+
status.text = 'Wakelock is ' + (device.wakelockEnabled ? 'enabled' : 'disabled');
16296+
- Text:
16297+
id: status
16298+
text: Press a button to control wakelock
16299+
```
16300+
16301+
### Use Cases
16302+
16303+
- **Recipe/Cooking Apps**: Keep the screen on while users are following cooking instructions
16304+
- **Navigation**: Prevent screen timeout during route guidance
16305+
- **Presentations**: Keep display active during slideshows or demonstrations
16306+
- **Reading Apps**: Allow continuous reading without screen dimming
16307+
- **Fitness Apps**: Keep workout instructions visible during exercise sessions
16308+
16309+
### Note
16310+
16311+
The wakelock state can be checked at any time using `device.wakelockEnabled`, which returns `true` if the wakelock is currently active and `false` otherwise.
16312+
16313+
---
16314+
1624916315
# Formatter
1625016316

1625116317
Ensemble provide convenience formatter utilities for handling date/time and common tasks.
@@ -20300,6 +20366,27 @@ View:
2030020366
text: Size of bottom area used by device is ${device.safeAreaBottom}
2030120367
```
2030220368

20369+
## device.wakelockEnabled
20370+
20371+
Returns a boolean indicating whether the device's screen wakelock is currently active. When the wakelock is enabled (`true`), the screen will not automatically turn off due to inactivity. When disabled (`false`), the device follows its normal screen timeout settings.
20372+
20373+
```yaml
20374+
View:
20375+
body:
20376+
Column:
20377+
styles: { gap: 16, padding: 24 }
20378+
children:
20379+
- Text:
20380+
text: Wakelock is ${device.wakelockEnabled ? 'enabled' : 'disabled'}
20381+
- Button:
20382+
label: Toggle Wakelock
20383+
onTap:
20384+
wakelock:
20385+
enable: ${!device.wakelockEnabled}
20386+
```
20387+
20388+
This property is useful for checking the current wakelock state before toggling it or displaying the status to users. See the [wakelock action](#wakelock) for controlling the wakelock state.
20389+
2030320390
---
2030420391

2030520392
# Getting help from Ensemble team

public/llms.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ Ensemble is a platform where you can build, publish, and iterate native and web
181181
- [stopTimer](https://docs.ensembleui.com/actions/stop-timer)
182182
- [takeScreenshot](https://docs.ensembleui.com/actions/take-screenshot)
183183
- [uploadFiles](https://docs.ensembleui.com/actions/upload-files)
184+
- [wakelock](https://docs.ensembleui.com/actions/wakelock)
184185
- [Formatter](https://docs.ensembleui.com/utilities/formatter)
185186
- [Device](https://docs.ensembleui.com/utilities/device)
186187
- [checkPermission](https://docs.ensembleui.com/device-capabilities/check-permission)

0 commit comments

Comments
 (0)