Skip to content

Commit

Permalink
Merge pull request #1 from lukasvalkovic/migrate-to-androidx
Browse files Browse the repository at this point in the history
Migrate to AndroidX
  • Loading branch information
prochazkajp authored Sep 21, 2020
2 parents c063ebb + 17d6aca commit a6c1be8
Show file tree
Hide file tree
Showing 30 changed files with 75 additions and 69 deletions.
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.novoda:bintray-release:0.4.0'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.novoda:bintray-release:0.5.0'
}
}

allprojects {
repositories {
google()
jcenter()
}
}
Expand All @@ -25,7 +27,7 @@ ext {
groupId = 'com.steelkiwi'
uploadName = 'cropiwa'
description = 'Configurable Custom Crop widget for Android'
publishVersion = '1.0.3'
publishVersion = '2.0.0'
licences = ['Apache-2.0']
}

3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
10 changes: 5 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
Expand All @@ -20,8 +20,8 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.1.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
}

publish {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.steelkiwi.cropiwa;

import android.support.annotation.IntRange;
import androidx.annotation.IntRange;

/**
* Created by yarolegovich https://github.com/yarolegovich
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.annotation.FloatRange;
import androidx.annotation.FloatRange;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.widget.ImageView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;
import android.view.MotionEvent;
import android.view.View;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.FloatRange;
import androidx.annotation.FloatRange;
import android.util.AttributeSet;

import com.steelkiwi.cropiwa.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.FloatRange;
import android.support.annotation.NonNull;
import androidx.annotation.FloatRange;
import androidx.annotation.NonNull;
import android.util.AttributeSet;

import com.steelkiwi.cropiwa.AspectRatio;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.graphics.Bitmap;
import android.net.Uri;
import android.support.annotation.IntRange;
import androidx.annotation.IntRange;

import com.steelkiwi.cropiwa.image.CropIwaBitmapManager;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import android.graphics.Matrix;
import android.media.ExifInterface;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.steelkiwi.cropiwa.OnCroppedListener;
import com.steelkiwi.cropiwa.config.CropIwaSaveConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected void drawGrid(Canvas canvas, RectF cropBounds, Paint paint) {
clipPath.rewind();
clipPath.addOval(cropBounds, Path.Direction.CW);

canvas.save(Canvas.CLIP_SAVE_FLAG);
canvas.save();
canvas.clipPath(clipPath);
super.drawGrid(canvas, cropBounds, paint);
canvas.restore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.content.res.Resources;
import android.graphics.RectF;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.util.DisplayMetrics;

import java.io.Closeable;
Expand Down
8 changes: 4 additions & 4 deletions library/src/main/java/com/steelkiwi/cropiwa/util/ResUtil.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.steelkiwi.cropiwa.util;

import android.content.Context;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.DimenRes;
import android.support.v4.content.ContextCompat;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DimenRes;
import androidx.core.content.ContextCompat;

/**
* @author yarolegovich https://github.com/yarolegovich
Expand Down
24 changes: 14 additions & 10 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
apply plugin: 'com.android.application'

repositories {
maven { url "https://jitpack.io" }
}

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 30
buildToolsVersion "30.0.2"

defaultConfig {
applicationId "com.steelkiwi.cropiwa.sample"
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
Expand All @@ -20,12 +24,12 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library')
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.yarolegovich:mp:1.0.5'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':library')
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.yarolegovich:mp:1.1.6'

compile 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import com.steelkiwi.cropiwa.AspectRatio;

import com.steelkiwi.cropiwa.CropIwaView;
import com.steelkiwi.cropiwa.sample.config.CropViewConfigurator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import com.google.android.material.snackbar.Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.View;

import com.steelkiwi.cropiwa.image.CropIwaResultReceiver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import android.widget.ImageView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.steelkiwi.cropiwa.sample.adapter;

import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.app.ActivityOptions;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import android.graphics.Paint;
import android.graphics.PathEffect;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;

import com.steelkiwi.cropiwa.AspectRatio;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.steelkiwi.cropiwa.sample.data;

import android.net.Uri;
import android.support.annotation.DrawableRes;
import androidx.annotation.DrawableRes;

import com.steelkiwi.cropiwa.sample.App;
import com.steelkiwi.cropiwa.sample.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetDialogFragment;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetDialogFragment;
import androidx.annotation.Nullable;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.app.Activity;
import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat;
import androidx.core.app.ActivityCompat;

/**
* Created by yarolegovich https://github.com/yarolegovich
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Context;
import android.os.Build;
import android.support.annotation.RequiresApi;
import androidx.annotation.RequiresApi;
import android.util.AttributeSet;
import android.widget.FrameLayout;

Expand Down
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_crop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6">
Expand All @@ -19,7 +19,7 @@
android:layout_weight="1"
app:ci_dynamic_aspect_ratio="false" />

</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>

<com.yarolegovich.mp.MaterialPreferenceScreen
android:id="@+id/crop_preference_screen"
Expand Down
10 changes: 5 additions & 5 deletions sample/src/main/res/layout/activity_crop_gallery.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
Expand All @@ -12,20 +12,20 @@
android:layout_height="match_parent"
android:orientation="vertical">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<include layout="@layout/toolbar" />
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>


<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />

</LinearLayout>

</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/pref_card_crop_mode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
app:mp_key="@string/key_dynamic_crop"
app:mp_title="Dynamic overlay" />

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/fixed_ratio_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Expand Down
Loading

0 comments on commit a6c1be8

Please sign in to comment.