Coder Social home page Coder Social logo

Comments (5)

scottroemeschke avatar scottroemeschke commented on June 25, 2024 2

Things like permissions, and other complex APIs (Fingerprint is another good example) may not be right for this library.

You could redesign permissions API essentially in Kotlin in 10 different ways, (for instance a sealed class PermissionsResult type or a bunch of callback-lamdas you pass in) all of them Kotlin-y and simpler than existing API.

And it might even be a "better" API for the average dev.

But it would be rather opinionated, and heavy. And lots of methods/classes etc wrapping the functionality.

Not sure if those sorts of things are the goal for android-ktx or should be separate libraries. I would think the goal would be relatively non-opinionated straightforward extensions/functions (not API redesigns)

from android-ktx.

kevinmost avatar kevinmost commented on June 25, 2024

If it's going to be vararg, wouldn't it be useful to know which permissions are granted or not? If there's going to be an extension to handle this, as well, would it be useful to know if a rationale should be shown (ie, if the user declined the permission just once or permanently)?

from android-ktx.

davethomas11 avatar davethomas11 commented on June 25, 2024

Yes perhaps being returned the boolean plus information would be helpful. I'd ignore the permissions which are being granted in most cases, and just care that they were all present for the action I want to execute.

I'm ok with handling rationale outside of the extension beforehand if needed.

from android-ktx.

JakeWharton avatar JakeWharton commented on June 25, 2024

I have a hard time seeing how this could work. It seems like a much better target for coroutines where the suspending nature of a function could be made apparent. The suggested approach does not convey the asynchronous nature of the block nor provides a mechanism for stopping the operation.

from android-ktx.

davethomas11 avatar davethomas11 commented on June 25, 2024

@scottmeschke I agree with the sentiment, not a good fit for this library.

from android-ktx.

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.