Create login module

This commit is contained in:
Benoit Marty
2022-10-07 17:31:27 +02:00
parent 94d031ffce
commit a18d272462
13 changed files with 224 additions and 37 deletions

View File

@@ -1,43 +1,16 @@
package io.element.android.x
import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import io.element.android.x.ui.theme.ElementXTheme
import io.element.android.x.ui.screen.login.LoginActivity
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
ElementXTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
Greeting("Android")
}
}
}
// Just start the LoginActivity for now.
// TODO if a session exist, start the room list
startActivity(Intent(this, LoginActivity::class.java))
finish()
}
}
@Composable
fun Greeting(name: String) {
Text(text = "Hello $name!")
}
@Preview(showBackground = true)
@Composable
fun DefaultPreview() {
ElementXTheme {
Greeting("Android")
}
}