Skip to content

Commit 9e1042e

Browse files
Merge pull request #47 from Omega-R/develop
Develop
2 parents 97c49ca + 7a6d80c commit 9e1042e

File tree

14 files changed

+71
-150
lines changed

14 files changed

+71
-150
lines changed

build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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.5.31'
4+
ext.kotlin_version = '1.9.20'
55
ext.kotlinCorutines_version = '1.2.1'
66
ext.supportVersion = '28.0.0'
77
ext.compileSdkVersion = 28
@@ -12,9 +12,8 @@ buildscript {
1212
mavenCentral()
1313
}
1414
dependencies {
15-
classpath 'com.android.tools.build:gradle:3.6.3'
16-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
17-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
15+
classpath 'com.android.tools.build:gradle:7.4.2'
16+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20"
1817
// NOTE: Do not place your application dependencies here; they belong
1918
// in the individual module build.gradle files
2019
}

glide/build.gradle

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3+
apply plugin: 'maven-publish'
34

4-
apply plugin: 'com.github.dcendents.android-maven'
55
group = 'com.github.Omega-R'
6+
7+
publishing {
8+
publications {
9+
release(MavenPublication) {
10+
groupId 'com.github.Omega-R'
11+
afterEvaluate {
12+
from components.release
13+
}
14+
}
15+
}
16+
}
17+
18+
619
android {
7-
compileSdkVersion 28
20+
compileSdkVersion 34
821

922

1023

1124
defaultConfig {
1225
minSdkVersion 14
13-
targetSdkVersion 28
26+
targetSdkVersion 34
1427
versionCode 1
1528
versionName "1.0"
1629

glide/src/androidTest/java/com/omega_r/libs/omegatypes/glide/ExampleInstrumentedTest.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

glide/src/main/java/com/omega_r/libs/omegatypes/image/GlideImagesProcessor.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.bumptech.glide.Glide
1010
import com.bumptech.glide.RequestBuilder
1111
import com.bumptech.glide.load.DataSource
1212
import com.bumptech.glide.load.engine.GlideException
13+
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
1314
import com.bumptech.glide.request.RequestListener
1415
import com.bumptech.glide.request.target.CustomViewTarget
1516
import com.bumptech.glide.request.target.Target
@@ -19,6 +20,9 @@ import com.omega_r.libs.omegatypes.decoders.SimpleBitmapDecoders
1920
import com.omega_r.libs.omegatypes.image.Image.Companion.NO_PLACEHOLDER_RES
2021
import java.io.InputStream
2122
import kotlin.reflect.KClass
23+
import kotlin.time.Duration
24+
import kotlin.time.Duration.Companion.milliseconds
25+
import kotlin.time.DurationUnit
2226

2327
/**
2428
* Created by Anton Knyazev on 2019-10-03.
@@ -27,6 +31,7 @@ open class GlideImagesProcessor(
2731
protected val oldImagesProcessor: ImageProcessors,
2832
vararg excludeImageClasses: KClass<out Image>,
2933
private val customBuilder: CustomRequestBuilder? = null,
34+
private val fadeDuration: Duration? = 500.milliseconds
3035
) : ImageProcessors() {
3136

3237
companion object {
@@ -64,7 +69,8 @@ open class GlideImagesProcessor(
6469
.asDrawable()
6570
.createRequestBuilder(this)
6671
?.applyPlaceholder(placeholderResId)
67-
?.listener(GlideImageRequestListener(onImageApplied))
72+
?.addListener(GlideImageRequestListener(onImageApplied))
73+
?.run { fadeDuration?.let { transition(DrawableTransitionOptions.withCrossFade(it.toInt(DurationUnit.MILLISECONDS)))}}
6874
?.into(imageView)
6975
?: applyOld { applyImage(imageView, placeholderResId) }
7076
}
@@ -159,10 +165,9 @@ class GlideImageRequestListener(private val onImageLoaded: (() -> Unit)?) : Requ
159165
dataSource: DataSource,
160166
isFirstResource: Boolean,
161167
): Boolean {
162-
target.onResourceReady(resource, null)
163168
if (isFirstResource) {
164169
onImageLoaded?.invoke()
165170
}
166-
return true
171+
return false
167172
}
168173
}

glide/src/test/java/com/omega_r/libs/omegatypes/glide/ExampleUnitTest.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

googledrive/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3+
apply plugin: 'maven-publish'
34

4-
apply plugin: 'com.github.dcendents.android-maven'
55
group = 'com.github.Omega-R'
66
android {
7-
compileSdkVersion 28
7+
compileSdkVersion 34
88

99

1010

1111
defaultConfig {
1212
minSdkVersion 14
13-
targetSdkVersion 28
13+
targetSdkVersion 34
1414
versionCode 1
1515
versionName "1.0"
1616

googledrive/src/androidTest/java/com/omega_r/libs/omegatypes/glide/ExampleInstrumentedTest.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

googledrive/src/test/java/com/omega_r/libs/omegatypes/glide/ExampleUnitTest.java

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Apr 21 10:08:25 MSK 2020
1+
#Thu Aug 08 15:02:53 MSK 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

omegatypes/build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3+
apply plugin: 'maven-publish'
34

4-
apply plugin: 'com.github.dcendents.android-maven'
55
group = 'com.github.Omega-R'
66

7+
publishing {
8+
publications {
9+
release(MavenPublication) {
10+
groupId 'com.github.Omega-R'
11+
afterEvaluate {
12+
from components.release
13+
}
14+
}
15+
}
16+
}
17+
718
android {
819
compileSdkVersion rootProject.ext.compileSdkVersion
920

0 commit comments

Comments
 (0)