forked from akshay2211/PixImagePicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Options for custom path to change image locations
- Loading branch information
1 parent
6e6dec2
commit 9f317d6
Showing
5 changed files
with
123 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.fxn.pix; | ||
|
||
import java.io.Serializable; | ||
|
||
public class Options implements Serializable { | ||
private static Options options; | ||
private int count = 1; | ||
private int requestCode = 0; | ||
private String path = "/DCIM/Camera"; | ||
|
||
private Options() { | ||
} | ||
|
||
public static Options init() { | ||
Options.options = new Options(); | ||
return Options.options; | ||
} | ||
|
||
private static void check() { | ||
if (Options.options == null) { | ||
throw new NullPointerException("call init() method to initialise Options class"); | ||
} | ||
} | ||
|
||
public int getCount() { | ||
return count; | ||
} | ||
|
||
public Options setCount(int count) { | ||
check(); | ||
Options.options.count = count; | ||
return Options.options; | ||
} | ||
|
||
public int getRequestCode() { | ||
if (requestCode == 0) { | ||
throw new NullPointerException("requestCode in Options class is null"); | ||
} | ||
return requestCode; | ||
} | ||
|
||
public Options setRequestCode(int requestcode) { | ||
check(); | ||
Options.options.requestCode = requestcode; | ||
return Options.options; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public static Options setPath(String path) { | ||
check(); | ||
Options.options.path = path; | ||
return Options.options; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters