Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Lint warnings. #1269

Merged
merged 1 commit into from May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions coil-base/src/androidTest/java/coil/request/DisposableTest.kt
Expand Up @@ -17,7 +17,6 @@ import coil.util.TestActivity
import coil.util.activity
import coil.util.requestManager
import coil.util.runTestMain
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.first
import org.junit.After
Expand All @@ -29,7 +28,6 @@ import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue

@OptIn(ExperimentalCoroutinesApi::class)
class DisposableTest {

private lateinit var context: Context
Expand Down
1 change: 1 addition & 0 deletions coil-base/src/main/java/coil/drawable/CrossfadeDrawable.kt
Expand Up @@ -115,6 +115,7 @@ class CrossfadeDrawable @JvmOverloads constructor(
maxAlpha = alpha
}

@Deprecated("Deprecated in Java")
@Suppress("DEPRECATION")
override fun getOpacity(): Int {
val start = start
Expand Down
1 change: 0 additions & 1 deletion coil-gif/src/main/java/coil/decode/ImageDecoderDecoder.kt
Expand Up @@ -164,7 +164,6 @@ class ImageDecoderDecoder @JvmOverloads constructor(
return ScaleDrawable(baseDrawable, options.scale)
}

@RequiresApi(28)
class Factory @JvmOverloads constructor(
private val enforceMinimumFrameDelay: Boolean = true
) : Decoder.Factory {
Expand Down
5 changes: 4 additions & 1 deletion coil-gif/src/main/java/coil/drawable/MovieDrawable.kt
Expand Up @@ -192,8 +192,11 @@ class MovieDrawable @JvmOverloads constructor(
paint.alpha = alpha
}

@Deprecated("Deprecated in Java")
@Suppress("DEPRECATION")
override fun getOpacity(): Int {
return if (paint.alpha == 255 && (pixelOpacity == OPAQUE || (pixelOpacity == UNCHANGED && movie.isOpaque))) {
return if (paint.alpha == 255 &&
(pixelOpacity == OPAQUE || (pixelOpacity == UNCHANGED && movie.isOpaque))) {
PixelFormat.OPAQUE
} else {
PixelFormat.TRANSLUCENT
Expand Down
1 change: 1 addition & 0 deletions coil-gif/src/main/java/coil/drawable/ScaleDrawable.kt
Expand Up @@ -48,6 +48,7 @@ class ScaleDrawable @JvmOverloads constructor(
child.alpha = alpha
}

@Deprecated("Deprecated in Java")
@Suppress("DEPRECATION")
override fun getOpacity() = child.opacity

Expand Down
2 changes: 0 additions & 2 deletions coil-singleton/src/test/java/coil/ImageLoaderFactoryTest.kt
Expand Up @@ -3,7 +3,6 @@ package coil
import android.app.Application
import android.content.Context
import androidx.test.core.app.ApplicationProvider
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.junit.After
import org.junit.Before
import org.junit.Test
Expand All @@ -15,7 +14,6 @@ import kotlin.test.assertFalse
import kotlin.test.assertSame
import kotlin.test.assertTrue

@OptIn(ExperimentalCoroutinesApi::class)
@RunWith(RobolectricTestRunner::class)
class ImageLoaderFactoryTest {

Expand Down
4 changes: 2 additions & 2 deletions docs/image_loaders.md
Expand Up @@ -56,8 +56,8 @@ class FakeImageLoader(private val context: Context) : ImageLoader {

override val defaults = DefaultRequestOptions()
override val components = ComponentRegistry()
override val memoryCache get() = null
override val diskCache get() = null
override val memoryCache: MemoryCache? get() = null
override val diskCache: DiskCache? get() = null

override fun enqueue(request: ImageRequest): Disposable {
// Always call onStart before onSuccess.
Expand Down