@@ -20,65 +20,38 @@ Shows a DialogFragment with Camera or Gallery options. The user can choose from
20
20
#### Step 2. Add the dependency
21
21
22
22
dependencies {
23
- compile 'com.github.test:PickImage:v2.0.0'
23
+
24
24
}
25
25
26
26
# 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 .
28
28
29
29
30
30
# Implementation
31
31
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);
36
35
37
- PickImageDialog.on(getSupportFragmentManager(), new PickSetup());
38
36
39
- ### Step #2 - Applying the listeners.
37
+ ### Step #2 - Examples
40
38
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 **/
61
40
41
+ final ImagePopup imagePopup = new ImagePopup(this);
42
+ imagePopup.setBackgroundColor(Color.BLACK);
43
+ imagePopup.setWindowWidth(800);
44
+ imagePopup.setWindowHeight(800);
62
45
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
+
82
55
83
56
## Credits
84
57
[ Stack Overflow] ( http://stackoverflow.com )
0 commit comments