Comments (5)
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.
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.
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.
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.
@scottmeschke I agree with the sentiment, not a good fit for this library.
from android-ktx.
Related Issues (20)
- Convenience DSL for Media Controller Callback event handling
- androidx.preference.PreferenceFragment not derived from androidx.fragment.app.Fragment HOT 2
- Manifest merger failed HOT 5
- Release of 1.0.0-alpha3 out of sync with this repo HOT 4
- Extension property of bitmap from ImageView HOT 1
- error: resource android:attr/fontVariationSettings not found. HOT 1
- ImageDecoder source and test issues HOT 7
- inline extension properties can't be used in SAM lambda functions due to compiler bug HOT 1
- Add popular libraries extensions in new module HOT 1
- AAPT2 Error HOT 1
- View.post with with this view as a parameter HOT 2
- Resources.Theme.resolveAttribute extension
- Improve View.doOnPreDraw(...) HOT 1
- Features suggestions: Live data transformation HOT 1
- Offer: AsyncTask replacement
- Can't use getString(String) : String HOT 2
- androidx.core.os.BundleKt.bundleOf: Imports for API 21 classes break on older devices HOT 2
- gradle error HOT 3
- Add support for manipulating a color as HSV HOT 1
- Hi everyone!
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 android-ktx.