MainActivity.kt (2787B)
1 // This file is part of taler-cashless2ecash. 2 // Copyright (C) 2024 Joel Häberli 3 // 4 // taler-cashless2ecash is free software: you can redistribute it and/or modify it 5 // under the terms of the GNU Affero General Public License as published 6 // by the Free Software Foundation, either version 3 of the License, 7 // or (at your option) any later version. 8 // 9 // taler-cashless2ecash is distributed in the hope that it will be useful, but 10 // WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 // Affero General Public License for more details. 13 // 14 // You should have received a copy of the GNU Affero General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 16 // 17 // SPDX-License-Identifier: AGPL3.0-or-later 18 19 package ch.bfh.habej2.wallee_c2ec 20 21 import android.content.Intent 22 import android.os.Bundle 23 import androidx.activity.ComponentActivity 24 import androidx.activity.compose.setContent 25 import androidx.compose.foundation.layout.Column 26 import androidx.compose.foundation.layout.fillMaxSize 27 import androidx.compose.material3.MaterialTheme 28 import androidx.compose.material3.Surface 29 import androidx.compose.ui.Alignment 30 import androidx.compose.ui.Modifier 31 import androidx.compose.ui.platform.LocalContext 32 import ch.bfh.habej2.wallee_c2ec.ui.theme.Walleec2ecTheme 33 import ch.bfh.habej2.wallee_c2ec.withdrawal.ManageActivity 34 import ch.bfh.habej2.wallee_c2ec.withdrawal.TalerButton 35 import ch.bfh.habej2.wallee_c2ec.withdrawal.TalerLogo 36 import ch.bfh.habej2.wallee_c2ec.withdrawal.WithdrawalActivity 37 38 class MainActivity : ComponentActivity() { 39 40 override fun onCreate(savedInstanceState: Bundle?) { 41 super.onCreate(savedInstanceState) 42 setContent { 43 Walleec2ecTheme { 44 // A surface container using the 'background' color from the theme 45 Surface( 46 modifier = Modifier.fillMaxSize(), 47 color = MaterialTheme.colorScheme.background 48 ) { 49 val ctx = LocalContext.current 50 Column( 51 horizontalAlignment = Alignment.CenterHorizontally 52 ) { 53 54 TalerLogo() 55 56 TalerButton( 57 text = "Withdraw", 58 onClick = { ctx.startActivity(Intent(this@MainActivity, WithdrawalActivity::class.java)) } 59 ) 60 61 TalerButton( 62 text = "Settings", 63 onClick = { ctx.startActivity(Intent(this@MainActivity, ManageActivity::class.java)) } 64 ) 65 66 } 67 } 68 } 69 } 70 } 71 }