Skip to content

Commit a933b52

Browse files
committed
Change minimum SDK to API 16
1 parent e1c076f commit a933b52

File tree

9 files changed

+25
-33
lines changed

9 files changed

+25
-33
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ allprojects {
1717
2. Add the dependency in your module-level build.gradle
1818
```groovy
1919
dependencies {
20-
compile 'com.github.hkk595:Resizer:v1.2'
20+
compile 'com.github.hkk595:Resizer:v1.3'
2121
}
2222
```
2323

@@ -40,7 +40,7 @@ Bitmap resizedImage = new Resizer(this)
4040
```
4141
Note: You only need to specify the target length (in pixel) of the longer side of the image. Resizer will calculate the rest automatically.
4242

43-
#### Using RxJava to get the resized image asynchronously
43+
#### Using RxJava 2 with RxAndroid to get the resized image asynchronously
4444
```java
4545
final File[] resizedImage = new File[1];
4646
new Resizer(this)
@@ -87,7 +87,7 @@ new Resizer(this)
8787
Note: You don't need to declare the new image as final nor array if it is an instance variable of the class, instead of a local variable in a function.
8888

8989
#### Library specification
90-
Minimum SDK: API 21
90+
Minimum SDK: API 16
9191
9292
Default settings:
9393
targetLength: 1080

app/build.gradle

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ apply plugin: 'com.github.dcendents.android-maven'
44
group='com.github.hkk595'
55

66
android {
7-
compileSdkVersion 25
8-
buildToolsVersion "25.0.2"
7+
compileSdkVersion 26
98
defaultConfig {
10-
minSdkVersion 21
11-
targetSdkVersion 25
9+
minSdkVersion 16
10+
targetSdkVersion 26
1211
versionCode 1
1312
versionName "1.0"
1413
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -22,12 +21,11 @@ android {
2221
}
2322

2423
dependencies {
25-
compile fileTree(dir: 'libs', include: ['*.jar'])
26-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
27-
exclude group: 'com.android.support', module: 'support-annotations'
28-
})
29-
compile 'com.android.support:appcompat-v7:25.3.1'
30-
testCompile 'junit:junit:4.12'
24+
implementation fileTree(dir: 'libs', include: ['*.jar'])
25+
implementation 'com.android.support:appcompat-v7:26.1.0'
26+
testImplementation 'junit:junit:4.12'
27+
androidTestImplementation 'com.android.support.test:runner:1.0.1'
28+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
3129

32-
compile 'io.reactivex.rxjava2:rxjava:2.1.3'
30+
compile 'io.reactivex.rxjava2:rxjava:2.1.6'
3331
}

app/proguard-rules.pro

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Add project specific ProGuard rules here.
2-
# By default, the flags in this file are appended to flags specified
3-
# in /Users/Ho/Library/Android/sdk/tools/proguard/proguard-android.txt
4-
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
64
#
75
# For more details, see
86
# http://developer.android.com/guide/developing/tools/proguard.html
97

10-
# Add any project specific keep options here:
11-
128
# If your project uses WebView with JS, uncomment the following
139
# and specify the fully qualified class name to the JavaScript interface
1410
# class:

app/src/androidTest/java/me/echodev/resizer/ExampleInstrumentedTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import static org.junit.Assert.*;
1111

1212
/**
13-
* Instrumentation test, which will execute on an Android device.
13+
* Instrumented test, which will execute on an Android device.
1414
*
1515
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
1616
*/

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
32
package="me.echodev.resizer">
43

54
<application
65
android:allowBackup="true"
76
android:label="@string/app_name"
8-
android:supportsRtl="true">
9-
10-
</application>
11-
7+
android:supportsRtl="true" />
128
</manifest>

app/src/main/java/me/echodev/resizer/util/FileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
public class FileUtils {
14-
public static String getDestinationFilePath(Bitmap.CompressFormat compressFormat, String outputDirPath, File sourceImage) {
14+
public static String getOutputFilePath(Bitmap.CompressFormat compressFormat, String outputDirPath, File sourceImage) {
1515
String originalFileName = sourceImage.getName();
1616
String targetFileName;
1717
String targetFileExtension = "." + compressFormat.name().toLowerCase().replace("jpeg", "jpg");

app/src/main/java/me/echodev/resizer/util/ImageUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public static File getScaledImage(int targetLength, int quality, Bitmap.Compress
1818
}
1919

2020
// Prepare the new file name and path
21-
String destinationFilePath = FileUtils.getDestinationFilePath(compressFormat, outputDirPath, sourceImage);
21+
String outputFilePath = FileUtils.getOutputFilePath(compressFormat, outputDirPath, sourceImage);
2222

2323
// Write the resized image to the new file
2424
Bitmap scaledBitmap = getScaledBitmap(targetLength, sourceImage);
25-
FileUtils.writeBitmapToFile(scaledBitmap, compressFormat, quality, destinationFilePath);
25+
FileUtils.writeBitmapToFile(scaledBitmap, compressFormat, quality, outputFilePath);
2626

27-
return new File(destinationFilePath);
27+
return new File(outputFilePath);
2828
}
2929

3030
public static Bitmap getScaledBitmap(int targetLength, File sourceImage) {

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
buildscript {
44
repositories {
5+
google()
56
jcenter()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.3'
9+
classpath 'com.android.tools.build:gradle:3.0.1'
910
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1011

1112
// NOTE: Do not place your application dependencies here; they belong
@@ -15,6 +16,7 @@ buildscript {
1516

1617
allprojects {
1718
repositories {
19+
google()
1820
jcenter()
1921
}
2022
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Sep 01 13:20:48 HKT 2017
1+
#Tue Nov 21 01:40:52 HKT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

0 commit comments

Comments
 (0)