Skip to content

Commit

Permalink
Fix for using unique key in features and credits (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
TinasheMzondiwa authored Mar 20, 2023
1 parent 9f420ba commit 0fc3b90
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions common/misc/src/main/java/ss/misc/DeviceHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ import javax.inject.Inject
import javax.inject.Singleton

interface DeviceHelper {

/** Returns the device's country code. **/
fun country(): String

/** Returns the device's current timestamp in millis. **/
fun nowEpochMilli(): Long

}

@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal fun LazyListScope.footer(
)
}

items(spec.features, key = { it.name }) { feature ->
items(spec.features, key = { it.hashCode() }) { feature ->
FooterItem(
title = feature.title,
description = feature.description,
Expand All @@ -92,7 +92,7 @@ internal fun LazyListScope.footer(
)
}

items(spec.credits, key = { it.name }) { credit ->
items(spec.credits, key = { it.hashCode() }) { credit ->
FooterItem(
title = credit.name,
description = credit.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ internal data class QuarterlyFeaturesSpec(

@Composable
internal fun QuarterlyFeaturesRow(
modifier: Modifier = Modifier,
spec: QuarterlyFeaturesSpec
spec: QuarterlyFeaturesSpec,
modifier: Modifier = Modifier
) {
Row(
modifier = modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import app.ss.models.Credit
import javax.annotation.concurrent.Immutable

@Immutable
data class CreditSpec(
internal data class CreditSpec(
val name: String,
val value: String
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import app.ss.models.Feature
import javax.annotation.concurrent.Immutable

@Immutable
data class FeatureSpec(
internal data class FeatureSpec(
val name: String,
val title: String,
val description: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import androidx.compose.runtime.Immutable
import app.ss.models.PublishingInfo

@Immutable
data class PublishingInfoSpec(
internal data class PublishingInfoSpec(
val message: String,
val url: String,
val primaryColorHex: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.joda.time.Interval
import ss.misc.DateHelper

@Immutable
data class QuarterlyInfoSpec(
internal data class QuarterlyInfoSpec(
val title: String,
val description: String,
val date: String,
Expand Down

0 comments on commit 0fc3b90

Please sign in to comment.