this one too

This commit is contained in:
Minecon724 2024-10-02 17:48:17 +02:00
parent dad71108d8
commit 0ee9ece012
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
2 changed files with 38 additions and 35 deletions

View file

@ -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
)
}
}
}

View file

@ -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
)
}
}
}