Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mhss1 authored May 6, 2022
2 parents cb0d6ac + d3b9ee4 commit 4f6f8b2
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -112,7 +113,7 @@ private fun LazyListScope.plannedPaymentItems(
SectionDivider(
expanded = oneTimeExpanded,
setExpanded = setOneTimeExpanded,
title = "One time payments",
title = stringResource(R.string.one_time_payments),
titleColor = UI.colors.pureInverse,
baseCurrency = currency,
income = oneTimeIncome,
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/ivy/wallet/ui/reports/ReportScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -82,7 +83,7 @@ private fun BoxWithConstraintsScope.UI(
contentAlignment = Alignment.Center
) {
Text(
text = "Generating report...",
text = stringResource(R.string.generating_report),
style = UI.typo.b1.style(
fontWeight = FontWeight.ExtraBold,
color = Orange
Expand Down Expand Up @@ -210,8 +211,7 @@ private fun BoxWithConstraintsScope.UI(
onEventHandler.invoke(ReportScreenEvent.OnPayOrGet(transaction = it))
},
emptyStateTitle = stringRes(R.string.no_transactions),

emptyStateText = stringRes(R.string.no_transactions_for_your_filter),
emptyStateText = stringRes(R.string.no_transactions_for_your_filter)
)
} else {
item {
Expand Down Expand Up @@ -288,7 +288,7 @@ private fun NoFilterEmptyState(

IvyButton(
iconStart = R.drawable.ic_filter_xs,
text = stringResource(R.string.set_filter),
text = stringResource(R.string.set_filter)
) {
setFilterOverlayVisible(true)
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/ivy/wallet/ui/search/SearchScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -126,7 +127,7 @@ private fun UI(
onPayOrGet = { },
dateDividerMarginTop = 16.dp,
emptyStateTitle = stringRes(R.string.no_transactions),
emptyStateText = stringRes(R.string.no_transactions_for_query, searchQueryTextFieldValue.text),
emptyStateText = stringRes(R.string.no_transactions_for_query, searchQueryTextFieldValue.text)
)

item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -337,13 +338,23 @@ private fun CategoryAmountCard(
) {
Spacer(Modifier.width(20.dp))

ItemIconMDefaultIcon(
ItemIconM(
modifier = Modifier.background(categoryColor, CircleShape),
iconName = category?.icon,
defaultIcon = R.drawable.ic_custom_category_m,
tint = findContrastTextColor(categoryColor)
tint = findContrastTextColor(categoryColor),
iconContentScale = ContentScale.None,
Default = {
ItemIconMDefaultIcon(
modifier = Modifier.background(categoryColor, CircleShape),
iconName = category?.icon,
defaultIcon = R.drawable.ic_custom_category_m,
tint = findContrastTextColor(categoryColor)
)
}
)



Spacer(Modifier.width(16.dp))

Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fun ItemIconL(
modifier: Modifier = Modifier,
iconName: String?,
tint: Color = UI.colors.pureInverse,
iconContentScale: ContentScale? = null,
Default: (@Composable () -> Unit)? = null
) {
ItemIcon(
Expand All @@ -34,6 +35,7 @@ fun ItemIconL(
size = "l",
iconName = iconName,
tint = tint,
iconContentScale = iconContentScale,
Default = Default
)
}
Expand Down Expand Up @@ -65,6 +67,7 @@ fun ItemIconM(
modifier: Modifier = Modifier,
iconName: String?,
tint: Color = UI.colors.pureInverse,
iconContentScale: ContentScale? = null,
Default: (@Composable () -> Unit)? = null
) {
ItemIcon(
Expand All @@ -73,6 +76,7 @@ fun ItemIconM(
size = "m",
iconName = iconName,
tint = tint,
iconContentScale = iconContentScale,
Default = Default
)
}
Expand Down Expand Up @@ -104,6 +108,7 @@ fun ItemIconS(
modifier: Modifier = Modifier,
iconName: String?,
tint: Color = UI.colors.pureInverse,
iconContentScale: ContentScale? = null,
Default: (@Composable () -> Unit)? = null
) {
ItemIcon(
Expand All @@ -112,6 +117,7 @@ fun ItemIconS(
size = "s",
iconName = iconName,
tint = tint,
iconContentScale = iconContentScale,
Default = Default
)
}
Expand All @@ -122,6 +128,7 @@ private fun ItemIcon(
iconName: String?,
size: String,
tint: Color = UI.colors.pureInverse,
iconContentScale: ContentScale? = null,
Default: (@Composable () -> Unit)? = null
) {
val context = LocalContext.current
Expand Down Expand Up @@ -157,7 +164,7 @@ private fun ItemIcon(
painter = painterResource(id = iconInfo.iconId),
colorFilter = ColorFilter.tint(tint),
alignment = Alignment.Center,
contentScale = if (iconInfo.newFormat)
contentScale = iconContentScale ?: if (iconInfo.newFormat)
ContentScale.Fit else ContentScale.None,
contentDescription = iconName ?: "item icon"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
Expand All @@ -22,6 +23,7 @@ import com.ivy.wallet.domain.data.TransactionHistoryItem
import com.ivy.wallet.domain.data.core.Account
import com.ivy.wallet.domain.data.core.Category
import com.ivy.wallet.domain.data.core.Transaction
import com.ivy.wallet.stringRes
import com.ivy.wallet.ui.EditTransaction
import com.ivy.wallet.ui.IvyWalletCtx
import com.ivy.wallet.ui.theme.Gray
Expand Down Expand Up @@ -50,7 +52,7 @@ fun LazyListScope.transactions(
history: List<TransactionHistoryItem>,
lastItemSpacer: Dp? = null,
onPayOrGet: (Transaction) -> Unit,
emptyStateTitle: String = "No transactions",
emptyStateTitle: String = stringRes(R.string.no_transactions),
emptyStateText: String,
dateDividerMarginTop: Dp? = null
) {
Expand All @@ -59,7 +61,7 @@ fun LazyListScope.transactions(
SectionDivider(
expanded = upcomingExpanded,
setExpanded = setUpcomingExpanded,
title = "Upcoming",
title = stringRes(R.string.upcoming),
titleColor = Orange,
baseCurrency = baseCurrency,
income = upcomingIncome,
Expand Down Expand Up @@ -91,7 +93,7 @@ fun LazyListScope.transactions(
SectionDivider(
expanded = overdueExpanded,
setExpanded = setOverdueExpanded,
title = "Overdue",
title = stringRes(R.string.overdue),
titleColor = Red,
baseCurrency = baseCurrency,
income = overdueIncome,
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,5 @@
<string name="transfers_as_income_expense"><![CDATA[Transfers as income & expenses]]></string>
<string name="transfers_as_income_expense_description">Treats account transfers as income or expense in Accounts Screen</string>
<string name="home_category">Дом</string>
<string name="generating_report">Generating report…</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,5 @@
<string name="transfers_as_income_expense"><![CDATA[Trasferimenti come entrate ed uscite]]></string>
<string name="transfers_as_income_expense_description">Tratta i trasferimenti di conto come entrate o uscite nella schermata dei conti</string>
<string name="home_category">Casa</string>
<string name="generating_report">Generazione report…</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,5 @@
<string name="transfers_as_income_expense"><![CDATA[Transfers as income & expenses]]></string>
<string name="transfers_as_income_expense_description">Treats account transfers as income or expense in Accounts Screen</string>
<string name="home_category">Home</string>
<string name="generating_report">Generating report…</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import org.gradle.kotlin.dsl.project

object Project {
//Version
const val versionName = "4.1.1"
const val versionCode = 107
const val versionName = "4.1.2"
const val versionCode = 108

//Compile SDK & Build Tools
const val compileSdkVersion = 31
Expand Down

0 comments on commit 4f6f8b2

Please sign in to comment.