Skip to content

Commit

Permalink
Fix wear target
Browse files Browse the repository at this point in the history
  • Loading branch information
xxfast committed Sep 24, 2024
1 parent 8f723e5 commit a9e84ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .idea/runConfigurations/wear.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.platform.UriHandler
import androidx.compose.ui.text.style.TextAlign
Expand All @@ -29,12 +27,12 @@ import androidx.wear.compose.ui.tooling.preview.WearPreviewLargeRound
import androidx.wear.compose.ui.tooling.preview.WearPreviewSmallRound
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.compose.layout.ScalingLazyColumn
import com.seiko.imageloader.rememberAsyncImagePainter
import io.github.xxfast.decompose.router.rememberOnRoute
import io.github.xxfast.nytimes.wear.navigation.NavigationBox
import io.github.xxfast.nytimes.models.Article
import io.github.xxfast.nytimes.models.ArticleUri
import io.github.xxfast.nytimes.models.TopStorySection
import io.github.xxfast.nytimes.screens.story.ArticleImage
import io.github.xxfast.nytimes.screens.story.Loading
import io.github.xxfast.nytimes.screens.story.StoryState
import io.github.xxfast.nytimes.screens.story.StoryViewModel
Expand Down Expand Up @@ -114,15 +112,7 @@ fun StoryView(
val url = article.multimedia?.firstOrNull()?.url
if (url != null) {
item {
Image(
painter = rememberAsyncImagePainter(
url = url,
contentScale = ContentScale.Crop,
),
contentDescription = null,
modifier = Modifier
.clip(MaterialTheme.shapes.large)
)
ArticleImage(imageUrl = url)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import androidx.wear.compose.ui.tooling.preview.WearPreviewLargeRound
import androidx.wear.compose.ui.tooling.preview.WearPreviewSmallRound
import com.google.android.horologist.annotations.ExperimentalHorologistApi
import com.google.android.horologist.compose.layout.ScalingLazyColumn
import com.seiko.imageloader.rememberAsyncImagePainter
import com.seiko.imageloader.rememberImagePainter
import io.github.xxfast.decompose.router.rememberOnRoute
import io.github.xxfast.nytimes.models.ArticleUri
import io.github.xxfast.nytimes.models.TopStorySection
Expand Down Expand Up @@ -134,13 +134,13 @@ fun TopStoriesView(
onClick = { onSelectArticle(article.section, article.uri, article.title) },
title = { Text(article.title) },
backgroundPainter = CardDefaults.imageWithScrimBackgroundPainter(
backgroundImagePainter = rememberAsyncImagePainter(
backgroundImagePainter = rememberImagePainter(
url = article.imageUrl.orEmpty(),
contentScale = ContentScale.Crop,
)
),
contentColor = MaterialTheme.colors.onSurface,
titleColor = MaterialTheme.colors.onSurface,
modifier = Modifier.height(120.dp),
) {
CompactChip(onClick = {}, label = { Text(article.section.name) })
}
Expand Down

0 comments on commit a9e84ed

Please sign in to comment.