Skip to content

Commit

Permalink
Merge pull request #566 from Yalantis/develop
Browse files Browse the repository at this point in the history
Develop native up version to 2.2.4
  • Loading branch information
ukevgen authored Sep 16, 2019
2 parents cd64fd5 + f876977 commit 76a9f06
Show file tree
Hide file tree
Showing 49 changed files with 216 additions and 174 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
}
```

``` implementation 'com.github.yalantis:ucrop:2.2.3' ``` - lightweight general solution
``` implementation 'com.github.yalantis:ucrop:2.2.4' ``` - lightweight general solution

``` implementation 'com.github.yalantis:ucrop:2.2.3-native' ``` - get power of the native code to preserve image quality (+ about 1.5 MB to an apk size)
``` implementation 'com.github.yalantis:ucrop:2.2.4-native' ``` - get power of the native code to preserve image quality (+ about 1.5 MB to an apk size)

2. Add UCropActivity into your AndroidManifest.xml

Expand Down Expand Up @@ -92,6 +92,13 @@ Currently you can change:
* CPU - armeabi armeabi-v7a x86 x86_64 arm64-v8a (for versions >= 2.1.2)
# Changelog
### Version: 2.2.4
* **AndroidX migration**
* Redesign
* Several fixes including [#550](https://github.com/Yalantis/uCrop/issues/550)
### Version: 2.2.3
* Several fixes including [#445](https://github.com/Yalantis/uCrop/issues/445), [#465](https://github.com/Yalantis/uCrop/issues/465) and more!
Expand Down
19 changes: 9 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
androidx_appcompat_version = "1.1.0"
androidx_core_version = "1.1.0"
androidx_exifinterface_version = "1.1.0-beta01"
androidx_transition_version = "1.2.0-rc01"
constraintlayout_version = "1.1.3"
}

repositories {
jcenter()
maven {
Expand All @@ -9,14 +15,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'

// 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'
classpath 'com.android.tools.build:gradle:3.5.0'
}
}

Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=2.2.3-native
VERSION_CODE=24
VERSION_NAME=2.2.4-native
VERSION_CODE=25
GROUP=com.yalantis

POM_DESCRIPTION=Android Library for cropping images
Expand All @@ -30,4 +30,5 @@ POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=yalantis
POM_DEVELOPER_NAME=Yalantis
POM_DEVELOPER_NAME=Yalantis
android.useAndroidX=true
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 @@
#Thu Apr 05 11:29:51 EEST 2018
#Fri Sep 06 16:37:21 EEST 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.4.1-all.zip
8 changes: 4 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
applicationId "com.yalantis.ucrop.sample"
minSdkVersion 14
targetSdkVersion 28
versionCode 12
versionCode 13
versionName "1.2.4"
}
flavorDimensions "default"
Expand Down Expand Up @@ -35,8 +35,8 @@ android {
}

dependencies {
implementation "com.android.support:appcompat-v7:$support"
implementation "com.android.support:support-compat:$support"
implementation "com.android.support.constraint:constraint-layout:1.1.3"
implementation "androidx.appcompat:appcompat:${androidx_appcompat_version}"
implementation "androidx.core:core:${androidx_core_version}"
implementation "androidx.constraintlayout:constraintlayout:${constraintlayout_version}"
implementation project(':ucrop')
}
2 changes: 1 addition & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme">
<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="@string/file_provider_authorities"
android:exported="false"
android:grantUriPermissions="true">
Expand Down
11 changes: 6 additions & 5 deletions sample/src/main/java/com/yalantis/ucrop/sample/BaseActivity.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.yalantis.ucrop.sample;

import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
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
Expand Up @@ -15,12 +15,6 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.FileProvider;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -35,6 +29,13 @@
import java.util.Calendar;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider;

import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION;
import static android.content.Intent.FLAG_GRANT_WRITE_URI_PERMISSION;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
Expand All @@ -43,6 +36,14 @@
import java.util.Locale;
import java.util.Random;

import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

/**
* Created by Oleksii Shliama (https://github.com/shliama).
*/
Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/activity_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
Expand Down
12 changes: 7 additions & 5 deletions sample/src/main/res/layout/activity_sample.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:visibility="gone">
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/toolbar_title"
Expand All @@ -18,7 +20,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center" />

</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>

<FrameLayout
android:id="@+id/fragment_container"
Expand All @@ -33,4 +35,4 @@
android:id="@+id/settings"
layout="@layout/include_settings" />

</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
16 changes: 6 additions & 10 deletions ucrop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 24
versionName "2.2.3-native"
versionCode 25
versionName "2.2.4-native"

vectorDrawables.useSupportLibrary = true
}
Expand All @@ -36,12 +36,8 @@ android {
}

dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
}

repositories {
google()
implementation "androidx.appcompat:appcompat:${androidx_appcompat_version}"
implementation "androidx.exifinterface:exifinterface:${androidx_exifinterface_version}"
implementation "androidx.transition:transition:${androidx_transition_version}"
implementation "com.squareup.okhttp3:okhttp:3.12.1"
}
17 changes: 9 additions & 8 deletions ucrop/src/main/java/com/yalantis/ucrop/UCrop.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.FloatRange;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.yalantis.ucrop.model.AspectRatio;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;

import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* Created by Oleksii Shliama (https://github.com/shliama).
* <p/>
Expand Down Expand Up @@ -152,7 +153,7 @@ public void start(@NonNull Context context, @NonNull Fragment fragment) {
*
* @param fragment Fragment to receive result
*/
public void start(@NonNull Context context, @NonNull android.support.v4.app.Fragment fragment) {
public void start(@NonNull Context context, @NonNull androidx.fragment.app.Fragment fragment) {
start(context, fragment, REQUEST_CROP);
}

Expand All @@ -173,7 +174,7 @@ public void start(@NonNull Context context, @NonNull Fragment fragment, int requ
* @param fragment Fragment to receive result
* @param requestCode requestCode for result
*/
public void start(@NonNull Context context, @NonNull android.support.v4.app.Fragment fragment, int requestCode) {
public void start(@NonNull Context context, @NonNull androidx.fragment.app.Fragment fragment, int requestCode) {
fragment.startActivityForResult(getIntent(context), requestCode);
}

Expand Down
27 changes: 14 additions & 13 deletions ucrop/src/main/java/com/yalantis/ucrop/UCropActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.transition.AutoTransition;
import android.support.transition.Transition;
import android.support.transition.TransitionManager;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -54,6 +42,19 @@
import java.util.List;
import java.util.Locale;

import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.IdRes;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.transition.AutoTransition;
import androidx.transition.Transition;
import androidx.transition.TransitionManager;

/**
* Created by Oleksii Shliama (https://github.com/shliama).
*/
Expand Down Expand Up @@ -449,7 +450,7 @@ private void setupAspectRatioWidget(@NonNull Intent intent) {
wrapperAspectRatio = (FrameLayout) getLayoutInflater().inflate(R.layout.ucrop_aspect_ratio, null);
wrapperAspectRatio.setLayoutParams(lp);
aspectRatioTextView = ((AspectRatioTextView) wrapperAspectRatio.getChildAt(0));
aspectRatioTextView.setActiveColor(mActiveWidgetColor);
aspectRatioTextView.setActiveColor(mActiveControlsWidgetColor);
aspectRatioTextView.setAspectRatio(aspectRatio);

wrapperAspectRatioList.addView(wrapperAspectRatio);
Expand Down
21 changes: 11 additions & 10 deletions ucrop/src/main/java/com/yalantis/ucrop/UCropFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.IdRes;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.transition.AutoTransition;
import android.support.transition.Transition;
import android.support.transition.TransitionManager;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -44,6 +34,17 @@
import java.util.List;
import java.util.Locale;

import androidx.annotation.ColorInt;
import androidx.annotation.IdRes;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.transition.AutoTransition;
import androidx.transition.Transition;
import androidx.transition.TransitionManager;

import static android.app.Activity.RESULT_OK;

@SuppressWarnings("ConstantConditions")
Expand Down
Loading

0 comments on commit 76a9f06

Please sign in to comment.