|
| 1 | +package com.callstack.brownfield.android.example |
| 2 | + |
| 3 | +import android.os.Bundle |
| 4 | +import androidx.activity.ComponentActivity |
| 5 | +import androidx.activity.compose.setContent |
| 6 | +import androidx.activity.enableEdgeToEdge |
| 7 | +import androidx.compose.foundation.layout.Arrangement |
| 8 | +import androidx.compose.foundation.layout.Column |
| 9 | +import androidx.compose.foundation.layout.fillMaxSize |
| 10 | +import androidx.compose.foundation.layout.padding |
| 11 | +import androidx.compose.material3.Button |
| 12 | +import androidx.compose.material3.MaterialTheme |
| 13 | +import androidx.compose.material3.Scaffold |
| 14 | +import androidx.compose.material3.Text |
| 15 | +import androidx.compose.ui.Alignment |
| 16 | +import androidx.compose.ui.Modifier |
| 17 | +import androidx.compose.ui.text.style.TextAlign |
| 18 | +import androidx.compose.ui.unit.dp |
| 19 | +import com.callstack.brownfield.android.example.ui.theme.AndroidBrownfieldAppTheme |
| 20 | + |
| 21 | +class ReferralsActivity : ComponentActivity() { |
| 22 | + override fun onCreate(savedInstanceState: Bundle?) { |
| 23 | + super.onCreate(savedInstanceState) |
| 24 | + enableEdgeToEdge() |
| 25 | + |
| 26 | + val userId = intent.getStringExtra(EXTRA_USER_ID).orEmpty() |
| 27 | + |
| 28 | + setContent { |
| 29 | + AndroidBrownfieldAppTheme { |
| 30 | + Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> |
| 31 | + Column( |
| 32 | + modifier = Modifier |
| 33 | + .fillMaxSize() |
| 34 | + .padding(innerPadding) |
| 35 | + .padding(24.dp), |
| 36 | + verticalArrangement = Arrangement.spacedBy(16.dp), |
| 37 | + horizontalAlignment = Alignment.CenterHorizontally |
| 38 | + ) { |
| 39 | + Text( |
| 40 | + text = "Referrals", |
| 41 | + style = MaterialTheme.typography.headlineMedium |
| 42 | + ) |
| 43 | + Text( |
| 44 | + text = "Opened from BrownfieldNavigation.navigateToReferrals(userId).", |
| 45 | + textAlign = TextAlign.Center |
| 46 | + ) |
| 47 | + Text( |
| 48 | + text = "userId: $userId", |
| 49 | + style = MaterialTheme.typography.bodyLarge |
| 50 | + ) |
| 51 | + Button(onClick = { finish() }) { |
| 52 | + Text("Go back") |
| 53 | + } |
| 54 | + } |
| 55 | + } |
| 56 | + } |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + companion object { |
| 61 | + const val EXTRA_USER_ID = "extra_user_id" |
| 62 | + } |
| 63 | +} |
0 commit comments