Skip to content

Commit

Permalink
A
Browse files Browse the repository at this point in the history
migrate transfer process screen to compose screen openMF#2583 (openMF#2585)

refactor: qr code display migration (openMF#2609)

Migrate Beneficiary List from XML to compose (openMF#2607)

"Added MIfos Logo to RegistrationScreen" (openMF#2613)

* Added Image to RegistrationScreen

* "Added Image to RegistrationScreen"

Bug: Resolved Swipe Refresh Not Working in RecentTransaction Screen Compose (openMF#2617)

* "Resolved Swipe Refresh Not Working"

* Resolved Swipe Refresh Not Working

* Centered the Swipe Refresh And Added Padding

migrate saving accounts transaction screen to compose openMF#2588 (openMF#2596)

* migrate saving accounts transaction screen to compose openMF#2588

* Update SavingAccountsTransactionTopBar.kt

* init

* init

* refactor: savings accounts screen migration

* refactor: savings accounts screen migration

---------

Co-authored-by: Avneet Singh <avneetmaankiya@gmail.com>

fix#2615 Missing TopAppBar navigation back implementation in AddBeneficiaryScreen (openMF#2616)

fix#2610: Scrolling Disabled in TransferProcessFragment (openMF#2611)

fix#2610: Scrolling Disabled in TransferProcessFragment

fix#2610: Scrolling Disabled in TransferProcessFragment

Beneficiary application (openMF#2618)

Settings screen migration (openMF#2619)

refactor: Registration Module
  • Loading branch information
Saifuddin53 authored and akashmeruva9 committed Jul 3, 2024
1 parent 0dbbea9 commit 3737e46
Show file tree
Hide file tree
Showing 7 changed files with 856 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<<< HEAD:app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsTransactionFragment.kt
package org.mifos.mobile.ui.savings_account
========
package org.mifos.mobile.ui.savings_account_transaction
>>>>>>>> cbc8d5af (A):app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFragment.kt

import android.content.Intent
import android.net.Uri
Expand Down Expand Up @@ -42,7 +46,10 @@ import org.mifos.mobile.core.common.utils.ParcelableAndSerializableUtils.getChec
import org.mifos.mobile.utils.StatusUtils
import org.mifos.mobile.utils.Toaster
import org.mifos.mobile.core.common.utils.getDatePickerDialog
<<<<<<<< HEAD:app/src/main/java/org/mifos/mobile/ui/savings_account/SavingAccountsTransactionFragment.kt
import org.mifos.mobile.feature.savings.savings_account_transaction.SavingAccountsTransactionViewModel
========
>>>>>>>> cbc8d5af (A):app/src/main/java/org/mifos/mobile/ui/savings_account_transaction/SavingAccountsTransactionFragment.kt
import java.time.Instant
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
package org.mifos.mobile.ui.savings_account_transaction

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.mifos.mobile.R
import org.mifos.mobile.core.model.entity.accounts.savings.Transactions
import org.mifos.mobile.core.ui.theme.MifosMobileTheme
import org.mifos.mobile.core.common.utils.CurrencyUtil
import org.mifos.mobile.core.common.utils.DateHelper

@Composable
fun SavingsAccountTransactionContent(
transactionList: List<Transactions>,
) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.SpaceBetween
) {
LazyColumn {
items(items = transactionList) {
SavingsAccountTransactionListItem(it)
HorizontalDivider(
thickness = 1.dp,
color = Color.Gray,
modifier = Modifier.padding(vertical = 4.dp)
)
}
}
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 8.dp, horizontal = 10.dp),
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalAlignment = Alignment.Bottom
) {
Text(
text = stringResource(id = R.string.need_help),
color = MaterialTheme.colorScheme.onSurface
)
Spacer(modifier = Modifier.width(2.dp))
Text(
text = stringResource(id = R.string.help_line_number),
color = MaterialTheme.colorScheme.primary
)
}
}
}


@Composable
fun SavingsAccountTransactionListItem(transaction: Transactions) {
val context = LocalContext.current

Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 6.dp)
) {
Image(
painter = painterResource(
id = getTransactionTriangleResId(transaction.transactionType)
),
contentDescription = stringResource(id = R.string.savings_account_transaction),
modifier = Modifier
.size(56.dp)
.padding(4.dp)
)
Column(
modifier = Modifier.padding(4.dp)
) {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
) {
Text(
text = DateHelper.getDateAsString(transaction.date),
style = MaterialTheme.typography.labelLarge,
color = MaterialTheme.colorScheme.onSurface
)
Text(
text = stringResource(
id = R.string.string_and_string,
transaction.currency?.displaySymbol ?: transaction.currency?.code ?: "",
CurrencyUtil.formatCurrency(context, transaction.amount,)
),
style = MaterialTheme.typography.labelLarge,
color = MaterialTheme.colorScheme.onSurface
)
}
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = transaction.transactionType?.value ?: "",
style = MaterialTheme.typography.labelMedium,
modifier = Modifier.alpha(0.7f),
color = MaterialTheme.colorScheme.onSurface
)
Text(
text = stringResource(
id = R.string.string_and_string,
transaction.currency?.displaySymbol ?: transaction.currency?.code ?: "",
CurrencyUtil.formatCurrency(context, transaction.runningBalance)
),
style = MaterialTheme.typography.labelMedium,
modifier = Modifier.alpha(0.7f),
color = MaterialTheme.colorScheme.onSurface
)
}
Row(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = transaction.paymentDetailData?.paymentType?.name.toString(),
style = MaterialTheme.typography.labelMedium,
modifier = Modifier.alpha(0.7f),
color = MaterialTheme.colorScheme.onSurface
)
}
}
}
}

@Preview
@Composable
fun SavingsAccountTransactionContentPreview() {
MifosMobileTheme {
SavingsAccountTransactionContent(transactionList = listOf())
}
}
Loading

0 comments on commit 3737e46

Please sign in to comment.