Skip to content

Commit

Permalink
migrate to androidX. Migrate to jitpack.io
Browse files Browse the repository at this point in the history
  • Loading branch information
bevzaanton committed Feb 10, 2021
1 parent c875002 commit 86530de
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 35 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.0.5-3'
ext.kotlin_version = '1.4.21'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.novoda:bintray-release:0.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id 'maven-publish'
}

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

Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ org.gradle.jvmargs=-Xmx1536m
# 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
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=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 @@
#Mon Dec 28 10:00:20 PST 2015
#Wed Feb 10 14:54:42 EET 2021
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.5-all.zip
41 changes: 23 additions & 18 deletions multiimageview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.novoda.bintray-release'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion 28

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "0.1"

Expand All @@ -24,26 +22,33 @@ android {
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}

publish {
groupId = 'com.github.stfalcon'
artifactId = 'multiimageview'
publishVersion = '0.1'
desc = 'Library for display a few images in one MultiImageView like avatar of group chat'
licences = ['Apache-2.0']
uploadName='MultiImageView'
website = 'https://github.com/stfalcon-studio/MultiImageView.git'
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release

// You can then customize attributes of the publication as shown below.
groupId = 'com.github.stfalcon'
artifactId = 'multiimageview'
version = '0.2'
}
}
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@
package com.stfalcon.multiimageview

import android.content.Context
import android.graphics.*
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.ColorFilter
import android.graphics.Paint
import android.graphics.Path
import android.graphics.PixelFormat
import android.graphics.Rect
import android.graphics.RectF
import android.graphics.drawable.Drawable
import android.media.ThumbnailUtils
import android.util.AttributeSet
import android.widget.ImageView
import java.util.*
import java.util.ArrayList

/**
* Created by Anton Bevza on 12/22/16.
Expand All @@ -35,6 +42,7 @@ class MultiImageView(context: Context, attrs: AttributeSet) : ImageView(context,
field = value
invalidate()
}

//Corners radius for rectangle shape
var rectCorners = 100

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


//***Needed to override***//
override fun setAlpha(alpha: Int) {
paint.alpha = alpha
Expand Down
13 changes: 6 additions & 7 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
compileSdkVersion 28
defaultConfig {
applicationId "com.stfalcon.multiimageview.sample"
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,11 +19,11 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
compile project (':multiimageview')
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
implementation project (':multiimageview')
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.stfalcon.multiimageview.sample;

import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.stfalcon.multiimageview.MultiImageView;

public class MainActivity extends AppCompatActivity {
Expand Down

0 comments on commit 86530de

Please sign in to comment.