Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ILIYANGERMANOV/ivy-wallet
Browse files Browse the repository at this point in the history
…into AccountScreen
  • Loading branch information
Vishwa-Raghavendra committed Apr 21, 2022
2 parents c67cb8c + 26a4d98 commit d7bb64e
Show file tree
Hide file tree
Showing 42 changed files with 324 additions and 136 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Our plan is:
1. Create [Ivy Telegram Community](https://t.me/+ETavgioAvWg4NThk). :heavy_check_mark:
1. Create a crypto donations mechanism (BTC, ETH, ADA, SOL...)
1. Use the donations to setup a dev fund where contributors can earn money by helping the project.
1. Create a proposal and voting system based using Cardano (ADA) smart contracts.
1. Create a proposal and voting system using Cardano (ADA) smart contracts.
1. So far, so good! Let us know what do you think should be next?

Correct us, if we're wrong! Share your opinion. Be the change. :star:
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/ivy/wallet/domain/action/Action.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ infix fun <A, B, C> Action<B, C>.after(act1: Action<A, B>): Action<A, C> = objec
}
}

infix fun <A, B, C> Action<A, B>.then(act2: Action<B, C>): Action<A, C> = object : Action<A, C>() {
override suspend fun A.willDo(): C {
val b = this@then(this)
return act2(b)
}
}

///**
// * Action composition example
// */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ivy.wallet.domain.action
package com.ivy.wallet.domain.action.settings

import com.ivy.wallet.domain.action.Action
import com.ivy.wallet.domain.fp.wallet.baseCurrencyCode
import com.ivy.wallet.io.persistence.dao.SettingsDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ivy.wallet.domain.action
package com.ivy.wallet.domain.action.wallet

import com.ivy.wallet.domain.action.Action
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.data.IncomeExpensePair
import com.ivy.wallet.domain.logic.WalletLogic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ivy.wallet.domain.action
package com.ivy.wallet.domain.action.wallet

import com.ivy.wallet.domain.action.Action
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.data.IncomeExpensePair
import com.ivy.wallet.domain.logic.WalletLogic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ivy.wallet.domain.action
package com.ivy.wallet.domain.action.wallet

import com.ivy.wallet.domain.action.Action
import com.ivy.wallet.domain.fp.data.WalletDAOs
import com.ivy.wallet.domain.fp.wallet.calculateWalletBalance
import java.math.BigDecimal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ivy.wallet.domain.action
package com.ivy.wallet.domain.action.wallet

import com.ivy.wallet.domain.action.Action
import com.ivy.wallet.domain.data.TransactionHistoryItem
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.WalletDAOs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
Expand Down Expand Up @@ -85,7 +86,7 @@ private fun BoxWithConstraintsScope.UI(
Spacer(Modifier.width(24.dp))

Text(
text = "Categories",
text = stringResource(R.string.categories),
style = UI.typo.h2.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.ExtraBold
Expand Down Expand Up @@ -230,7 +231,7 @@ fun AddedSpent(

LabelAmount(
textColor = textColor,
label = "EXPENSES THIS MONTH",
label = stringResource(R.string.month_expenses),
amount = monthlyExpenses,
currency = currency,
center = center
Expand Down Expand Up @@ -262,7 +263,7 @@ fun AddedSpent(

LabelAmount(
textColor = textColor,
label = "INCOME THIS MONTH",
label = stringResource(R.string.month_income),
amount = monthlyIncome,
currency = currency,
center = center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -23,6 +24,7 @@ import com.ivy.design.l0_system.style
import com.ivy.wallet.domain.logic.csv.model.ImportType
import com.ivy.wallet.ui.IvyWalletPreview
import com.ivy.wallet.ui.onboarding.components.OnboardingToolbar
import com.ivy.wallet.R


import com.ivy.wallet.ui.theme.components.GradientCutBottom
Expand Down Expand Up @@ -59,7 +61,7 @@ fun BoxWithConstraintsScope.ImportFrom(

Text(
modifier = Modifier.padding(start = 32.dp),
text = "Import from",
text = stringResource(R.string.import_from),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -15,6 +16,7 @@ import com.ivy.design.l0_system.style
import com.ivy.wallet.ui.IvyWalletPreview
import com.ivy.wallet.ui.theme.GradientGreen
import com.ivy.wallet.ui.theme.Gray
import com.ivy.wallet.R


import com.ivy.wallet.ui.theme.components.IvyDividerLine
Expand All @@ -32,7 +34,7 @@ fun ImportProcessing(
Spacer(Modifier.height(80.dp))

Text(
text = "Please wait",
text = stringResource(R.string.please_wait),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black
)
Expand All @@ -57,7 +59,7 @@ fun ImportProcessing(
Spacer(modifier = Modifier.weight(1f))

Text(
text = "Importing the CSV file",
text = stringResource(R.string.importing_the_csv_file),
style = UI.typo.b2.style(
fontWeight = FontWeight.Bold
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.*
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -18,6 +19,7 @@ import com.ivy.wallet.ui.theme.components.BackButton
import com.ivy.wallet.ui.theme.components.IvyDividerLine
import com.ivy.wallet.ui.theme.components.OnboardingButton
import com.ivy.wallet.utils.format
import com.ivy.wallet.R

@Composable
fun ImportResultUI(
Expand Down Expand Up @@ -45,7 +47,7 @@ fun ImportResultUI(
result.transactionsImported > result.rowsFound / 2
Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = if (importSuccess) "Success" else "Failure",
text = if (importSuccess) stringResource(R.string.success) else stringResource(R.string.failure),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black,
color = if (importSuccess) UI.colors.pureInverse else Red
Expand All @@ -56,7 +58,7 @@ fun ImportResultUI(

Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = "Imported",
text = stringResource(R.string.imported),
style = UI.typo.b1.style(
color = Green,
fontWeight = FontWeight.Black
Expand All @@ -77,7 +79,7 @@ fun ImportResultUI(

Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = "${result.transactionsImported} transactions",
text = stringResource(R.string.transactions_imported, result.transactionsImported),
style = UI.typo.nB2.style(
fontWeight = FontWeight.Bold,
color = Gray
Expand All @@ -88,7 +90,7 @@ fun ImportResultUI(

Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = "${result.accountsImported} accounts",
text = stringResource(R.string.accounts_imported, result.accountsImported),
style = UI.typo.nB2.style(
fontWeight = FontWeight.Bold,
color = Gray
Expand All @@ -99,7 +101,7 @@ fun ImportResultUI(

Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = "${result.categoriesImported} categories",
text = stringResource(R.string.categories_imported, result.categoriesImported),
style = UI.typo.nB2.style(
fontWeight = FontWeight.Bold,
color = Gray
Expand All @@ -118,7 +120,7 @@ fun ImportResultUI(

Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = "Failed",
text = stringResource(R.string.failed),
style = UI.typo.b1.style(
fontWeight = FontWeight.Black,
color = Red
Expand All @@ -137,7 +139,7 @@ fun ImportResultUI(

Text(
modifier = Modifier.padding(horizontal = 32.dp),
text = "${result.rowsFound - result.transactionsImported} rows from CSV file not recognized",
text = stringResource(R.string.rows_from_csv_not_recognized, result.rowsFound - result.transactionsImported),
style = UI.typo.nB2.style(
fontWeight = FontWeight.Bold,
color = Gray
Expand All @@ -152,7 +154,7 @@ fun ImportResultUI(
Modifier
.fillMaxWidth()
.padding(horizontal = 24.dp),
text = "Finish",
text = stringResource(R.string.finish),
textColor = White,
backgroundGradient = GradientIvy,
hasNext = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.ivy.wallet.R

@Composable
fun DefaultImportSteps(
Expand All @@ -17,7 +19,7 @@ fun DefaultImportSteps(

StepTitle(
number = 1,
title = "Export CSV file"
title = stringResource(R.string.export_csv_file)
)

Spacer(Modifier.height(12.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.ivy.wallet.R

@Composable
fun FinancistoSteps(
Expand All @@ -14,8 +16,8 @@ fun FinancistoSteps(

StepTitle(
number = 1,
title = "Export CSV file with standard options",
description = "Please use the standard options and make sure to include headers."
title = stringResource(R.string.export_csv_file_standard),
description = stringResource(R.string.export_csv_file_standard_description)
)

Spacer(Modifier.height(24.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.font.FontWeight.Companion.Bold
import androidx.compose.ui.text.style.TextAlign
Expand All @@ -26,6 +27,7 @@ import com.ivy.design.l0_system.UI
import com.ivy.design.l0_system.style
import com.ivy.wallet.R
import com.ivy.wallet.domain.logic.csv.model.ImportType
import com.ivy.wallet.stringRes
import com.ivy.wallet.ui.IvyWalletPreview
import com.ivy.wallet.ui.RootActivity
import com.ivy.wallet.ui.onboarding.components.OnboardingToolbar
Expand Down Expand Up @@ -68,7 +70,7 @@ fun BoxWithConstraintsScope.ImportInstructions(

Text(
modifier = Modifier.padding(start = 32.dp),
text = "How to import",
text = stringResource(R.string.how_to_import),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black
)
Expand All @@ -78,7 +80,7 @@ fun BoxWithConstraintsScope.ImportInstructions(

Text(
modifier = Modifier.padding(start = 32.dp),
text = "open",
text = stringResource(R.string.open),
style = UI.typo.b2.style(
color = Gray,
fontWeight = Bold
Expand All @@ -103,7 +105,7 @@ fun BoxWithConstraintsScope.ImportInstructions(

Text(
modifier = Modifier.padding(start = 32.dp),
text = "Steps",
text = stringResource(R.string.steps),
style = UI.typo.b1.style(
fontWeight = FontWeight.Black
)
Expand Down Expand Up @@ -169,8 +171,8 @@ fun VideoButton(
InstructionButton(
modifier = modifier,
icon = R.drawable.ic_import_video,
caption = "How to",
text = "Video"
caption = stringResource(R.string.how_to),
text = stringResource(R.string.video)
) {
onClick()
}
Expand All @@ -184,8 +186,8 @@ fun ArticleButton(
InstructionButton(
modifier = modifier,
icon = R.drawable.ic_import_web,
caption = "How to",
text = "Article"
caption = stringResource(R.string.how_to),
text = stringResource(R.string.article)
) {
onClick()
}
Expand Down Expand Up @@ -246,7 +248,7 @@ fun InstructionButton(
@Composable
fun UploadFileStep(
stepNumber: Int,
text: String = "Upload CSV file",
text: String = stringResource(R.string.upload_csv_file),
onUploadClick: () -> Unit
) {
StepTitle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.ivy.wallet.R

@Composable
fun IvyWalletSteps(
Expand All @@ -14,7 +16,7 @@ fun IvyWalletSteps(

StepTitle(
number = 1,
title = "Export Data"
title = stringResource(R.string.export_data)
)

Spacer(Modifier.height(12.dp))
Expand All @@ -28,7 +30,7 @@ fun IvyWalletSteps(

UploadFileStep(
stepNumber = 2,
text = "Upload CSV/ZIP file",
text = stringResource(R.string.upload_csv_zip_file),
onUploadClick = onUploadClick
)
}
Loading

0 comments on commit d7bb64e

Please sign in to comment.