Skip to content

Commit 1333fbc

Browse files
committed
Fix merge and added iOS code
1 parent 54b3648 commit 1333fbc

File tree

40 files changed

+348
-415
lines changed

40 files changed

+348
-415
lines changed

.metadata

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
<<<<<<< HEAD
8-
revision: 20e59316b8b8474554b38493b8ca888794b0234a
9-
channel: stable
10-
=======
117
revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
128
channel: beta
13-
>>>>>>> 4d92dc5f90835ff359f6354c50e7a5e4ac764ace
149

1510
project_type: plugin

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
1+
## 0.2.6
2+
3+
* Some iOS fix
4+
15
## 0.2.5
26

37
* Added iOS code made by @Bhagatcliffex
48

59
## 0.2.4
10+
11+
* Added new method that returns the file without saving it in the gallery
12+
13+
## 0.2.3
14+
15+
* Fixed bug that makes the app crash when deny the permissions
16+
17+
## 0.2.2
18+
19+
* Fixed the way of request the permissions
20+
21+
## 0.2.1
22+
23+
* Fixed bug on permissions
24+
25+
## 0.2.0
26+
27+
* Migrate to AndroidX on android support library.
28+
If you are using the android support library and you want to use that version, you should migrate to Androidx your project.
29+
30+
## 0.1.1
31+
32+
* Some changes on readme.md
33+
34+
## 0.1.0
35+
36+
* Initial release

LICENSE

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
TODO: Add your license here.
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, Nadia Ghebreial
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
group 'com.cliffex.flutter_exif_rotation'
1+
group 'io.flutter.plugins.flutterexifrotation'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
@@ -26,13 +26,13 @@ android {
2626

2727
defaultConfig {
2828
minSdkVersion 16
29-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
29+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3030
}
3131
lintOptions {
3232
disable 'InvalidPackage'
3333
}
3434
}
3535

3636
dependencies {
37-
implementation 'androidx.core:core:1.0.2'
37+
api 'androidx.core:core:1.0.0'
3838
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.cliffex.flutter_exif_rotation">
3-
</manifest>
1+
<manifest package="io.flutter.plugins.flutterexifrotation"></manifest>

android/src/main/java/com/cliffex/flutter_exif_rotation/FlutterExifRotationPlugin.java renamed to android/src/main/java/io/flutter/plugins/flutterexifrotation/FlutterExifRotationPlugin.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.cliffex.flutter_exif_rotation;
1+
package io.flutter.plugins.flutterexifrotation;
22

33
import android.Manifest;
44
import android.app.Activity;
@@ -8,7 +8,6 @@
88
import android.graphics.Matrix;
99
import android.media.ExifInterface;
1010
import android.provider.MediaStore;
11-
import android.util.Log;
1211

1312
import androidx.core.app.ActivityCompat;
1413

@@ -27,6 +26,8 @@
2726
* FlutterExifRotationPlugin
2827
*/
2928
public class FlutterExifRotationPlugin implements MethodCallHandler, PluginRegistry.RequestPermissionsResultListener {
29+
30+
3031
private final Registrar registrar;
3132

3233
private Result result;
@@ -35,8 +36,7 @@ public class FlutterExifRotationPlugin implements MethodCallHandler, PluginRegis
3536
private final PermissionManager permissionManager;
3637

3738

38-
static final int REQUEST_EXTERNAL_IMAGE_STORAGE_PERMISSION = 2344;
39-
39+
static final int REQUEST_EXTERNAL_IMAGE_STORAGE_PERMISSION = 23483;
4040

4141
interface PermissionManager {
4242
boolean isPermissionGranted(String permissionName);
@@ -116,7 +116,7 @@ public void rotateImage() {
116116

117117
if (!permissionManager.isPermissionGranted(Manifest.permission.READ_EXTERNAL_STORAGE) ||
118118
!permissionManager.isPermissionGranted(Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
119-
Log.w("rotateImage", "rotate image request permission");
119+
120120
permissionManager.askForPermission(new String[]{
121121
Manifest.permission.READ_EXTERNAL_STORAGE,
122122
Manifest.permission.WRITE_EXTERNAL_STORAGE},
@@ -172,12 +172,11 @@ public void launchRotateImage() {
172172
fOut.flush(); // Not really required
173173
fOut.close(); // do not forget to close the stream
174174

175-
if (save)
175+
if( save )
176176
MediaStore.Images.Media.insertImage(registrar.activity().getContentResolver(), file.getAbsolutePath(), file.getName(), file.getName());
177177

178178
result.success(file.getPath());
179179
} catch (IOException e) {
180-
Log.w("rotateImage error", e.getMessage() + "");
181180
result.error("error", "IOexception", null);
182181
e.printStackTrace();
183182
}
@@ -190,5 +189,4 @@ private static Bitmap rotate(Bitmap source, float angle) {
190189
return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(),
191190
matrix, true);
192191
}
193-
194192
}

example/.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Miscellaneous
22
*.class
3+
*.lock
34
*.log
45
*.pyc
56
*.swp
@@ -15,10 +16,8 @@
1516
*.iws
1617
.idea/
1718

18-
# The .vscode folder contains launch configuration and tasks you configure in
19-
# VS Code which you may wish to be included in version control, so this line
20-
# is commented out by default.
21-
#.vscode/
19+
# Visual Studio Code related
20+
.vscode/
2221

2322
# Flutter/Dart/Pub related
2423
**/doc/api/
@@ -27,7 +26,7 @@
2726
.packages
2827
.pub-cache/
2928
.pub/
30-
/build/
29+
build/
3130

3231
# Android related
3332
**/android/**/gradle-wrapper.jar

example/.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 20e59316b8b8474554b38493b8ca888794b0234a
8-
channel: stable
7+
revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
8+
channel: beta
99

1010
project_type: app

example/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ This project is a starting point for a Flutter application.
88

99
A few resources to get you started if this is your first Flutter project:
1010

11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
11+
- [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook)
1313

14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
14+
For help getting started with Flutter, view our
15+
[online documentation](https://flutter.io/docs), which offers tutorials,
1616
samples, guidance on mobile development, and a full API reference.

example/android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ android {
3333

3434
defaultConfig {
3535
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36-
applicationId "com.cliffex.flutter_exif_rotation_example"
36+
applicationId "io.flutter.plugins.flutterexifrotationexample"
3737
minSdkVersion 16
3838
targetSdkVersion 28
3939
versionCode flutterVersionCode.toInteger()
4040
versionName flutterVersionName
41-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
41+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4242
}
4343

4444
buildTypes {
@@ -56,6 +56,6 @@ flutter {
5656

5757
dependencies {
5858
testImplementation 'junit:junit:4.12'
59-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
60-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
59+
androidTestImplementation 'androidx.test:runner:1.1.0'
60+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
6161
}

0 commit comments

Comments
 (0)