Skip to content
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
1 change: 0 additions & 1 deletion Reply/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ dependencies {
implementation("com.google.accompanist:accompanist-adaptive:0.26.2-beta")

implementation(libs.androidx.compose.materialWindow)
implementation(libs.androidx.compose.material.iconsExtended)

implementation(libs.androidx.lifecycle.runtime)
implementation(libs.androidx.lifecycle.viewModelCompose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material3.ExtendedFloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
Expand All @@ -42,6 +40,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.window.layout.DisplayFeature
Expand Down Expand Up @@ -115,7 +114,9 @@ fun ReplyInboxScreen(
if (navigationType == ReplyNavigationType.BOTTOM_NAVIGATION) {
ExtendedFloatingActionButton(
text = { Text(text = stringResource(id = R.string.compose)) },
icon = { Icon(Icons.Default.Edit, stringResource(id = R.string.compose)) },
icon = {
Icon(painter = painterResource(id = R.drawable.ic_edit), contentDescription = stringResource(id = R.string.compose))
},
onClick = { /*TODO*/ },
modifier = Modifier
.align(Alignment.BottomEnd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.MoreVert
import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.DockedSearchBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilledIconButton
Expand All @@ -50,6 +46,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.example.reply.R
Expand Down Expand Up @@ -99,7 +96,7 @@ fun ReplyDockedSearchBar(emails: List<Email>, onSearchItemSelected: (Email) -> U
leadingIcon = {
if (expanded) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
painter = painterResource(id = R.drawable.ic_arrow_back),
contentDescription = stringResource(id = R.string.back_button),
modifier = Modifier
.padding(start = 16.dp)
Expand All @@ -110,7 +107,7 @@ fun ReplyDockedSearchBar(emails: List<Email>, onSearchItemSelected: (Email) -> U
)
} else {
Icon(
imageVector = Icons.Default.Search,
painter = painterResource(id = R.drawable.ic_search),
contentDescription = stringResource(id = R.string.search),
modifier = Modifier.padding(start = 16.dp),
)
Expand Down Expand Up @@ -209,7 +206,7 @@ fun EmailDetailAppBar(email: Email, isFullScreen: Boolean, modifier: Modifier =
),
) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
painter = painterResource(id = R.drawable.ic_arrow_back),
contentDescription = stringResource(id = R.string.back_button),
modifier = Modifier.size(14.dp),
)
Expand All @@ -221,7 +218,7 @@ fun EmailDetailAppBar(email: Email, isFullScreen: Boolean, modifier: Modifier =
onClick = { /*TODO*/ },
) {
Icon(
imageVector = Icons.Default.MoreVert,
painter = painterResource(id = R.drawable.ic_more_vert),
contentDescription = stringResource(id = R.string.more_options_button),
tint = MaterialTheme.colorScheme.onSurfaceVariant,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.StarBorder
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
Expand All @@ -44,10 +41,12 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.selected
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.example.reply.R
import com.example.reply.data.Email

@OptIn(ExperimentalFoundationApi::class)
Expand Down Expand Up @@ -86,8 +85,8 @@ fun ReplyEmailListItem(
interactionSource = remember { MutableInteractionSource() },
indication = null,
) { toggleSelection(email.id) }
AnimatedContent(targetState = isSelected, label = "avatar") { selected ->
if (selected) {
AnimatedContent(targetState = isSelected, label = "avatar") {
if (it) {
SelectedProfileImage(clickModifier)
} else {
ReplyProfileImage(
Expand Down Expand Up @@ -120,7 +119,7 @@ fun ReplyEmailListItem(
.background(MaterialTheme.colorScheme.surfaceContainerHigh),
) {
Icon(
imageVector = Icons.Default.StarBorder,
painter = painterResource(id = R.drawable.ic_star_border),
contentDescription = "Favorite",
tint = MaterialTheme.colorScheme.outline,
)
Expand Down Expand Up @@ -151,7 +150,7 @@ fun SelectedProfileImage(modifier: Modifier = Modifier) {
.background(MaterialTheme.colorScheme.primary),
) {
Icon(
Icons.Default.Check,
painter = painterResource(id = R.drawable.ic_check),
contentDescription = null,
modifier = Modifier
.size(24.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.StarBorder
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.Card
Expand All @@ -36,6 +34,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.example.reply.R
Expand Down Expand Up @@ -82,7 +81,7 @@ fun ReplyEmailThreadItem(email: Email, modifier: Modifier = Modifier) {
.background(MaterialTheme.colorScheme.surfaceContainer),
) {
Icon(
imageVector = Icons.Default.StarBorder,
painter = painterResource(id = R.drawable.ic_star_border),
contentDescription = "Favorite",
tint = MaterialTheme.colorScheme.outline,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

package com.example.reply.ui.navigation

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.Article
import androidx.compose.material.icons.filled.Inbox
import androidx.compose.material.icons.filled.People
import androidx.compose.material.icons.outlined.ChatBubbleOutline
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.NavHostController
import com.example.reply.R
Expand All @@ -34,7 +28,7 @@ sealed interface Route {
@Serializable data object Groups : Route
}

data class ReplyTopLevelDestination(val route: Route, val selectedIcon: ImageVector, val unselectedIcon: ImageVector, val iconTextId: Int)
data class ReplyTopLevelDestination(val route: Route, val selectedIcon: Int, val unselectedIcon: Int, val iconTextId: Int)

class ReplyNavigationActions(private val navController: NavHostController) {

Expand All @@ -58,27 +52,27 @@ class ReplyNavigationActions(private val navController: NavHostController) {
val TOP_LEVEL_DESTINATIONS = listOf(
ReplyTopLevelDestination(
route = Route.Inbox,
selectedIcon = Icons.Default.Inbox,
unselectedIcon = Icons.Default.Inbox,
selectedIcon = R.drawable.ic_inbox,
unselectedIcon = R.drawable.ic_inbox,
iconTextId = R.string.tab_inbox,
),
ReplyTopLevelDestination(
route = Route.Articles,
selectedIcon = Icons.AutoMirrored.Filled.Article,
unselectedIcon = Icons.AutoMirrored.Filled.Article,
selectedIcon = R.drawable.ic_article,
unselectedIcon = R.drawable.ic_article,
iconTextId = R.string.tab_article,
),
ReplyTopLevelDestination(
route = Route.DirectMessages,
selectedIcon = Icons.Outlined.ChatBubbleOutline,
unselectedIcon = Icons.Outlined.ChatBubbleOutline,
iconTextId = R.string.tab_inbox,
selectedIcon = R.drawable.ic_chat_bubble_outline,
unselectedIcon = R.drawable.ic_chat_bubble_outline,
iconTextId = R.string.tab_dm,
),
ReplyTopLevelDestination(
route = Route.Groups,
selectedIcon = Icons.Default.People,
unselectedIcon = Icons.Default.People,
iconTextId = R.string.tab_article,
selectedIcon = R.drawable.ic_group,
unselectedIcon = R.drawable.ic_group,
iconTextId = R.string.tab_groups,
),

)
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.sizeIn
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.MenuOpen
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material3.DrawerValue
import androidx.compose.material3.ExtendedFloatingActionButton
import androidx.compose.material3.FloatingActionButton
Expand Down Expand Up @@ -65,6 +61,7 @@ import androidx.compose.ui.layout.Measurable
import androidx.compose.ui.layout.MeasurePolicy
import androidx.compose.ui.layout.layoutId
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -191,7 +188,7 @@ fun ReplyNavigationRail(
onClick = onDrawerClicked,
icon = {
Icon(
imageVector = Icons.Default.Menu,
painter = painterResource(id = R.drawable.ic_menu),
contentDescription = stringResource(id = R.string.navigation_drawer),
)
},
Expand All @@ -203,7 +200,7 @@ fun ReplyNavigationRail(
contentColor = MaterialTheme.colorScheme.onTertiaryContainer,
) {
Icon(
imageVector = Icons.Default.Edit,
painter = painterResource(id = R.drawable.ic_edit),
contentDescription = stringResource(id = R.string.compose),
modifier = Modifier.size(18.dp),
)
Expand All @@ -223,7 +220,7 @@ fun ReplyNavigationRail(
onClick = { navigateToTopLevelDestination(replyDestination) },
icon = {
Icon(
imageVector = replyDestination.selectedIcon,
painter = painterResource(id = replyDestination.selectedIcon),
contentDescription = stringResource(
id = replyDestination.iconTextId,
),
Expand All @@ -244,7 +241,7 @@ fun ReplyBottomNavigationBar(currentDestination: NavDestination?, navigateToTopL
onClick = { navigateToTopLevelDestination(replyDestination) },
icon = {
Icon(
imageVector = replyDestination.selectedIcon,
painter = painterResource(id = replyDestination.selectedIcon),
contentDescription = stringResource(id = replyDestination.iconTextId),
)
},
Expand Down Expand Up @@ -290,7 +287,7 @@ fun PermanentNavigationDrawerContent(
contentColor = MaterialTheme.colorScheme.onTertiaryContainer,
) {
Icon(
imageVector = Icons.Default.Edit,
painter = painterResource(id = R.drawable.ic_edit),
contentDescription = stringResource(id = R.string.compose),
modifier = Modifier.size(24.dp),
)
Expand Down Expand Up @@ -319,7 +316,7 @@ fun PermanentNavigationDrawerContent(
},
icon = {
Icon(
imageVector = replyDestination.selectedIcon,
painter = painterResource(id = replyDestination.selectedIcon),
contentDescription = stringResource(
id = replyDestination.iconTextId,
),
Expand Down Expand Up @@ -371,7 +368,7 @@ fun ModalNavigationDrawerContent(
)
IconButton(onClick = onDrawerClicked) {
Icon(
imageVector = Icons.AutoMirrored.Filled.MenuOpen,
painter = painterResource(id = R.drawable.ic_menu_open),
contentDescription = stringResource(id = R.string.close_drawer),
)
}
Expand All @@ -386,7 +383,7 @@ fun ModalNavigationDrawerContent(
contentColor = MaterialTheme.colorScheme.onTertiaryContainer,
) {
Icon(
imageVector = Icons.Default.Edit,
painter = painterResource(id = R.drawable.ic_edit),
contentDescription = stringResource(id = R.string.compose),
modifier = Modifier.size(18.dp),
)
Expand Down Expand Up @@ -415,7 +412,7 @@ fun ModalNavigationDrawerContent(
},
icon = {
Icon(
imageVector = replyDestination.selectedIcon,
painter = painterResource(id = replyDestination.selectedIcon),
contentDescription = stringResource(
id = replyDestination.iconTextId,
),
Expand Down
10 changes: 10 additions & 0 deletions Reply/app/src/main/res/drawable/ic_arrow_back.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M313,520L537,744L480,800L160,480L480,160L537,216L313,440L800,440L800,520L313,520Z"/>
</vector>
10 changes: 10 additions & 0 deletions Reply/app/src/main/res/drawable/ic_article.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M200,840Q167,840 143.5,816.5Q120,793 120,760L120,200Q120,167 143.5,143.5Q167,120 200,120L760,120Q793,120 816.5,143.5Q840,167 840,200L840,760Q840,793 816.5,816.5Q793,840 760,840L200,840ZM280,680L560,680L560,600L280,600L280,680ZM280,520L680,520L680,440L280,440L280,520ZM280,360L680,360L680,280L280,280L280,360Z"/>
</vector>
9 changes: 9 additions & 0 deletions Reply/app/src/main/res/drawable/ic_chat_bubble_outline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M80,880L80,160Q80,127 103.5,103.5Q127,80 160,80L800,80Q833,80 856.5,103.5Q880,127 880,160L880,640Q880,673 856.5,696.5Q833,720 800,720L240,720L80,880ZM206,640L800,640Q800,640 800,640Q800,640 800,640L800,160Q800,160 800,160Q800,160 800,160L160,160Q160,160 160,160Q160,160 160,160L160,685L206,640ZM160,640L160,640L160,160Q160,160 160,160Q160,160 160,160L160,160Q160,160 160,160Q160,160 160,160L160,640Q160,640 160,640Q160,640 160,640Z"/>
</vector>
9 changes: 9 additions & 0 deletions Reply/app/src/main/res/drawable/ic_check.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M382,720L154,492L211,435L382,606L749,239L806,296L382,720Z"/>
</vector>
9 changes: 9 additions & 0 deletions Reply/app/src/main/res/drawable/ic_edit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M200,760L257,760L648,369L591,312L200,703L200,760ZM120,840L120,670L648,143Q660,132 674.5,126Q689,120 705,120Q721,120 736,126Q751,132 762,144L817,200Q829,211 834.5,226Q840,241 840,256Q840,272 834.5,286.5Q829,301 817,313L290,840L120,840ZM760,256L760,256L704,200L704,200L760,256ZM619,341L591,312L591,312L648,369L648,369L619,341Z"/>
Comment on lines +7 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The fillColor is hardcoded to @android:color/white. This prevents the icon from being tinted correctly by Icon composables, especially when a tint color is provided. To ensure icons can be themed and tinted dynamically, please remove the android:fillColor attribute from the <path>.

  <path
      android:pathData="M200,760L257,760L648,369L591,312L200,703L200,760ZM120,840L120,670L648,143Q660,132 674.5,126Q689,120 705,120Q721,120 736,126Q751,132 762,144L817,200Q829,211 834.5,226Q840,241 840,256Q840,272 834.5,286.5Q829,301 817,313L290,840L120,840ZM760,256L760,256L704,200L704,200L760,256ZM619,341L591,312L591,312L648,369L648,369L619,341Z"/>

</vector>
Loading