diff --git a/app/src/main/java/eu/m724/coincounter/home/HomeActivity.kt b/app/src/main/java/eu/m724/coincounter/home/HomeActivity.kt index 67905ba..d0f0668 100644 --- a/app/src/main/java/eu/m724/coincounter/home/HomeActivity.kt +++ b/app/src/main/java/eu/m724/coincounter/home/HomeActivity.kt @@ -6,24 +6,13 @@ import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.activity.viewModels -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import androidx.lifecycle.lifecycleScope import dagger.hilt.android.AndroidEntryPoint -import eu.m724.coincounter.CurrencyUtils import eu.m724.coincounter.home.compose.HomeActivityView import eu.m724.coincounter.ui.theme.CoinCounterTheme import eu.m724.coincounter.wallet.WalletActivity @@ -67,28 +56,4 @@ class HomeActivity : ComponentActivity() { intent.putExtra("walletId", walletId) startActivity(intent) } -} - -@Composable -fun BalanceView(balance: Int) { - Column( - modifier = Modifier - .height(150.dp) - .fillMaxWidth(), - verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.CenterHorizontally - ) { - Row( - verticalAlignment = Alignment.Bottom - ) { - Text( - text = CurrencyUtils.formatNoCurrency(balance), - fontSize = 32.sp - ) - Text( - text = CurrencyUtils.currencySymbol, - fontSize = 14.sp - ) - } - } } \ No newline at end of file diff --git a/app/src/main/java/eu/m724/coincounter/home/compose/BalanceView.kt b/app/src/main/java/eu/m724/coincounter/home/compose/BalanceView.kt new file mode 100644 index 0000000..193db18 --- /dev/null +++ b/app/src/main/java/eu/m724/coincounter/home/compose/BalanceView.kt @@ -0,0 +1,38 @@ +package eu.m724.coincounter.home.compose + +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.height +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import eu.m724.coincounter.CurrencyUtils + +@Composable +fun BalanceView(balance: Int) { + Column( + modifier = Modifier + .height(150.dp) + .fillMaxWidth(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + Row( + verticalAlignment = Alignment.Bottom + ) { + Text( + text = CurrencyUtils.formatNoCurrency(balance), + fontSize = 32.sp + ) + Text( + text = CurrencyUtils.currencySymbol, + fontSize = 14.sp + ) + } + } +} \ No newline at end of file