-
Notifications
You must be signed in to change notification settings - Fork 6
Have common builder #13
Copy link
Copy link
Open
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels