Skip to content

Have common builder  #13

@levibostian

Description

@levibostian

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:

  1. add a function build() that builds to a common object that you can then call snap() on.
  2. Will a kotlin DSL allow me to solve this problem from a different angle?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions