Skip to content

Commit

Permalink
Update MainActivity with MainScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
sirambd committed Jul 24, 2024
1 parent d53a712 commit c5377f6
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions app/src/main/java/com/infomaniak/swisstransfer/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
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 com.infomaniak.swisstransfer.ui.screen.main.MainScreen
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

class MainActivity : ComponentActivity() {
Expand All @@ -41,31 +35,16 @@ class MainActivity : ComponentActivity() {
enableEdgeToEdge()
setContent {
SwissTransferTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Greeting(
name = "Android",
modifier = Modifier.padding(innerPadding)
)
}
MainScreen()
}
}
}
}

@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(
text = "Hello $name!",
modifier = modifier
)
}

@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL)
@Composable
fun GreetingPreview() {
SwissTransferTheme {
Surface(color = MaterialTheme.colorScheme.background, modifier = Modifier.fillMaxSize()) {
Greeting("Android")
}
MainScreen()
}
}

0 comments on commit c5377f6

Please sign in to comment.