summaryrefslogtreecommitdiff
path: root/wallee-c2ec/app/src/main/java/ch/bfh/habej2/wallee_c2ec/MainActivity.kt
blob: 413a579b2d70a7c52a2a737fef5aab563ad7f915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package ch.bfh.habej2.wallee_c2ec

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import ch.bfh.habej2.wallee_c2ec.config.loadConfiguredExchanges
import ch.bfh.habej2.wallee_c2ec.ui.theme.Walleec2ecTheme

class MainActivity : ComponentActivity() {

    init {

        // TODO this crashes somehow
        //loadConfiguredExchanges()

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            Walleec2ecTheme {
                // A surface container using the 'background' color from the theme
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colorScheme.background
                ) {
                    val ctx = LocalContext.current
                    Column(
                        horizontalAlignment = Alignment.CenterHorizontally
                    ) {
                        Text(text = "Withdraw Taler using Wallee")
                        Button(onClick = { ctx.startActivity(Intent(this@MainActivity, WithdrawalCreationActivity::class.java)) }) {
                            Text(text = "Start Withdrawal")
                        }
                        Button(onClick = { ctx.startActivity(Intent(this@MainActivity, ExchangeActivity::class.java)) }) {
                            Text(text = "Choose Exchange")
                        }
                    }
                }
            }
        }
    }
}