@@ -12,16 +12,23 @@ import android.util.Log
1212import androidx.activity.ComponentActivity
1313import androidx.activity.compose.setContent
1414import androidx.activity.result.contract.ActivityResultContracts
15+ import androidx.compose.foundation.Image
1516import androidx.compose.foundation.layout.*
17+ import androidx.compose.foundation.rememberScrollState
1618import androidx.compose.foundation.shape.CircleShape
19+ import androidx.compose.foundation.shape.RoundedCornerShape
20+ import androidx.compose.foundation.verticalScroll
1721import androidx.compose.material.icons.Icons
18- import androidx.compose.material.icons.filled.Bluetooth
22+ import androidx.compose.material.icons.filled.CheckCircle
1923import androidx.compose.material.icons.filled.Refresh
2024import androidx.compose.material3.*
2125import androidx.compose.runtime.*
2226import androidx.compose.ui.Alignment
2327import androidx.compose.ui.Modifier
2428import androidx.compose.ui.graphics.Color
29+ import androidx.compose.ui.res.painterResource
30+ import androidx.compose.ui.semantics.heading
31+ import androidx.compose.ui.semantics.semantics
2532import androidx.compose.ui.text.style.TextAlign
2633import androidx.compose.ui.unit.dp
2734import androidx.core.content.ContextCompat
@@ -150,56 +157,82 @@ fun LoadingScreen(status: String) {
150157 }
151158}
152159
160+ // Darker green than Material's default for WCAG-AA contrast on the light card.
161+ private val StatusGreen = Color (0xFF2E7D32 )
162+
153163@Composable
154164fun MainScreen (manager : GlassesManager ) {
155165 Column (
156166 modifier = Modifier
157167 .fillMaxSize()
168+ .verticalScroll(rememberScrollState()) // survives large font scale / landscape
158169 .padding(32 .dp),
159170 horizontalAlignment = Alignment .CenterHorizontally ,
160- verticalArrangement = Arrangement .spacedBy(24 .dp)
171+ verticalArrangement = Arrangement .spacedBy(20 .dp)
161172 ) {
162- Column (horizontalAlignment = Alignment .CenterHorizontally ) {
163- Icon (
164- imageVector = Icons .Default .Bluetooth ,
165- contentDescription = null ,
166- tint = MaterialTheme .colorScheme.primary,
167- modifier = Modifier .size(48 .dp)
168- )
169- Text (
170- text = " MetaHelper" ,
171- style = MaterialTheme .typography.displaySmall,
172- color = MaterialTheme .colorScheme.onBackground
173- )
174- Text (
175- text = " Smart Glasses Companion" ,
176- style = MaterialTheme .typography.bodyLarge,
177- color = MaterialTheme .colorScheme.secondary
173+ Spacer (modifier = Modifier .height(24 .dp))
174+
175+ // The app-icon mark on its dark tile, so the light code glyph stays
176+ // legible on the light background.
177+ Surface (
178+ shape = RoundedCornerShape (22 .dp),
179+ color = Color (0xFF0B0F1A ),
180+ modifier = Modifier .size(88 .dp)
181+ ) {
182+ Image (
183+ painter = painterResource(R .drawable.ic_launcher_foreground),
184+ contentDescription = " MetaHelper logo" ,
185+ modifier = Modifier .fillMaxSize()
178186 )
179187 }
180188
181- Spacer (modifier = Modifier .weight(1f ))
189+ Text (
190+ text = " MetaHelper" ,
191+ style = MaterialTheme .typography.displaySmall,
192+ color = MaterialTheme .colorScheme.onBackground,
193+ modifier = Modifier .semantics { heading() }
194+ )
195+ Text (
196+ text = " Reads code aloud through your glasses." ,
197+ style = MaterialTheme .typography.bodyLarge,
198+ color = MaterialTheme .colorScheme.onSurfaceVariant,
199+ textAlign = TextAlign .Center
200+ )
201+
202+ Spacer (modifier = Modifier .height(8 .dp))
182203
183204 Card (
184205 modifier = Modifier .fillMaxWidth(),
185206 colors = CardDefaults .cardColors(
186- containerColor = MaterialTheme .colorScheme.surfaceVariant.copy(alpha = 0.5f )
207+ containerColor = MaterialTheme .colorScheme.surfaceVariant
187208 )
188209 ) {
189210 Column (
190211 modifier = Modifier .padding(20 .dp),
191- horizontalAlignment = Alignment .CenterHorizontally
212+ horizontalAlignment = Alignment .CenterHorizontally ,
213+ verticalArrangement = Arrangement .spacedBy(10 .dp)
192214 ) {
215+ Row (verticalAlignment = Alignment .CenterVertically ) {
216+ Icon (
217+ imageVector = Icons .Default .CheckCircle ,
218+ contentDescription = null , // label conveyed by the adjacent text
219+ tint = StatusGreen ,
220+ modifier = Modifier .size(18 .dp)
221+ )
222+ Spacer (modifier = Modifier .width(6 .dp))
223+ Text (
224+ text = " GALLERY WATCHER ACTIVE" ,
225+ style = MaterialTheme .typography.labelLarge,
226+ color = StatusGreen
227+ )
228+ }
193229 Text (
194- text = " GALLERY WATCHER ACTIVE" ,
195- style = MaterialTheme .typography.labelLarge,
196- color = Color (0xFF4CAF50 )
197- )
198- Spacer (modifier = Modifier .height(8 .dp))
199- Text (
200- text = " 1. Take a photo with your glasses.\n 2. Meta AI will save it to 'Downloads/Meta AI'.\n 3. MetaHelper will detect it and play the answer!" ,
230+ text = " 1. Take a photo with your glasses.\n " +
231+ " 2. Meta AI saves it to 'Download/Meta AI'.\n " +
232+ " 3. MetaHelper detects it and plays the answer." ,
201233 textAlign = TextAlign .Center ,
202- style = MaterialTheme .typography.bodyMedium
234+ style = MaterialTheme .typography.bodyMedium,
235+ color = MaterialTheme .colorScheme.onSurfaceVariant
203236 )
204237 }
205238 }
@@ -218,8 +251,9 @@ fun MainScreen(manager: GlassesManager) {
218251
219252 Text (
220253 text = " Cloud: Connected to Render" ,
221- style = MaterialTheme .typography.labelSmall,
222- color = MaterialTheme .colorScheme.outline
254+ style = MaterialTheme .typography.labelMedium,
255+ color = MaterialTheme .colorScheme.onSurfaceVariant,
256+ textAlign = TextAlign .Center
223257 )
224258 }
225259}
0 commit comments