Skip to content

Commit

Permalink
migerate to androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
k3b committed May 7, 2019
1 parent 4f79153 commit 4d2ad9e
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 37 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {
// 1.0.0.190425 (1) initial version
versionCode 1
versionName "1.0.0.190425"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// all supported locales. Note: the lib has more translations which are supressed here
// resConfigs "ar","de","es","fr","hi","in","it","ja","nl","pl","ro","ru","tr","uk","zz","pt-rBR","zh-rCN","zh-rTW"
Expand All @@ -36,13 +36,13 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// implementation "com.android.support:appcompat-v7:$support"
implementation "com.android.support:support-v4:$support"
implementation "com.android.support:support-annotations:$support"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.annotation:annotation:1.0.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
// implements lossless croppig
// implementation 'com.facebook.spectrum:spectrum-default:1.0.0'
implementation 'com.facebook.spectrum:spectrum-core:1.0.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.k3b.android.lossless_jpg_crop;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:theme="@style/AppTheme">

<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="de.k3b.llCrop"
android:exported="false"
android:grantUriPermissions="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;

/**
* Created by Oleksii Shliama (https://github.com/shliama).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package de.k3b.android.lossless_jpg_crop;

import android.Manifest;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.FileProvider;
import androidx.core.app.ActivityCompat;
import androidx.core.content.FileProvider;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -25,8 +23,6 @@
import java.io.InputStream;
import java.io.OutputStream;

import static android.content.Intent.EXTRA_STREAM;

public class CropAreasChooseActivity extends BaseActivity {
private static final String TAG = "llCrop";
private static final int REQUEST_GET_PICTURE = 1;
Expand Down Expand Up @@ -167,7 +163,7 @@ private void pickFromGallery() {
.addCategory(Intent.CATEGORY_OPENABLE)
// Fix: after pressing "back" return to caller off this app and not to previous-instance
// without parameters
.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_GRANT_READ_URI_PERMISSION)
;

startActivityForResult(Intent.createChooser(intent, getString(R.string.label_select_picture)), REQUEST_GET_PICTURE);
Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.4.0'

// 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'
// constraints = '1.0.2'
}
}

Expand All @@ -29,7 +28,6 @@ allprojects {
ext {
compileSdkVersion = 28
buildToolsVersion = '28.0.3'
supportLibraryVersion = '28.0.0'

PUBLISH_GROUP_ID = 'net.realify.lib'
PUBLISH_ARTIFACT_ID = 'android-image-cropper'
Expand Down
6 changes: 3 additions & 3 deletions cropper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ repositories {
}

dependencies {
api "com.android.support:support-v4:$supportLibraryVersion"
api "com.android.support:exifinterface:$supportLibraryVersion"
api "com.android.support:support-annotations:$support"
api 'androidx.legacy:legacy-support-v4:1.0.0'
api 'androidx.exifinterface:exifinterface:1.0.0'
api 'androidx.annotation:annotation:1.0.0'

// implementation 'com.github.Realify:Android-Image-Cropper:master'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import android.graphics.Rect;
import android.graphics.RectF;
import android.net.Uri;
import android.support.media.ExifInterface;
import androidx.exifinterface.media.ExifInterface;
import android.util.Log;
import android.util.Pair;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.MediaStore;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v4.app.Fragment;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;

import java.io.File;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
// import android.support.v7.app.ActionBar;
// import android.support.v7.app.AppCompatActivity;
import android.util.Log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.media.ExifInterface;
import androidx.exifinterface.media.ExifInterface;
import android.util.AttributeSet;
import android.util.Pair;
import android.view.LayoutInflater;
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 09 17:59:42 CEST 2019
#Tue May 07 10:19:25 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

0 comments on commit 4d2ad9e

Please sign in to comment.