Skip to content

Commit

Permalink
Remove outdated AsyncImagePainter docs. (#2359)
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrtwhite authored Jul 8, 2024
1 parent 92d9342 commit e66425f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package coil3.compose

import androidx.compose.foundation.Image
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.runtime.Composable
import androidx.compose.runtime.NonRestartableComposable
import androidx.compose.runtime.ReadOnlyComposable
Expand All @@ -25,7 +23,6 @@ import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.util.trace
import coil3.Image
import coil3.ImageLoader
Expand Down Expand Up @@ -64,14 +61,6 @@ import kotlinx.coroutines.launch
*
* ** This is a lower-level API than [AsyncImage] and may not work as expected in all situations. **
*
* - [AsyncImagePainter] will not finish loading if [AsyncImagePainter.onDraw] is not called.
* This can occur if a composable has an unbounded (i.e. [Constraints.Infinity]) width/height
* constraint. For example, to use [AsyncImagePainter] with [LazyRow] or [LazyColumn], you must
* set a bounded width or height respectively using `Modifier.width` or `Modifier.height`.
* - [AsyncImagePainter.state] will not transition to [State.Success] synchronously during the
* composition phase. Use [SubcomposeAsyncImage] or set a custom [ImageRequest.Builder.size] value
* (e.g. `size(Size.ORIGINAL)`) if you need this.
*
* @param model Either an [ImageRequest] or the [ImageRequest.data] value.
* @param imageLoader The [ImageLoader] that will be used to execute the request.
* @param placeholder A [Painter] that is displayed while the image is loading.
Expand Down Expand Up @@ -115,14 +104,6 @@ fun rememberAsyncImagePainter(
*
* ** This is a lower-level API than [AsyncImage] and may not work as expected in all situations. **
*
* - [AsyncImagePainter] will not finish loading if [AsyncImagePainter.onDraw] is not called.
* This can occur if a composable has an unbounded (i.e. [Constraints.Infinity]) width/height
* constraint. For example, to use [AsyncImagePainter] with [LazyRow] or [LazyColumn], you must
* set a bounded width or height respectively using `Modifier.width` or `Modifier.height`.
* - [AsyncImagePainter.state] will not transition to [State.Success] synchronously during the
* composition phase. Use [SubcomposeAsyncImage] or set a custom [ImageRequest.Builder.size] value
* (e.g. `size(Size.ORIGINAL)`) if you need this.
*
* @param model Either an [ImageRequest] or the [ImageRequest.data] value.
* @param imageLoader The [ImageLoader] that will be used to execute the request.
* @param transform A callback to transform a new [State] before it's applied to the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package coil3.compose

import androidx.compose.foundation.Image
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.runtime.Composable
import androidx.compose.runtime.NonRestartableComposable
import androidx.compose.ui.graphics.FilterQuality
import androidx.compose.ui.graphics.drawscope.DrawScope.Companion.DefaultFilterQuality
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.Constraints
import coil3.SingletonImageLoader
import coil3.compose.AsyncImagePainter.Companion.DefaultTransform
import coil3.compose.AsyncImagePainter.State
Expand All @@ -20,14 +17,6 @@ import coil3.request.ImageRequest
*
* ** This is a lower-level API than [AsyncImage] and may not work as expected in all situations. **
*
* - [AsyncImagePainter] will not finish loading if [AsyncImagePainter.onDraw] is not called.
* This can occur if a composable has an unbounded (i.e. [Constraints.Infinity]) width/height
* constraint. For example, to use [AsyncImagePainter] with [LazyRow] or [LazyColumn], you must
* set a bounded width or height respectively using `Modifier.width` or `Modifier.height`.
* - [AsyncImagePainter.state] will not transition to [State.Success] synchronously during the
* composition phase. Use [SubcomposeAsyncImage] or set a custom [ImageRequest.Builder.size] value
* (e.g. `size(Size.ORIGINAL)`) if you need this.
*
* @param model Either an [ImageRequest] or the [ImageRequest.data] value.
* @param placeholder A [Painter] that is displayed while the image is loading.
* @param error A [Painter] that is displayed when the image request is unsuccessful.
Expand Down Expand Up @@ -75,14 +64,6 @@ fun rememberAsyncImagePainter(
*
* ** This is a lower-level API than [AsyncImage] and may not work as expected in all situations. **
*
* - [AsyncImagePainter] will not finish loading if [AsyncImagePainter.onDraw] is not called.
* This can occur if a composable has an unbounded (i.e. [Constraints.Infinity]) width/height
* constraint. For example, to use [AsyncImagePainter] with [LazyRow] or [LazyColumn], you must
* set a bounded width or height respectively using `Modifier.width` or `Modifier.height`.
* - [AsyncImagePainter.state] will not transition to [State.Success] synchronously during the
* composition phase. Use [SubcomposeAsyncImage] or set a custom [ImageRequest.Builder.size] value
* (e.g. `size(Size.ORIGINAL)`) if you need this.
*
* @param model Either an [ImageRequest] or the [ImageRequest.data] value.
* @param transform A callback to transform a new [State] before it's applied to the
* [AsyncImagePainter]. Typically this is used to overwrite the state's [Painter].
Expand Down

0 comments on commit e66425f

Please # to comment.