Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mehul.cmexpertise committed Jan 18, 2018
2 parents 86ba2af + 6fb3568 commit 456d749
Showing 1 changed file with 16 additions and 26 deletions.
42 changes: 16 additions & 26 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,28 @@
<p>Step 2. Add the dependency</p>

<p> dependencies {<br />
compile 'com.github.mehulTank:ImageSelection:V.1.0'<br />
compile 'com.github.mehulTank:ImageSelection:V.2.0'<br />
}</p>

<p>
</br>
<p>imageSelection = new ImageSelection(MainActivity.this);</p>

<p>Select Image Dialog </p>
<p>// open camera boolean isComprase = true; <br />
imageSelection.openCamera(isComprase);</p>

<p> public void selectImage() {</p>
<p>// open gallary<br />
boolean isComprase = true;<br />
imageSelection.openGallery(isComprase);</p>

<p> imageSelection = new ImageSelection(MainActivity.this);<br />
final CharSequence[] items = {"Take Photo", "Choose from Library",<br />
"Cancel"};<br />
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);<br />
builder.setTitle("Add Photo!");<br />
builder.setItems(items, new DialogInterface.OnClickListener() {<br />
@Override<br />
public void onClick(DialogInterface dialog, int item) {</p>

<p>
if (items[item].equals("Take Photo")) {<br />
boolean isComprase = true;<br />
imageSelection.openCamera(isComprase);</p>

<p> } else if (items[item].equals("Choose from Library")) {<br />
boolean isComprase = true;<br />
imageSelection.openGallery(isComprase);<br />
} else if (items[item].equals("Cancel")) {<br />
dialog.dismiss();<br />
}<br />
}<br />
});<br />
builder.show();<br />
}</p>
<p>After that you need to implement ImageResult Interface.</p>

<p>then after you get uri of the image in that method.</p>


<p>On Activity Result Call Image Processing method</p>

<p> imageSelection.imageProcessing(requestCode, resultCode, data);</p>

</p>

0 comments on commit 456d749

Please sign in to comment.