Skip to content

Commit

Permalink
Compile-sdk bumb to 28
Browse files Browse the repository at this point in the history
  • Loading branch information
k3b committed Apr 10, 2019
1 parent 6bf802e commit 310f843
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 47 deletions.
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "de.k3b.android.lossless_jpg_crop"
minSdkVersion 15
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,7 +20,7 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:$support'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
Expand All @@ -32,5 +32,6 @@ dependencies {
implementation 'com.facebook.spectrum:spectrum-jpeg:1.0.0'

// the cropping gui
implementation 'com.github.yalantis:ucrop:2.2.3'
implementation project(':ucrop')
// implementation 'com.github.yalantis:ucrop:2.2.3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.io.InputStream;
import java.io.OutputStream;

public class MainActivity extends AppCompatActivity implements UCropFragmentCallback {
public class MainActivity extends AppCompatActivity {
private static final String TAG = "ResultActivity";

private ImageProcessor mSpectrum;
Expand Down Expand Up @@ -72,45 +72,6 @@ protected void onCreate(Bundle savedInstanceState) {

}

// UCropFragmentCallback
@Override
public void loadingProgress(boolean showLoader) {
// mShowLoader = showLoader;
supportInvalidateOptionsMenu();
}

// UCropFragmentCallback
@Override
public void onCropFinish(UCropFragment.UCropResult result) {
switch (result.mResultCode) {
case RESULT_OK:
handleCropResult(result.mResultData);
break;
case UCrop.RESULT_ERROR:
handleCropError(result.mResultData);
break;
}
}

private void handleCropResult(@NonNull Intent result) {
final Uri resultUri = UCrop.getOutput(result);
if (resultUri != null) {
ResultActivity.startWithUri(SampleActivity.this, resultUri);
} else {
Toast.makeText(SampleActivity.this, R.string.toast_cannot_retrieve_cropped_image, Toast.LENGTH_SHORT).show();
}
}

@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private void handleCropError(@NonNull Intent result) {
final Throwable cropError = UCrop.getError(result);
if (cropError != null) {
Log.e(TAG, "handleCropError: ", cropError);
Toast.makeText(SampleActivity.this, cropError.getMessage(), Toast.LENGTH_LONG).show();
} else {
Toast.makeText(SampleActivity.this, R.string.toast_unexpected_error, Toast.LENGTH_SHORT).show();
}
}



Expand Down
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ buildscript {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
ext {
support = '28.0.0'
constraints = '1.0.2'
}
}

allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
// maven { url "https://jitpack.io" }
}
}

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app'
include ':app', ':ucrop'
2 changes: 1 addition & 1 deletion ucrop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply from: '../mavenpush.gradle'
// apply from: '../mavenpush.gradle'

android {
compileSdkVersion 28
Expand Down

0 comments on commit 310f843

Please sign in to comment.