Comments (9)
Hello @nikunjbhatt
Please check the Media -> Camera example.
The current implementation needs the camera to be active in order to turn on the flash, since it uses an old Android implementation.
I'm aware that is possible to turn on the flash without the camera, I will add that to the TODO list and include it for the next release.
Maybe you can work with the camera example for now :)
Thanks for the report!
from phonk.
Ok. Got it. Thanks for quick reply.
from phonk.
@nikunjbhatt I agree It's better without the verb. Thanks for the suggestion :)
from phonk.
You can now turn on/off the flash light using
device.flashLight(boolean)
Feel free to check it and close the issue if it's the expected behaviour. Thanks!
from phonk.
I don't have much idea about Android development, but as per you said that old Android implementation needed active camera to work with flash, which means new Android implementation doesn't require active camera then I think the API should be changed to device.turnOnFlash(boolean)
instead of camera.turnOnFlash(boolean)
. Also, I suggest to remove the word On
from the function name, or even remove the words turnOn
, to make it just device.flash(boolean)
.
from phonk.
That's a good idea!
On the other side, there is some devices that have multiple flash lights (front and rear), so I think is good that the camera has its own method to turn on the flash light.
I will check how is turning the flash without the Camera and include it. It makes sense to include it inside the device object.
I like to have an action verb for some methods, so maybe device.activateFlash(boolean)
might sound ok?
from phonk.
@victordiaz
Sorry for very late replying, I had completely forgot.
I don't think using verb in methods which are doing toggling things is good. Or there should be 2 different methods for 2 different states, for example: device.activateFlash()
and device.deactivateFlash()
.
from phonk.
@victordiaz
Thanks. It's working!
By the way, in the README.me of the PHONK repo, you have told to contact you by email but I can't find your email anywhere, not in the README.md file, not in your GitHub profile, not on your personal website, not on the phonk.app website!
May I know how the reference documentation is generated? In the reference documentation, it is showing as String
for all parameters for ui.addToggle()
function (and for many other functions), but actually the text
param is an Array
(of String
) and the other params, w h x y
, are of type object. So, how to show them correctly in the reference documentation? Is it a problem of the documentation generator or improper documentation in the code files?
from phonk.
Hi @nikunjbhatt
Feel free to join this discord server so we can chat https://discord.gg/Rt2mkWp
I'm sorry if there is things missing everywhere, I lack a bit of time to put everything nicely :)
Regarding the documentation. Is it generated with and older version of Java and I had a mess in my system since it updated Java and now the generator does not want to run :/ so the docs are generated some time ago and many methods have changed since then.
It would be nice to dockerize the generator so I can run it easily before a new release and things can be up-to-date
from phonk.
Related Issues (20)
- orientation: app.conf HOT 1
- screen always on HOT 1
- TOOLBOX
- Sending Byte arrays through BLE
- Site: phone.app - certificate expired on 11/10/2021 HOT 3
- No example for sms send/receive HOT 2
- vertical slider and midi device examples HOT 1
- Can not access the webpage HOT 1
- getting started link on README does not work HOT 1
- Voice recognition without the recognizer's UI HOT 1
- Is it possible in PHONK to create a transparent widget that hovers over other activities ... HOT 1
- How to do linear layouts?
- `PHttpServer` and `PFtpServer` won't be stopped
- TypeScript declaration HOT 3
- Multithreading HOT 4
- Widget TextList: text size doesn't apply HOT 2
- `NativeArray.subarray` is broken
- Widget `.text()` and `.html()` don't set `.props.text` HOT 12
- `PLinearLayout.add` with weight doesn't work
- android.local:8585
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phonk.