Giter Club home page Giter Club logo

Comments (9)

victordiaz avatar victordiaz commented on May 11, 2024 1

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.

nikunjbhatt avatar nikunjbhatt commented on May 11, 2024 1

Ok. Got it. Thanks for quick reply.

from phonk.

victordiaz avatar victordiaz commented on May 11, 2024 1

@nikunjbhatt I agree It's better without the verb. Thanks for the suggestion :)

from phonk.

victordiaz avatar victordiaz commented on May 11, 2024 1

@nikunjbhatt

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.

nikunjbhatt avatar nikunjbhatt commented on May 11, 2024

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.

victordiaz avatar victordiaz commented on May 11, 2024

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.

nikunjbhatt avatar nikunjbhatt commented on May 11, 2024

@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.

nikunjbhatt avatar nikunjbhatt commented on May 11, 2024

@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.

victordiaz avatar victordiaz commented on May 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.