NativeScript / NativeScript/plugins

[@nativescript/brightness] Obtained values bigger than allowed

Open
#536 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

Manually setting my brightness to a 100% using the system UI and just running this on an Android device:

const brightness = new Brightness();
console.log(brightness.get());
console.log(brightness.getNative());

returns the following values:

JS: 803
JS: 2047

Aren't the allowed values from 0-100 and 0-255? (from the docs)

As a consequence, setting the value programatically to the highest allowed value (100) in my case results in the following brightness indicator, which should be on 100%:

This might probably be related 🤔

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @nativescript/brightness Android implementation and trace the get() and getNative() paths that produce the reported values. Compare those results with the documented 0–100 and 0–255 ranges, then verify that setting the documented maximum reaches the expected system brightness on Android.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.