forked from openMF/mifos-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor #2469: migrated recent transaction to compose
- Loading branch information
1 parent
0bee126
commit 9ec2731
Showing
8 changed files
with
252 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
287 changes: 0 additions & 287 deletions
287
app/src/main/java/org/mifos/mobile/ui/fragments/RecentTransactionsFragment.kt
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
app/src/main/java/org/mifos/mobile/ui/recent_transaction/RecentTransactionItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.mifos.mobile.ui.recent_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.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import org.mifos.mobile.R | ||
|
||
/** | ||
* @author pratyush | ||
* @since 03/01/2024 | ||
*/ | ||
|
||
@Composable | ||
fun RecentTransactionItem(amount: String, date: String, value: String) { | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(8.dp) | ||
) { | ||
Image( | ||
modifier = Modifier.size(39.dp), | ||
painter = painterResource(id = R.drawable.ic_local_atm_black_24dp), | ||
contentDescription = null | ||
) | ||
|
||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(start = 8.dp) | ||
) { | ||
Text(text = value, color = Color.White) | ||
Row( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.SpaceBetween | ||
) { | ||
Text(text = amount, color = Color.White) | ||
Text(text = date, color = Color.White) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun RecentTransactionItemPreview() { | ||
RecentTransactionItem(amount = "amount", date = "date", value = "value") | ||
} |
Oops, something went wrong.