Skip to content

Commit 86530de

Browse files
committed
migrate to androidX. Migrate to jitpack.io
1 parent c875002 commit 86530de

File tree

7 files changed

+56
-35
lines changed

7 files changed

+56
-35
lines changed

build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.0.5-3'
4+
ext.kotlin_version = '1.4.21'
55
repositories {
66
jcenter()
7+
google()
78
}
89
dependencies {
9-
classpath 'com.android.tools.build:gradle:2.2.3'
10+
classpath 'com.android.tools.build:gradle:4.1.2'
1011
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
classpath 'com.novoda:bintray-release:0.3.4'
1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
1414
}
1515
}
1616

17+
plugins {
18+
id 'maven-publish'
19+
}
20+
1721
allprojects {
1822
repositories {
1923
jcenter()
24+
google()
25+
maven { url "https://jitpack.io" }
2026
}
2127
}
2228

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ org.gradle.jvmargs=-Xmx1536m
1515
# This option should only be used with decoupled projects. More details, visit
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1717
# org.gradle.parallel=true
18+
android.useAndroidX=true
19+
# Automatically convert third-party libraries to use AndroidX
20+
android.enableJetifier=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Dec 28 10:00:20 PST 2015
1+
#Wed Feb 10 14:54:42 EET 2021
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-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

multiimageview/build.gradle

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'com.novoda.bintray-release'
43

54
android {
6-
compileSdkVersion 25
7-
buildToolsVersion "25.0.0"
5+
compileSdkVersion 28
86

97
defaultConfig {
108
minSdkVersion 16
11-
targetSdkVersion 25
9+
targetSdkVersion 28
1210
versionCode 1
1311
versionName "0.1"
1412

@@ -24,26 +22,33 @@ android {
2422
sourceSets {
2523
main.java.srcDirs += 'src/main/kotlin'
2624
}
27-
}
2825

29-
publish {
30-
groupId = 'com.github.stfalcon'
31-
artifactId = 'multiimageview'
32-
publishVersion = '0.1'
33-
desc = 'Library for display a few images in one MultiImageView like avatar of group chat'
34-
licences = ['Apache-2.0']
35-
uploadName='MultiImageView'
36-
website = 'https://github.com/stfalcon-studio/MultiImageView.git'
26+
afterEvaluate {
27+
publishing {
28+
publications {
29+
// Creates a Maven publication called "release".
30+
release(MavenPublication) {
31+
// Applies the component for the release build variant.
32+
from components.release
33+
34+
// You can then customize attributes of the publication as shown below.
35+
groupId = 'com.github.stfalcon'
36+
artifactId = 'multiimageview'
37+
version = '0.2'
38+
}
39+
}
40+
}
41+
}
3742
}
3843

3944
dependencies {
40-
compile fileTree(dir: 'libs', include: ['*.jar'])
41-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
45+
implementation fileTree(dir: 'libs', include: ['*.jar'])
46+
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
4247
exclude group: 'com.android.support', module: 'support-annotations'
4348
})
44-
compile 'com.android.support:appcompat-v7:25.0.0'
45-
testCompile 'junit:junit:4.12'
46-
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
49+
implementation 'com.android.support:appcompat-v7:28.0.0'
50+
testImplementation 'junit:junit:4.12'
51+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
4752
}
4853
repositories {
4954
mavenCentral()

multiimageview/src/main/java/com/stfalcon/multiimageview/MultiImageView.kt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@
1717
package com.stfalcon.multiimageview
1818

1919
import android.content.Context
20-
import android.graphics.*
20+
import android.graphics.Bitmap
21+
import android.graphics.Canvas
22+
import android.graphics.ColorFilter
23+
import android.graphics.Paint
24+
import android.graphics.Path
25+
import android.graphics.PixelFormat
26+
import android.graphics.Rect
27+
import android.graphics.RectF
2128
import android.graphics.drawable.Drawable
2229
import android.media.ThumbnailUtils
2330
import android.util.AttributeSet
2431
import android.widget.ImageView
25-
import java.util.*
32+
import java.util.ArrayList
2633

2734
/**
2835
* Created by Anton Bevza on 12/22/16.
@@ -35,6 +42,7 @@ class MultiImageView(context: Context, attrs: AttributeSet) : ImageView(context,
3542
field = value
3643
invalidate()
3744
}
45+
3846
//Corners radius for rectangle shape
3947
var rectCorners = 100
4048

@@ -83,7 +91,7 @@ class MultiImageView(context: Context, attrs: AttributeSet) : ImageView(context,
8391
if (shape == Shape.RECTANGLE) {
8492
//Rectangle with corners
8593
path.addRoundRect(rect, rectCorners.toFloat(),
86-
rectCorners.toFloat(), Path.Direction.CW)
94+
rectCorners.toFloat(), Path.Direction.CW)
8795
} else {
8896
//Oval
8997
path.addOval(rect, Path.Direction.CW)
@@ -159,7 +167,6 @@ class MultiDrawable(val bitmaps: ArrayList<Bitmap>) : Drawable() {
159167
*/
160168
data class PhotoItem(val bitmap: Bitmap, val position: Rect)
161169

162-
163170
//***Needed to override***//
164171
override fun setAlpha(alpha: Int) {
165172
paint.alpha = alpha

sample/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.0"
4+
compileSdkVersion 28
65
defaultConfig {
76
applicationId "com.stfalcon.multiimageview.sample"
87
minSdkVersion 16
9-
targetSdkVersion 25
8+
targetSdkVersion 28
109
versionCode 1
1110
versionName "1.0"
1211
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -20,11 +19,11 @@ android {
2019
}
2120

2221
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
22+
implementation fileTree(dir: 'libs', include: ['*.jar'])
2423
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
2524
exclude group: 'com.android.support', module: 'support-annotations'
2625
})
27-
compile 'com.android.support:appcompat-v7:25.0.0'
28-
testCompile 'junit:junit:4.12'
29-
compile project (':multiimageview')
26+
implementation 'com.android.support:appcompat-v7:28.0.0'
27+
testImplementation 'junit:junit:4.12'
28+
implementation project (':multiimageview')
3029
}

sample/src/main/java/com/stfalcon/multiimageview/sample/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package com.stfalcon.multiimageview.sample;
22

33
import android.graphics.BitmapFactory;
4-
import android.support.v7.app.AppCompatActivity;
54
import android.os.Bundle;
65
import android.view.View;
76
import android.widget.Button;
87

8+
import androidx.appcompat.app.AppCompatActivity;
9+
910
import com.stfalcon.multiimageview.MultiImageView;
1011

1112
public class MainActivity extends AppCompatActivity {

0 commit comments

Comments
 (0)