NativeScript / NativeScript/plugins
[@nativescript/brightness] Obtained values bigger than allowed
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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