Skip to content

Commit 23cc6d6

Browse files
Update README.md
1 parent a9fb0de commit 23cc6d6

File tree

1 file changed

+20
-47
lines changed

1 file changed

+20
-47
lines changed

README.md

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,65 +20,38 @@ Shows a DialogFragment with Camera or Gallery options. The user can choose from
2020
#### Step 2. Add the dependency
2121

2222
dependencies {
23-
compile 'com.github.test:PickImage:v2.0.0'
23+
2424
}
2525

2626
# Samples
27-
You can take a look at the sample app [located on this project](/app/).
27+
You can take a look at the sample by downloading this repository.
2828

2929

3030
# Implementation
3131

32-
### Step #1 - Show the dialog.
33-
PickImageDialog.on(MainActivity.this, new PickSetup());
34-
35-
//or
32+
### Step #1 - Create instance of the Popup Class
33+
34+
ImagePopup imagePopup = new ImagePopup(this);
3635

37-
PickImageDialog.on(getSupportFragmentManager(), new PickSetup());
3836

39-
### Step #2 - Applying the listeners.
37+
### Step #2 - Examples
4038

41-
@Override
42-
public void onPickResult(PickResult r) {
43-
if (r.getError() == null) {
44-
ImageView imageView = ((ImageView) findViewById(R.id.result_image));
45-
46-
//If you want the Bitmap.
47-
imageView.setImageBitmap(r.getBitmap());
48-
49-
//If you want the Uri.
50-
//Mandatory to refresh image from Uri.
51-
imageView.setImageURI(null);
52-
53-
//Setting the real returned image.
54-
imageView.setImageURI(r.getUri());
55-
} else {
56-
//Handle possible errors
57-
//TODO: do what you have to do with r.getError();
58-
}
59-
}
60-
39+
/** Set popup height, width & background color as you want **/
6140

41+
final ImagePopup imagePopup = new ImagePopup(this);
42+
imagePopup.setBackgroundColor(Color.BLACK);
43+
imagePopup.setWindowWidth(800);
44+
imagePopup.setWindowHeight(800);
6245

63-
# Additionals
64-
65-
### Own click implementations.
66-
If you want to write your own pick images functionalities, your class have to implements IPickClick like in the example below.
67-
You may want to take a look at the sample app.
68-
69-
@Override
70-
public void onGalleryClick() {
71-
//TODO: Your onw implementation
72-
}
73-
74-
@Override
75-
public void onCameraClick() {
76-
//TODO: Your onw implementation
77-
}
78-
79-
## How to dismiss the dialog.
80-
PickImageDialog dialog = PickImageDialog.on(...);
81-
dialog.dismiss();
46+
final ImageView imageView = (ImageView) findViewById(R.id.imageView);
47+
imageView.setOnClickListener(new View.OnClickListener() {
48+
@Override
49+
public void onClick(View view) {
50+
/** Initiate Popup view **/
51+
imagePopup.initiatePopup(imageView.getDrawable());
52+
}
53+
});
54+
8255

8356
## Credits
8457
[Stack Overflow](http://stackoverflow.com)

0 commit comments

Comments
 (0)