levibostian / levibostian/Shutter-Android
Have common builder
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 58
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
Here is a code sample of what I am trying to do:
var shutterBuilder = Shutter.with(this)
if (useCamera) shutterBuilder = shutterBuilder.takePhoto().usePrivateAppExternalStorage()
else shutterBuilder = shutterBuilder.getPhotoFromGallery()
shutterResult = shutterBuilder
.snap(object : ShutterResultCallback {
I am trying to dynamically choose what builder I use. Depending on boolean variable useCamera.
Problem is I cannot do this because the builder objects being returned from each are not common.
What I could do:
- add a function
build()that builds to a common object that you can then callsnap()on. - Will a kotlin DSL allow me to solve this problem from a different angle?
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 at the Shutter.with(this) entry point and compare the builder types returned by takePhoto().usePrivateAppExternalStorage() and getPhotoFromGallery(). Define what a common result should expose for the subsequent snap call, then verify the proposed API against both branches shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100