Merge pull request #179 from Abhimanyu14/niaicons

Icons alignment to use NiaIcons
pull/445/head
Milosz Moczkowski 2 years ago committed by GitHub
commit c62673d035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,9 +17,6 @@
package com.google.samples.apps.nowinandroid.core.designsystem.component package com.google.samples.apps.nowinandroid.core.designsystem.component
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
@ -33,6 +30,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class)
@Composable @Composable
@ -107,9 +105,9 @@ fun NiaTopAppBar(
fun NiaTopAppBarPreview() { fun NiaTopAppBarPreview() {
NiaTopAppBar( NiaTopAppBar(
titleRes = android.R.string.untitled, titleRes = android.R.string.untitled,
navigationIcon = Icons.Default.Search, navigationIcon = NiaIcons.Search,
navigationIconContentDescription = "Navigation icon", navigationIconContentDescription = "Navigation icon",
actionIcon = Icons.Default.MoreVert, actionIcon = NiaIcons.MoreVert,
actionIconContentDescription = "Action icon" actionIconContentDescription = "Action icon"
) )
} }

@ -32,8 +32,6 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons.Filled
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@ -53,6 +51,7 @@ import coil.compose.AsyncImage
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaBackground import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaBackground
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaLoadingWheel import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaLoadingWheel
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
import com.google.samples.apps.nowinandroid.core.domain.model.FollowableAuthor import com.google.samples.apps.nowinandroid.core.domain.model.FollowableAuthor
import com.google.samples.apps.nowinandroid.core.domain.model.SaveableNewsResource import com.google.samples.apps.nowinandroid.core.domain.model.SaveableNewsResource
@ -213,7 +212,7 @@ private fun AuthorToolbar(
) { ) {
IconButton(onClick = { onBackClick() }) { IconButton(onClick = { onBackClick() }) {
Icon( Icon(
imageVector = Filled.ArrowBack, imageVector = NiaIcons.ArrowBack,
contentDescription = stringResource( contentDescription = stringResource(
id = com.google.samples.apps.nowinandroid.core.ui.R.string.back id = com.google.samples.apps.nowinandroid.core.ui.R.string.back
) )

@ -31,8 +31,6 @@ import androidx.compose.foundation.layout.windowInsetsTopHeight
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons.Filled
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@ -51,6 +49,7 @@ import coil.compose.AsyncImage
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaBackground import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaBackground
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaLoadingWheel import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaLoadingWheel
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
import com.google.samples.apps.nowinandroid.core.domain.model.FollowableTopic import com.google.samples.apps.nowinandroid.core.domain.model.FollowableTopic
import com.google.samples.apps.nowinandroid.core.domain.model.SaveableNewsResource import com.google.samples.apps.nowinandroid.core.domain.model.SaveableNewsResource
@ -109,6 +108,7 @@ internal fun TopicScreen(
contentDesc = stringResource(id = string.topic_loading), contentDesc = stringResource(id = string.topic_loading),
) )
} }
TopicUiState.Error -> TODO() TopicUiState.Error -> TODO()
is TopicUiState.Success -> { is TopicUiState.Success -> {
item { item {
@ -186,9 +186,11 @@ private fun LazyListScope.TopicCards(
itemModifier = Modifier.padding(24.dp) itemModifier = Modifier.padding(24.dp)
) )
} }
is NewsUiState.Loading -> item { is NewsUiState.Loading -> item {
NiaLoadingWheel(contentDesc = "Loading news") // TODO NiaLoadingWheel(contentDesc = "Loading news") // TODO
} }
else -> item { else -> item {
Text("Error") // TODO Text("Error") // TODO
} }
@ -224,7 +226,7 @@ private fun TopicToolbar(
) { ) {
IconButton(onClick = { onBackClick() }) { IconButton(onClick = { onBackClick() }) {
Icon( Icon(
imageVector = Filled.ArrowBack, imageVector = NiaIcons.ArrowBack,
contentDescription = stringResource( contentDescription = stringResource(
id = com.google.samples.apps.nowinandroid.core.ui.R.string.back id = com.google.samples.apps.nowinandroid.core.ui.R.string.back
) )

Loading…
Cancel
Save