this one too
This commit is contained in:
parent
dad71108d8
commit
0ee9ece012
2 changed files with 38 additions and 35 deletions
|
@ -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
|
||||
|
@ -68,27 +57,3 @@ class HomeActivity : ComponentActivity() {
|
|||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue