Skip to content

Commit

Permalink
Merge pull request #6 from pawanchauhan05/0.0.2
Browse files Browse the repository at this point in the history
0.0.2
  • Loading branch information
pawanchauhan05 authored Feb 21, 2017
2 parents b6dc865 + 1708654 commit 076ca69
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Android Utility is combination of normal utility functions like described below

```
dependencies {
compile 'com.github.pawanchauhan05:utility:0.0.2-beta1'
compile 'com.github.pawanchauhan05:utility:0.0.2'
}
```
## How to use ?
Expand Down Expand Up @@ -280,7 +280,7 @@ public class TestFragment extends Fragment implements RuntimePermissionInitializ
>**_"implement RuntimePermissionInitializerInterface, override onRequestPermissionsResult(), onActivityResult() method is compulsory."_**
## Release Notes
### v0.0.2-beta1
### v0.0.2
* Bug fixes
* Show short or long length snackbar
* Alert Dialog
Expand Down
2 changes: 1 addition & 1 deletion utility/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/pawanchauhan05/AndroidUtility'
gitUrl = 'https://github.com/pawanchauhan05/AndroidUtility.git'

libraryVersion = '0.0.2-beta1'
libraryVersion = '0.0.2'

developerId = 'pawanchauhan05'
developerName = 'Pawan Singh Chauhan'
Expand Down
1 change: 1 addition & 0 deletions utility/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />

<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">
Expand Down
12 changes: 10 additions & 2 deletions utility/src/main/java/com/android/utility/AlertDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,23 @@ private static void selectedFromCamera() {
Intent intent = new Intent("com.android.camera.action.CROP");
Uri uri = Uri.fromFile(new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC), photoFileName));
intent.setDataAndType(uri, "image/*");
activity.startActivityForResult(getCropIntent(intent), CAMERA_REQUEST);
if(activity instanceof RuntimePermissionInitializerInterface)
activity.startActivityForResult(getCropIntent(intent), CAMERA_REQUEST);
else if(fragment instanceof RuntimePermissionInitializerInterface)
fragment.startActivityForResult(getCropIntent(intent), CAMERA_REQUEST);


}

private static void selectedFromGallery(Intent data) {
if(data != null) {
Intent intent = new Intent("com.android.camera.action.CROP");
Uri selectedImage = data.getData();
intent.setDataAndType(Uri.fromFile(new File(getPath(selectedImage, activity))), "image/*");
activity.startActivityForResult(getCropIntent(intent), CAMERA_REQUEST);
if(activity instanceof RuntimePermissionInitializerInterface)
activity.startActivityForResult(getCropIntent(intent), CAMERA_REQUEST);
else if(fragment instanceof RuntimePermissionInitializerInterface)
fragment.startActivityForResult(getCropIntent(intent), CAMERA_REQUEST);
}
}

Expand Down

0 comments on commit 076ca69

Please sign in to comment.