Skip to content

Commit

Permalink
Updating icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahkeen committed Aug 5, 2024
1 parent b78431f commit df77730
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ fun CommentRow(
) {
Icon(
modifier = Modifier.size(12.dp),
painter = painterResource(R.drawable.ic_time),
painter = painterResource(R.drawable.ic_time_outline),
tint = MaterialTheme.colorScheme.onSurface,
contentDescription = "To,e"
contentDescription = "Time posted"
)
}
Spacer(modifier = Modifier.weight(1f))
Expand Down Expand Up @@ -411,18 +411,7 @@ fun CommentRowPreview() {
timeLabel = "2d ago",
upvoted = false,
upvoteUrl = "",
children = listOf(
CommentState.Content(
id = 2,
level = 1,
author = "vasantm",
content = "Hello Child",
timeLabel = "2h ago",
upvoted = false,
upvoteUrl = "",
children = listOf()
)
)
children = listOf()
),
onLikeTapped = {}
)
Expand Down Expand Up @@ -481,7 +470,7 @@ fun ItemHeader(
MetadataTag(label = state.timeLabel) {
Icon(
modifier = Modifier.size(12.dp),
painter = painterResource(R.drawable.ic_time),
painter = painterResource(R.drawable.ic_time_outline),
tint = HackerRed,
contentDescription = "Time Posted"
)
Expand Down Expand Up @@ -509,7 +498,7 @@ fun ItemHeader(
Box(
Modifier
.fillMaxWidth()
.heightIn(min = 44.dp)
.heightIn(min = 40.dp)
.clip(RoundedCornerShape(8.dp))
.background(color = MaterialTheme.colorScheme.surface)
.padding(8.dp),
Expand Down Expand Up @@ -553,7 +542,10 @@ fun ItemHeader(
)
}
}
Row(horizontalArrangement = Arrangement.spacedBy(4.dp), verticalAlignment = Alignment.CenterVertically) {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalAlignment = Alignment.CenterVertically
) {
Box(
modifier = Modifier
.width(60.dp)
Expand Down Expand Up @@ -606,36 +598,48 @@ fun ItemHeader(
@Composable
private fun ItemHeaderPreview() {
HackerNewsTheme {
ItemHeader(
state = HeaderState.Content(
id = 0L,
title = "Show HN: A super neat HN client for Android",
author = "rikinm",
points = 69,
timeLabel = "2h ago",
body = "Hi there",
upvoted = false,
upvoteUrl = "",
),
Box(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
onLikeTapped = {}
)
.background(MaterialTheme.colorScheme.background)
.padding(8.dp)
) {
ItemHeader(
state = HeaderState.Content(
id = 0L,
title = "Show HN: A super neat HN client for Android",
author = "rikinm",
points = 69,
timeLabel = "2h ago",
body = "Wassup HN. I just built a sick new Hacker News Android client",
upvoted = false,
upvoteUrl = "",
),
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
onLikeTapped = {}
)
}
}
}

@PreviewLightDark
@Composable
private fun ItemHeaderLoadingPreview() {
HackerNewsTheme {
ItemHeader(
state = HeaderState.Loading,
Box(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
onLikeTapped = {}
)
.background(MaterialTheme.colorScheme.background)
.padding(8.dp)
) {
ItemHeader(
state = HeaderState.Loading,
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
onLikeTapped = {}
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ fun LoginCard(
scaleY = iconScale
}
.size(12.dp),
imageVector = Icons.Rounded.ThumbUp,
painter = painterResource(R.drawable.ic_upvote),
tint = likeColor,
contentDescription = "Likes"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.DateRange
import androidx.compose.material.icons.rounded.Refresh
import androidx.compose.material.icons.rounded.Warning
import androidx.compose.material3.Button
Expand Down Expand Up @@ -292,7 +291,7 @@ fun StoryRow(
) {
Icon(
modifier = Modifier.size(12.dp),
painter = painterResource(R.drawable.ic_time),
painter = painterResource(R.drawable.ic_time_outline),
tint = HackerRed,
contentDescription = "Likes"
)
Expand Down Expand Up @@ -427,10 +426,12 @@ fun ListSeparator(
lineColor: Color,
space: Dp = 0.5.dp
) {
Spacer(modifier = Modifier
.fillMaxWidth()
.height(space)
.background(color = lineColor))
Spacer(
modifier = Modifier
.fillMaxWidth()
.height(space)
.background(color = lineColor)
)
}

@Composable
Expand Down
10 changes: 0 additions & 10 deletions android/app/src/main/res/drawable/ic_time.xml

This file was deleted.

13 changes: 13 additions & 0 deletions android/app/src/main/res/drawable/ic_time_outline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,6V12H16.5M21,12C21,16.971 16.971,21 12,21C7.029,21 3,16.971 3,12C3,7.029 7.029,3 12,3C16.971,3 21,7.029 21,12Z"
android:strokeLineJoin="round"
android:strokeWidth="1.5"
android:fillColor="#00000000"
android:strokeColor="#0F172A"
android:strokeLineCap="round"/>
</vector>
12 changes: 0 additions & 12 deletions android/app/src/main/res/drawable/ic_user.xml

This file was deleted.

33 changes: 0 additions & 33 deletions android/app/src/main/res/drawable/ic_web.xml

This file was deleted.

0 comments on commit df77730

Please sign in to comment.