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

fix: Fix broken organizer images #269

Merged
merged 1 commit into from
Nov 8, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ hiltsecond = "1.1.0-rc01"
runtime = "2.8.1"
material = "1.10.0"
junit = "1.1.5"
coli = "2.4.0"
coil = "2.4.0"
activity = "1.8.0"
preview_customview = "1.2.0-alpha02"
poolingcontainer = "1.0.0"
Expand Down Expand Up @@ -70,7 +70,8 @@ android-test-espresso = { module = "androidx.test.espresso:espresso-core", versi
android-test-idling = { module = "androidx.test.espresso:espresso-idling-resource", version.ref = "espresso" }
android-test-junit4 = { module = "androidx.test.ext:junit", version.ref = "junit"}
androidx-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "splash" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coli"}
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil"}
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coil"}
compose-activity = { module = "androidx.activity:activity-compose", version.ref = "activity"}
compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "composecompiler"}
compose-material-3 = { module = "androidx.compose.material3:material3" }
Expand Down Expand Up @@ -145,7 +146,7 @@ kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", ve
ksp-gradlePlugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }

[bundles]
compose = ["coil-compose", "compose-activity", "compose-compiler", "compose-material-3", "compose-materialIcons", "compose-runtimeLivedata", "compose-ui", "compose-ui-util", "compose-ui-tooling", "compose-ui-tooling-preview", "paging-compose", "compose-preview-customview", "compose-preview-customview-poolingcontainer", "compose-constraintlayout", "compose-lifecycle-runtime"]
compose = ["coil-compose", "coil-svg", "compose-activity", "compose-compiler", "compose-material-3", "compose-materialIcons", "compose-runtimeLivedata", "compose-ui", "compose-ui-util", "compose-ui-tooling", "compose-ui-tooling-preview", "paging-compose", "compose-preview-customview", "compose-preview-customview-poolingcontainer", "compose-constraintlayout", "compose-lifecycle-runtime"]
lifecycle = ["lifecycle-livedataKtx", "lifecycle-runtimeKtx", "lifecycle-viewmodel-compose"]
room = ["room-ktx", "room-paging", "room-runtime"]
ktor = ["ktor-core", "ktor-android", "ktor-json", "ktor-content-negotiation", "ktor-auth", "ktor-logging", "ktor-okhttp"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil.decode.SvgDecoder
import coil.request.ImageRequest
import com.droidconke.chai.chaiColorsPalette
import com.droidconke.chai.components.ChaiTitle
Expand All @@ -50,7 +51,7 @@ fun OrganizedBySection(
) {
ChaiTitle(
modifier = Modifier
.fillMaxWidth(),
.fillMaxWidth().padding(start = 20.dp),
titleText = stringResource(id = R.string.organized_by),
titleColor = MaterialTheme.chaiColorsPalette.textLabelAndHeadings
)
Expand All @@ -61,16 +62,24 @@ fun OrganizedBySection(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.Center,
verticalArrangement = Arrangement.Center
verticalArrangement = Arrangement.spacedBy(12.dp)
) {
organizationLogos.forEach { logo ->

AsyncImage(
modifier = Modifier
.height(200.dp)
.padding(6.dp),
model = ImageRequest.Builder(LocalContext.current)
.data(logo)
.build(),
model = if (logo.endsWith("svg")) {
ImageRequest.Builder(LocalContext.current)
.data(logo)
.decoderFactory(SvgDecoder.Factory())
.build()
} else {
ImageRequest.Builder(LocalContext.current)
.data(logo)
.build()
},
placeholder = painterResource(R.drawable.ic_google_logo_icon),
contentDescription = stringResource(id = R.string.logo)
)
Expand Down
2 changes: 1 addition & 1 deletion presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<string name="about">About</string>
<string name="about_droidcon">Droidcon is a global conference focused on the engineering of Android applications. Droidcon provides a forum for developers to network with other developers, share techniques, announce apps and products, and to learn and teach.\n\nThis three-day developer focused gathering will be held in Nairobi, Kenya on November 8th to 10th 2023 and will be the largest of its kind in Africa.\n\nIt will have workshops and codelabs focused on the building of Android applications and will give participants an excellent chance to learn about the local Android development ecosystem, opportunities and services as well as meet the engineers and companies who work on them.</string>
<string name="about_organizing_team">Organizing Team</string>
<string name="organized_by">Organized by;</string>
<string name="organized_by">Organizers</string>
<string name="logo">Logo</string>
<string name="user_profile">User profile</string>
<string name="about_droidcon_image">droidcon Image</string>
Expand Down
Loading