Skip to content

Commit

Permalink
Merge pull request #1492 from joreilly/image_loading_indicator
Browse files Browse the repository at this point in the history
progress indicator when showing speaker images
  • Loading branch information
joreilly authored Dec 1, 2024
2 parents 7bf551e + 0b33261 commit 3e30172
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_platform :android

platform :android do

androidVersionNum = 252
androidVersionNum = 253
wearVersionNum = 328

before_all do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Person
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
Expand All @@ -34,7 +35,7 @@ import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import coil3.compose.AsyncImage
import coil3.compose.SubcomposeAsyncImage
import confetti.shared.generated.resources.Res
import confetti.shared.generated.resources.speakers
import dev.johnoreilly.confetti.fragment.SessionDetails
Expand Down Expand Up @@ -152,11 +153,15 @@ internal fun SessionSpeakerInfo(
Row {
speaker.photoUrl?.let {
val url = "https://confetti-app.dev/images/avatar/${conference}/${speaker.id}"
AsyncImage(
SubcomposeAsyncImage(
model = url,
contentDescription = speaker.name,
loading = {
CircularProgressIndicator()
},
contentScale = ContentScale.Crop,
modifier = Modifier.size(64.dp)
modifier = Modifier
.size(64.dp)
.clip(CircleShape)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -19,7 +20,7 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil3.compose.AsyncImage
import coil3.compose.SubcomposeAsyncImage
import dev.johnoreilly.confetti.fragment.SpeakerDetails


Expand All @@ -43,9 +44,12 @@ fun SpeakerGridView(

// proxy image requests through backend
val url = "https://confetti-app.dev/images/avatar/${conference}/${speaker.id}"
AsyncImage(
SubcomposeAsyncImage(
model = url,
contentDescription = speaker.name,
loading = {
CircularProgressIndicator()
},
contentScale = ContentScale.Fit,
modifier = Modifier
.size(150.dp)
Expand Down

0 comments on commit 3e30172

Please sign in to comment.