diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f0ad989..64a7f0b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -14,7 +14,7 @@ android { compileSdk { version = release(36) { minorApiLevel = 1 } } defaultConfig { - applicationId = "com.aistudio.cargillparadaos.xvyzwt" + applicationId = "com.aistudio.paradaos.xvyzwt" minSdk = 24 targetSdk = 36 versionCode = 1 diff --git a/app/google-services.json b/app/google-services.json index ffa2b96..3dd2070 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -9,7 +9,7 @@ "client_info": { "mobilesdk_app_id": "1:461441632355:android:8ea9121be8cf81b4ee5056", "android_client_info": { - "package_name": "com.aistudio.cargillparadaos.xvyzwt" + "package_name": "com.aistudio.paradaos.xvyzwt" } }, "oauth_client": [ @@ -17,7 +17,7 @@ "client_id": "461441632355-rg9go0tcsr8ora2la83aat9pcekqo13p.apps.googleusercontent.com", "client_type": 1, "android_info": { - "package_name": "com.aistudio.cargillparadaos.xvyzwt", + "package_name": "com.aistudio.paradaos.xvyzwt", "certificate_hash": "6274d8aa0709c0454af47340ae8f223b8a0fbd61" } }, diff --git a/app/src/main/java/com/example/MainActivity.kt b/app/src/main/java/com/example/MainActivity.kt index 4a13cfe..fef23a1 100644 --- a/app/src/main/java/com/example/MainActivity.kt +++ b/app/src/main/java/com/example/MainActivity.kt @@ -27,8 +27,8 @@ import com.example.data.repository.MaintenanceRepository import com.example.ui.screens.AnalyticsScreen import com.example.ui.screens.MaintenanceDashboardScreen import com.example.ui.screens.SettingsScreen -import com.example.ui.theme.CargillGreen -import com.example.ui.theme.CargillLightGreen +import com.example.ui.theme.BrandGreen +import com.example.ui.theme.BrandLightGreen import com.example.ui.theme.MyApplicationTheme import com.example.ui.viewmodel.MaintenanceViewModel import com.example.ui.viewmodel.MaintenanceViewModelFactory @@ -72,11 +72,11 @@ class MainActivity : ComponentActivity() { icon = { Icon(Icons.Default.Dashboard, contentDescription = "Dashboard") }, label = { Text("Dashboard", fontSize = 11.sp) }, colors = NavigationBarItemDefaults.colors( - selectedIconColor = CargillGreen, - selectedTextColor = CargillGreen, + selectedIconColor = BrandGreen, + selectedTextColor = BrandGreen, unselectedIconColor = Color.Gray, unselectedTextColor = Color.Gray, - indicatorColor = CargillLightGreen + indicatorColor = BrandLightGreen ) ) @@ -95,11 +95,11 @@ class MainActivity : ComponentActivity() { icon = { Icon(Icons.Default.Assignment, contentDescription = "Ordens") }, label = { Text("Ordens", fontSize = 11.sp) }, colors = NavigationBarItemDefaults.colors( - selectedIconColor = CargillGreen, - selectedTextColor = CargillGreen, + selectedIconColor = BrandGreen, + selectedTextColor = BrandGreen, unselectedIconColor = Color.Gray, unselectedTextColor = Color.Gray, - indicatorColor = CargillLightGreen + indicatorColor = BrandLightGreen ) ) @@ -118,11 +118,11 @@ class MainActivity : ComponentActivity() { icon = { Icon(Icons.Default.Settings, contentDescription = "Configurações") }, label = { Text("Configurações", fontSize = 11.sp) }, colors = NavigationBarItemDefaults.colors( - selectedIconColor = CargillGreen, - selectedTextColor = CargillGreen, + selectedIconColor = BrandGreen, + selectedTextColor = BrandGreen, unselectedIconColor = Color.Gray, unselectedTextColor = Color.Gray, - indicatorColor = CargillLightGreen + indicatorColor = BrandLightGreen ) ) } diff --git a/app/src/main/java/com/example/data/local/AppDatabase.kt b/app/src/main/java/com/example/data/local/AppDatabase.kt index 07097be..b640836 100644 --- a/app/src/main/java/com/example/data/local/AppDatabase.kt +++ b/app/src/main/java/com/example/data/local/AppDatabase.kt @@ -26,7 +26,7 @@ abstract class AppDatabase : RoomDatabase() { val instance = Room.databaseBuilder( context.applicationContext, AppDatabase::class.java, - "cargill_maintenance_db" + "maintenance_db" ) .fallbackToDestructiveMigration() .build() diff --git a/app/src/main/java/com/example/data/repository/MaintenanceRepository.kt b/app/src/main/java/com/example/data/repository/MaintenanceRepository.kt index 4b20d47..5922d81 100644 --- a/app/src/main/java/com/example/data/repository/MaintenanceRepository.kt +++ b/app/src/main/java/com/example/data/repository/MaintenanceRepository.kt @@ -389,7 +389,7 @@ class MaintenanceRepository( suspend fun exportDatabaseBackup(context: Context, outputUri: Uri): Result = withContext(Dispatchers.IO) { runCatching { - val dbFile = context.getDatabasePath("cargill_maintenance_db") + val dbFile = context.getDatabasePath("maintenance_db") if (!dbFile.exists()) { throw java.io.IOException("Banco de dados não encontrado localmente.") } diff --git a/app/src/main/java/com/example/ui/components/CargillLogo.kt b/app/src/main/java/com/example/ui/components/AppLogo.kt similarity index 74% rename from app/src/main/java/com/example/ui/components/CargillLogo.kt rename to app/src/main/java/com/example/ui/components/AppLogo.kt index b78829b..a6919c1 100644 --- a/app/src/main/java/com/example/ui/components/CargillLogo.kt +++ b/app/src/main/java/com/example/ui/components/AppLogo.kt @@ -19,13 +19,11 @@ import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp - -// Official Cargill Colors for Theme Integration -val CargillGreen = Color(0xFF005F40) // Beautiful forest/leaf green -val CargillBlack = Color(0xFF1A1A1A) // High contrast premium charcoal-black +import com.example.ui.theme.BrandBlack +import com.example.ui.theme.BrandGreen @Composable -fun CargillLogo( +fun AppLogo( modifier: Modifier = Modifier, showText: Boolean = true, lightMode: Boolean = true @@ -35,7 +33,7 @@ fun CargillLogo( horizontalArrangement = Arrangement.Start, verticalAlignment = Alignment.CenterVertically ) { - // Draw the iconic curved leaf logo using Compose Canvas + // Draw the curved leaf logo using Compose Canvas Canvas( modifier = Modifier .width(52.dp) @@ -45,7 +43,6 @@ fun CargillLogo( val w = size.width val h = size.height - // High precision path modeling Cargill's leaf swoosh val path = Path().apply { // Outer arch moveTo(w * 0.05f, h * 0.85f) @@ -54,10 +51,10 @@ fun CargillLogo( w * 0.80f, h * 0.05f, // Control 2 w * 0.95f, h * 0.85f // End ) - // Bottom inner curve to create a leaf shape thickness + // Bottom inner curve cubicTo( - w * 0.75f, h * 0.35f, // Control 1 (tighter) - w * 0.25f, h * 0.35f, // Control 2 (tighter) + w * 0.75f, h * 0.35f, // Control 1 + w * 0.25f, h * 0.35f, // Control 2 w * 0.05f, h * 0.85f // Back to start ) close() @@ -65,18 +62,18 @@ fun CargillLogo( drawPath( path = path, - color = CargillGreen, + color = BrandGreen, style = Fill ) } if (showText) { Text( - text = "Cargill", - color = if (lightMode) CargillBlack else Color.White, - fontSize = 24.sp, + text = "Parada OS", + color = if (lightMode) BrandBlack else Color.White, + fontSize = 22.sp, fontFamily = FontFamily.SansSerif, - fontWeight = FontWeight.Black, + fontWeight = FontWeight.Bold, fontStyle = FontStyle.Italic, modifier = Modifier.padding(start = 4.dp, bottom = 2.dp) ) diff --git a/app/src/main/java/com/example/ui/screens/AnalyticsScreen.kt b/app/src/main/java/com/example/ui/screens/AnalyticsScreen.kt index 3d8b0d8..ea2a062 100644 --- a/app/src/main/java/com/example/ui/screens/AnalyticsScreen.kt +++ b/app/src/main/java/com/example/ui/screens/AnalyticsScreen.kt @@ -31,8 +31,8 @@ import com.example.data.model.MaintenanceActivity import com.example.data.model.OSUpdateHistory import com.example.data.model.parseDateOnly import com.example.data.model.AnalyticsState -import com.example.ui.theme.CargillBlack -import com.example.ui.theme.CargillGreen +import com.example.ui.theme.BrandBlack +import com.example.ui.theme.BrandGreen import com.example.ui.theme.LightGrey import com.example.ui.viewmodel.MaintenanceViewModel import java.text.SimpleDateFormat @@ -58,7 +58,7 @@ fun AnalyticsScreen( text = "Métricas Analíticas Avançadas", fontSize = 18.sp, fontWeight = FontWeight.Bold, - color = CargillBlack + color = BrandBlack ) }, navigationIcon = { @@ -71,12 +71,12 @@ fun AnalyticsScreen( Icon( imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Voltar", - tint = CargillGreen + tint = BrandGreen ) Spacer(modifier = Modifier.width(4.dp)) Text( text = "Voltar", - color = CargillGreen, + color = BrandGreen, fontSize = 16.sp, fontWeight = FontWeight.Medium ) @@ -148,7 +148,7 @@ fun TeamProductivityCard(teamMetrics: List>) { text = "Produtividade da Equipe", fontSize = 16.sp, fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, modifier = Modifier.padding(bottom = 16.dp) ) @@ -177,7 +177,7 @@ fun TeamProductivityCard(teamMetrics: List>) { text = "$percentage%", fontSize = 12.sp, fontWeight = FontWeight.Bold, - color = CargillBlack + color = BrandBlack ) Spacer(modifier = Modifier.height(4.dp)) Box( @@ -222,7 +222,7 @@ fun SCurveCard(analyticsState: AnalyticsState) { text = "Progresso do Projeto: Planejado vs. Realizado", fontSize = 16.sp, fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, textAlign = TextAlign.Center, modifier = Modifier .fillMaxWidth() @@ -381,7 +381,7 @@ fun OverdueByTagCard(overdueByTag: List>) { text = "Atrasados por TAG", fontSize = 16.sp, fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, textAlign = TextAlign.Center, modifier = Modifier .fillMaxWidth() @@ -428,7 +428,7 @@ fun OverdueByTagCard(overdueByTag: List>) { text = tag, fontSize = 12.sp, fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, modifier = Modifier.width(90.dp), maxLines = 1 ) @@ -455,7 +455,7 @@ fun OverdueByTagCard(overdueByTag: List>) { text = count.toString(), fontSize = 12.sp, fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, modifier = Modifier.width(20.dp), textAlign = TextAlign.End ) diff --git a/app/src/main/java/com/example/ui/screens/DashboardStubScreen.kt b/app/src/main/java/com/example/ui/screens/DashboardStubScreen.kt index 8a37578..4493dc2 100644 --- a/app/src/main/java/com/example/ui/screens/DashboardStubScreen.kt +++ b/app/src/main/java/com/example/ui/screens/DashboardStubScreen.kt @@ -17,8 +17,8 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.example.ui.theme.CargillBlack -import com.example.ui.theme.CargillGreen +import com.example.ui.theme.BrandBlack +import com.example.ui.theme.BrandGreen import com.example.ui.theme.LightGrey @Composable @@ -49,7 +49,7 @@ fun DashboardStubScreen( Icon( imageVector = Icons.Default.BarChart, contentDescription = "Analytics Icon", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(72.dp) ) @@ -59,7 +59,7 @@ fun DashboardStubScreen( text = "Dashboard Analítico", fontSize = 22.sp, fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, textAlign = TextAlign.Center ) @@ -82,7 +82,7 @@ fun DashboardStubScreen( ) { Text( text = "Recurso Planejado - Em Breve", - color = CargillGreen, + color = BrandGreen, fontSize = 12.sp, fontWeight = FontWeight.Bold ) diff --git a/app/src/main/java/com/example/ui/screens/MaintenanceDashboardScreen.kt b/app/src/main/java/com/example/ui/screens/MaintenanceDashboardScreen.kt index 9418b86..60d5916 100644 --- a/app/src/main/java/com/example/ui/screens/MaintenanceDashboardScreen.kt +++ b/app/src/main/java/com/example/ui/screens/MaintenanceDashboardScreen.kt @@ -54,9 +54,9 @@ import com.example.data.model.OSUpdateHistory import com.example.data.model.extractDateOnly import com.example.data.model.formatToShortDate import com.example.data.model.parseDateOnly -import com.example.ui.components.CargillBlack -import com.example.ui.components.CargillGreen -import com.example.ui.components.CargillLogo +import com.example.ui.theme.BrandBlack +import com.example.ui.theme.BrandGreen +import com.example.ui.components.AppLogo import com.example.ui.viewmodel.MaintenanceViewModel import java.text.SimpleDateFormat import java.util.Date @@ -236,7 +236,7 @@ fun MaintenanceDashboardScreen( text = "Gestão OS", style = MaterialTheme.typography.titleLarge.copy( fontWeight = FontWeight.Bold, - color = CargillBlack + color = BrandBlack ) ) }, @@ -253,7 +253,7 @@ fun MaintenanceDashboardScreen( Icon( imageVector = if (internetAvailable) Icons.Default.Cloud else Icons.Default.CloudOff, contentDescription = "Online Atualizado", - tint = if (internetAvailable) CargillGreen else StatusGrey, + tint = if (internetAvailable) BrandGreen else StatusGrey, modifier = Modifier.size(18.dp) ) } @@ -277,7 +277,7 @@ fun MaintenanceDashboardScreen( Icon( imageVector = Icons.Default.Sync, contentDescription = "Sincronizar dados", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.rotate(if (isSyncing) angle else 0f) ) } @@ -325,7 +325,7 @@ fun MaintenanceDashboardScreen( modifier = Modifier .size(24.dp) .clip(CircleShape) - .background(CargillGreen), + .background(BrandGreen), contentAlignment = Alignment.Center ) { Text( @@ -341,7 +341,7 @@ fun MaintenanceDashboardScreen( text = currentUser!!.displayName.substringBefore(" "), fontSize = 10.sp, fontWeight = FontWeight.Bold, - color = CargillBlack + color = BrandBlack ) Text( text = currentUser!!.email, @@ -353,7 +353,7 @@ fun MaintenanceDashboardScreen( Icon( imageVector = Icons.Default.ArrowDropDown, contentDescription = "Menu de Usuário", - tint = CargillBlack, + tint = BrandBlack, modifier = Modifier.size(16.dp) ) } @@ -436,13 +436,13 @@ fun MaintenanceDashboardScreen( modifier = Modifier .size(52.dp) .clip(RoundedCornerShape(12.dp)) - .background(if (showAdvancedFilters) CargillGreen else Color.White) + .background(if (showAdvancedFilters) BrandGreen else Color.White) .testTag("toggle_filters_button") ) { Icon( imageVector = Icons.Default.Tune, contentDescription = "Filtros avançados", - tint = if (showAdvancedFilters) Color.White else CargillBlack + tint = if (showAdvancedFilters) Color.White else BrandBlack ) } } @@ -498,7 +498,7 @@ fun MaintenanceDashboardScreen( text = "Ordens de Serviço (${activities.size})", fontSize = 15.sp, fontWeight = FontWeight.Bold, - color = CargillBlack + color = BrandBlack ) IconButton( onClick = { isListExpanded = !isListExpanded }, @@ -507,7 +507,7 @@ fun MaintenanceDashboardScreen( Icon( imageVector = if (isListExpanded) Icons.Default.FullscreenExit else Icons.Default.Fullscreen, contentDescription = if (isListExpanded) "Recolher visualização" else "Expandir listagem", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(20.dp) ) } @@ -557,7 +557,7 @@ fun MaintenanceDashboardScreen( viewModel.setFilterRecurso("Todos") viewModel.setSearchQuery("") }, - colors = ButtonDefaults.buttonColors(containerColor = CargillBlack) + colors = ButtonDefaults.buttonColors(containerColor = BrandBlack) ) { Text("Limpar Todos os Filtros") } @@ -665,7 +665,7 @@ fun DashboardMetrics(activities: List) { text = "Visão Geral de Campo", fontSize = 18.sp, fontWeight = FontWeight.Black, - color = CargillBlack + color = BrandBlack ) } @@ -677,7 +677,7 @@ fun DashboardMetrics(activities: List) { CircularProgressIndicator( progress = { avgProgress.toFloat() / 100f }, modifier = Modifier.fillMaxSize(), - color = CargillGreen, + color = BrandGreen, strokeWidth = 6.dp, trackColor = Color(0xFFE8F5E9) ) @@ -685,7 +685,7 @@ fun DashboardMetrics(activities: List) { text = "$avgProgress%", fontSize = 12.sp, fontWeight = FontWeight.Black, - color = CargillGreen + color = BrandGreen ) } } @@ -701,8 +701,8 @@ fun DashboardMetrics(activities: List) { ) { MetricColumn(value = "$notStartedCount", label = "Não Inic.", color = StatusGrey, icon = Icons.Default.PlayArrow) MetricColumn(value = "$inProgressCount", label = "Em Andam.", color = StatusBlue, icon = Icons.Default.Speed) - MetricColumn(value = "$completedCount", label = "Concluídas", color = CargillGreen, icon = Icons.Default.CheckCircle) - MetricColumn(value = "$totalCount", label = "Total OSs", color = CargillBlack, icon = Icons.Default.Build) + MetricColumn(value = "$completedCount", label = "Concluídas", color = BrandGreen, icon = Icons.Default.CheckCircle) + MetricColumn(value = "$totalCount", label = "Total OSs", color = BrandBlack, icon = Icons.Default.Build) } } } @@ -839,7 +839,7 @@ fun FilterChipWidget(text: String, isSelected: Boolean, onClick: () -> Unit) { Surface( onClick = onClick, shape = RoundedCornerShape(20.dp), - color = if (isSelected) CargillGreen else Color.White, + color = if (isSelected) BrandGreen else Color.White, border = BorderStroke(1.dp, if (isSelected) Color.Transparent else Color(0xFFE0E0E0)), modifier = Modifier.height(28.dp) ) { @@ -849,7 +849,7 @@ fun FilterChipWidget(text: String, isSelected: Boolean, onClick: () -> Unit) { ) { Text( text = text, - color = if (isSelected) Color.White else CargillBlack, + color = if (isSelected) Color.White else BrandBlack, fontSize = 11.sp, fontWeight = if (isSelected) FontWeight.Bold else FontWeight.Medium ) @@ -892,14 +892,14 @@ fun OSListItemCard( text = activity.numeroOs, fontWeight = FontWeight.Black, fontSize = 15.sp, - color = CargillBlack + color = BrandBlack ) // Sync Status Badge Icon( imageVector = if (activity.synced) Icons.Default.CloudDone else Icons.Default.CloudQueue, contentDescription = if (activity.synced) "Sincronizado" else "Salvo localmente offline", - tint = if (activity.synced) CargillGreen else Color(0xFFFF9100), + tint = if (activity.synced) BrandGreen else Color(0xFFFF9100), modifier = Modifier.size(16.dp) ) } @@ -913,7 +913,7 @@ fun OSListItemCard( val badgeTextColor = when (activity.status) { ActivityStatus.NAO_INICIADO -> StatusGrey ActivityStatus.EM_ANDAMENTO -> StatusBlue - ActivityStatus.CONCLUIDO -> CargillGreen + ActivityStatus.CONCLUIDO -> BrandGreen } Box( @@ -938,7 +938,7 @@ fun OSListItemCard( text = activity.descricao, fontSize = 13.sp, fontWeight = FontWeight.Medium, - color = CargillBlack, + color = BrandBlack, maxLines = 2, overflow = TextOverflow.Ellipsis ) @@ -963,7 +963,7 @@ fun OSListItemCard( text = activity.setor, fontSize = 10.sp, fontWeight = FontWeight.Bold, - color = CargillGreen + color = BrandGreen ) } @@ -1028,7 +1028,7 @@ fun OSListItemCard( .fillMaxWidth(activity.percentualExecucao.toFloat() / 100f) .height(8.dp) .clip(CircleShape) - .background(if (activity.percentualExecucao >= 100) CargillGreen else StatusBlue) + .background(if (activity.percentualExecucao >= 100) BrandGreen else StatusBlue) ) } @@ -1037,7 +1037,7 @@ fun OSListItemCard( text = "${activity.percentualExecucao}%", fontSize = 12.sp, fontWeight = FontWeight.Black, - color = if (activity.percentualExecucao >= 100) CargillGreen else StatusBlue + color = if (activity.percentualExecucao >= 100) BrandGreen else StatusBlue ) } @@ -1165,7 +1165,7 @@ fun EditActivityBottomSheet( text = activity.numeroOs, fontSize = 20.sp, fontWeight = FontWeight.Black, - color = CargillBlack + color = BrandBlack ) } @@ -1184,11 +1184,11 @@ fun EditActivityBottomSheet( text = activity.descricao, fontSize = 13.sp, fontWeight = FontWeight.Medium, - color = CargillBlack + color = BrandBlack ) Spacer(modifier = Modifier.height(8.dp)) Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) { - Text("Setor: ${activity.setor}", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = CargillGreen) + Text("Setor: ${activity.setor}", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = BrandGreen) Text("Equipe: ${activity.equipe}", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = StatusBlue) Text("Recurso: ${activity.recurso}", fontSize = 11.sp, color = StatusGrey) } @@ -1206,13 +1206,13 @@ fun EditActivityBottomSheet( text = "Percentual de Execução", fontWeight = FontWeight.Bold, fontSize = 14.sp, - color = CargillBlack + color = BrandBlack ) Text( text = "${progressValue.toInt()}%", fontWeight = FontWeight.Black, fontSize = 18.sp, - color = if (progressValue >= 100) CargillGreen else StatusBlue + color = if (progressValue >= 100) BrandGreen else StatusBlue ) } @@ -1222,8 +1222,8 @@ fun EditActivityBottomSheet( valueRange = 0f..100f, steps = 19, // Splits in 5% increments for rapid tactile field logging colors = SliderDefaults.colors( - thumbColor = if (progressValue >= 100) CargillGreen else StatusBlue, - activeTrackColor = if (progressValue >= 100) CargillGreen else StatusBlue + thumbColor = if (progressValue >= 100) BrandGreen else StatusBlue, + activeTrackColor = if (progressValue >= 100) BrandGreen else StatusBlue ), enabled = currentUser != null ) @@ -1258,7 +1258,7 @@ fun EditActivityBottomSheet( contentPadding = PaddingValues(0.dp), enabled = currentUser != null ) { - Text("100% (Concluir)", color = CargillGreen, fontSize = 11.sp, fontWeight = FontWeight.Bold) + Text("100% (Concluir)", color = BrandGreen, fontSize = 11.sp, fontWeight = FontWeight.Bold) } } } @@ -1269,7 +1269,7 @@ fun EditActivityBottomSheet( text = "Observações de Campo", fontWeight = FontWeight.Bold, fontSize = 14.sp, - color = CargillBlack + color = BrandBlack ) OutlinedTextField( value = observationText, @@ -1291,7 +1291,7 @@ fun EditActivityBottomSheet( text = "Anexar Foto de Campo (Simulador de Câmera)", fontWeight = FontWeight.Bold, fontSize = 14.sp, - color = CargillBlack + color = BrandBlack ) Text( text = "Selecione uma categoria de inspeção para simular o anexo fotográfico da atividade:", @@ -1309,7 +1309,7 @@ fun EditActivityBottomSheet( onClick = { if (currentUser != null) selectedMockPhotoPath = if (isSelected) null else mockName }, shape = RoundedCornerShape(8.dp), color = if (isSelected) Color(0xFFE8F5E9) else Color(0xFFF5F5F5), - border = BorderStroke(1.dp, if (isSelected) CargillGreen else Color(0xFFE0E0E0)), + border = BorderStroke(1.dp, if (isSelected) BrandGreen else Color(0xFFE0E0E0)), modifier = Modifier.height(48.dp) ) { Row( @@ -1320,14 +1320,14 @@ fun EditActivityBottomSheet( Icon( imageVector = Icons.Default.CameraAlt, contentDescription = label, - tint = if (isSelected) CargillGreen else StatusGrey, + tint = if (isSelected) BrandGreen else StatusGrey, modifier = Modifier.size(16.dp) ) Text( text = label, fontSize = 11.sp, fontWeight = FontWeight.Bold, - color = if (isSelected) CargillGreen else CargillBlack + color = if (isSelected) BrandGreen else BrandBlack ) } } @@ -1348,11 +1348,11 @@ fun EditActivityBottomSheet( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp) ) { - Icon(Icons.Default.Check, contentDescription = "Foto vinculada", tint = CargillGreen) + Icon(Icons.Default.Check, contentDescription = "Foto vinculada", tint = BrandGreen) Text( text = "Foto do componente '$selectedMockPhotoPath' anexada com sucesso à OS localmente!", fontSize = 11.sp, - color = CargillGreen, + color = BrandGreen, fontWeight = FontWeight.Bold ) } @@ -1472,7 +1472,7 @@ fun EditActivityBottomSheet( .fillMaxWidth() .height(48.dp) .testTag("save_progress_button"), - colors = ButtonDefaults.buttonColors(containerColor = CargillGreen), + colors = ButtonDefaults.buttonColors(containerColor = BrandGreen), shape = RoundedCornerShape(10.dp) ) { Icon(Icons.Default.Save, contentDescription = "Salvar") @@ -1489,12 +1489,12 @@ fun EditActivityBottomSheet( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp) ) { - Icon(Icons.Default.History, contentDescription = "Histórico", tint = CargillBlack, modifier = Modifier.size(18.dp)) + Icon(Icons.Default.History, contentDescription = "Histórico", tint = BrandBlack, modifier = Modifier.size(18.dp)) Text( text = "Histórico de Atualizações da OS", fontWeight = FontWeight.Bold, fontSize = 14.sp, - color = CargillBlack + color = BrandBlack ) } @@ -1554,7 +1554,7 @@ fun TimelineLogItem(log: OSUpdateHistory) { text = log.recurso, fontSize = 11.sp, fontWeight = FontWeight.Bold, - color = CargillBlack + color = BrandBlack ) } Text( @@ -1580,7 +1580,7 @@ fun TimelineLogItem(log: OSUpdateHistory) { text = "${log.percentualAnterior}% ➜ ${log.percentualNovo}%", fontSize = 11.sp, fontWeight = FontWeight.Black, - color = if (log.percentualNovo >= 100) CargillGreen else StatusBlue + color = if (log.percentualNovo >= 100) BrandGreen else StatusBlue ) } @@ -1597,7 +1597,7 @@ fun TimelineLogItem(log: OSUpdateHistory) { Text( text = "\"${log.observacao}\"", fontSize = 11.sp, - color = CargillBlack + color = BrandBlack ) } } @@ -1613,8 +1613,8 @@ fun TimelineLogItem(log: OSUpdateHistory) { .background(Color(0xFFE8F5E9)) .padding(horizontal = 6.dp, vertical = 2.dp) ) { - Icon(Icons.Default.CameraAlt, contentDescription = "Foto", tint = CargillGreen, modifier = Modifier.size(10.dp)) - Text("Foto Anexa: ${log.fotoPath}", fontSize = 9.sp, color = CargillGreen, fontWeight = FontWeight.Bold) + Icon(Icons.Default.CameraAlt, contentDescription = "Foto", tint = BrandGreen, modifier = Modifier.size(10.dp)) + Text("Foto Anexa: ${log.fotoPath}", fontSize = 9.sp, color = BrandGreen, fontWeight = FontWeight.Bold) } } } @@ -1658,7 +1658,7 @@ fun ImporterConsoleSheet( text = "Importar Planilha do PCM", fontSize = 18.sp, fontWeight = FontWeight.Black, - color = CargillBlack + color = BrandBlack ) } IconButton(onClick = onDismiss) { @@ -1682,7 +1682,7 @@ fun ImporterConsoleSheet( modifier = Modifier.padding(12.dp), verticalArrangement = Arrangement.spacedBy(4.dp) ) { - Text("Estrutura Esperada do Arquivo (Excel):", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = CargillBlack) + Text("Estrutura Esperada do Arquivo (Excel):", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = BrandBlack) Text("• Colunas Obrigatórias: Número da OS, Descrição da Atividade", fontSize = 11.sp, color = StatusGrey) Text("• Colunas Opcionais: Setor, Equipe, Recurso, Início, Fim, %", fontSize = 11.sp, color = StatusGrey) Text("• Suporta separadores por Vírgula (,) ou Ponto e Vírgula (;)", fontSize = 11.sp, color = StatusGrey) @@ -1700,7 +1700,7 @@ fun ImporterConsoleSheet( modifier = Modifier .fillMaxWidth() .height(48.dp), - colors = ButtonDefaults.buttonColors(containerColor = CargillGreen) + colors = ButtonDefaults.buttonColors(containerColor = BrandGreen) ) { Icon(Icons.Default.UploadFile, contentDescription = "Upload CSV") Spacer(modifier = Modifier.width(8.dp)) diff --git a/app/src/main/java/com/example/ui/screens/SettingsScreen.kt b/app/src/main/java/com/example/ui/screens/SettingsScreen.kt index ce3cca5..bffffd7 100644 --- a/app/src/main/java/com/example/ui/screens/SettingsScreen.kt +++ b/app/src/main/java/com/example/ui/screens/SettingsScreen.kt @@ -41,9 +41,9 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.example.ui.theme.CargillBlack -import com.example.ui.theme.CargillGreen -import com.example.ui.theme.CargillLightGreen +import com.example.ui.theme.BrandBlack +import com.example.ui.theme.BrandGreen +import com.example.ui.theme.BrandLightGreen import com.example.ui.theme.LightGrey import com.example.ui.viewmodel.MaintenanceViewModel @@ -108,12 +108,12 @@ fun SettingsScreen( Icon( imageVector = Icons.Default.KeyboardArrowLeft, contentDescription = "Voltar", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(28.dp) ) Text( text = "Voltar", - color = CargillGreen, + color = BrandGreen, fontSize = 16.sp, fontWeight = FontWeight.Bold ) @@ -122,7 +122,7 @@ fun SettingsScreen( text = "Configurações do Planejador PCM", fontSize = 18.sp, fontWeight = FontWeight.Bold, - color = CargillBlack + color = BrandBlack ) } }, @@ -215,7 +215,7 @@ fun SettingsScreen( modifier = Modifier .fillMaxWidth() .height(8.dp), - color = CargillGreen, + color = BrandGreen, trackColor = Color(0xFFE0E0E0), strokeCap = androidx.compose.ui.graphics.StrokeCap.Round ) @@ -230,19 +230,19 @@ fun SettingsScreen( text = apiLatency ?: "0ms", fontSize = 16.sp, fontWeight = FontWeight.Black, - color = CargillBlack + color = BrandBlack ) Icon( imageVector = Icons.Default.DateRange, contentDescription = "Online", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(14.dp) ) Text( text = "Online", fontSize = 14.sp, fontWeight = FontWeight.Bold, - color = CargillGreen + color = BrandGreen ) } } @@ -270,7 +270,7 @@ fun SettingsScreen( Icon( imageVector = Icons.Default.Info, contentDescription = "Cota", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(14.dp) ) } @@ -283,7 +283,7 @@ fun SettingsScreen( modifier = Modifier .fillMaxWidth() .height(8.dp), - color = CargillGreen, + color = BrandGreen, trackColor = Color(0xFFE0E0E0), strokeCap = androidx.compose.ui.graphics.StrokeCap.Round ) @@ -298,13 +298,13 @@ fun SettingsScreen( text = apiQuota ?: "0%", fontSize = 16.sp, fontWeight = FontWeight.Black, - color = CargillBlack + color = BrandBlack ) Text( text = "Bom", fontSize = 14.sp, fontWeight = FontWeight.Bold, - color = CargillGreen + color = BrandGreen ) } } @@ -352,7 +352,7 @@ fun SettingsScreen( text = "Exportar Backup do BD", icon = Icons.Default.Download, onClick = { - backupLauncher.launch("cargill_maintenance_backup.db") + backupLauncher.launch("maintenance_backup.db") } ) @@ -475,13 +475,13 @@ fun ConflictsDialog( Icon( imageVector = Icons.Default.CheckCircle, contentDescription = "Sem conflitos", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(48.dp) ) Text( text = "Nenhum conflito registrado.", fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, fontSize = 14.sp ) } @@ -584,7 +584,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) { ) { Text( text = winnerLabel, - color = CargillGreen, + color = BrandGreen, fontSize = 11.sp, fontWeight = FontWeight.Bold ) @@ -594,7 +594,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) { Text( text = log.descricaoOs, fontSize = 13.sp, - color = CargillBlack, + color = BrandBlack, fontWeight = FontWeight.Normal ) @@ -629,12 +629,12 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) { verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp) ) { - Text(text = "Local", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = CargillBlack) + Text(text = "Local", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = BrandBlack) if (log.resolvidoPorLocal) { Icon( imageVector = Icons.Default.Check, contentDescription = "Vencedor", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(12.dp) ) } @@ -643,7 +643,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) { text = "Progresso: ${log.localPercentual}%", fontSize = 12.sp, fontWeight = if (log.resolvidoPorLocal) FontWeight.Bold else FontWeight.Normal, - color = CargillBlack + color = BrandBlack ) Text(text = "Editor: ${log.localEditor?.substringBefore("@") ?: "Local"}", fontSize = 10.sp, color = Color.Gray) Text(text = dataLocal, fontSize = 10.sp, color = Color.Gray) @@ -668,12 +668,12 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) { verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp) ) { - Text(text = "Servidor", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = CargillBlack) + Text(text = "Servidor", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = BrandBlack) if (!log.resolvidoPorLocal) { Icon( imageVector = Icons.Default.Check, contentDescription = "Vencedor", - tint = CargillGreen, + tint = BrandGreen, modifier = Modifier.size(12.dp) ) } @@ -682,7 +682,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) { text = "Progresso: ${log.remotePercentual}%", fontSize = 12.sp, fontWeight = if (!log.resolvidoPorLocal) FontWeight.Bold else FontWeight.Normal, - color = CargillBlack + color = BrandBlack ) Text(text = "Editor: ${log.remoteEditor?.substringBefore("@") ?: "Servidor"}", fontSize = 10.sp, color = Color.Gray) Text(text = dataRemote, fontSize = 10.sp, color = Color.Gray) @@ -718,13 +718,13 @@ fun AdminButton( CircularProgressIndicator( modifier = Modifier.size(20.dp), strokeWidth = 2.dp, - color = CargillGreen + color = BrandGreen ) } else { Icon( imageVector = icon, contentDescription = text, - tint = CargillBlack, + tint = BrandBlack, modifier = Modifier.size(22.dp) ) } @@ -733,7 +733,7 @@ fun AdminButton( text = text, fontSize = 16.sp, fontWeight = FontWeight.Bold, - color = CargillBlack, + color = BrandBlack, textAlign = TextAlign.Center ) } diff --git a/app/src/main/java/com/example/ui/theme/Color.kt b/app/src/main/java/com/example/ui/theme/Color.kt index b710d16..183a4ac 100644 --- a/app/src/main/java/com/example/ui/theme/Color.kt +++ b/app/src/main/java/com/example/ui/theme/Color.kt @@ -2,9 +2,9 @@ package com.example.ui.theme import androidx.compose.ui.graphics.Color -val CargillGreen = Color(0xFF005F40) -val CargillBlack = Color(0xFF1A1A1A) -val CargillLightGreen = Color(0xFFE8F5E9) +val BrandGreen = Color(0xFF005F40) +val BrandBlack = Color(0xFF1A1A1A) +val BrandLightGreen = Color(0xFFE8F5E9) val DarkGreen = Color(0xFF003D28) val Charcoal = Color(0xFF2C2C2C) diff --git a/app/src/main/java/com/example/ui/theme/Theme.kt b/app/src/main/java/com/example/ui/theme/Theme.kt index 097100a..7588030 100644 --- a/app/src/main/java/com/example/ui/theme/Theme.kt +++ b/app/src/main/java/com/example/ui/theme/Theme.kt @@ -13,18 +13,18 @@ import androidx.compose.ui.platform.LocalContext private val DarkColorScheme = darkColorScheme( - primary = CargillGreen, + primary = BrandGreen, secondary = Charcoal, - tertiary = CargillLightGreen, - background = CargillBlack, + tertiary = BrandLightGreen, + background = BrandBlack, surface = Charcoal ) private val LightColorScheme = lightColorScheme( - primary = CargillGreen, - secondary = CargillBlack, - tertiary = CargillLightGreen, + primary = BrandGreen, + secondary = BrandBlack, + tertiary = BrandLightGreen, background = LightGrey, surface = Color.White ) @@ -32,7 +32,7 @@ private val LightColorScheme = @Composable fun MyApplicationTheme( darkTheme: Boolean = isSystemInDarkTheme(), - // Set dynamic color to false by default to strictly preserve our Cargill green identity + // Set dynamic color to false by default to strictly preserve our brand green identity dynamicColor: Boolean = false, content: @Composable () -> Unit, ) { diff --git a/app/src/main/java/com/example/ui/viewmodel/MaintenanceViewModel.kt b/app/src/main/java/com/example/ui/viewmodel/MaintenanceViewModel.kt index 6f301b7..f1b8367 100644 --- a/app/src/main/java/com/example/ui/viewmodel/MaintenanceViewModel.kt +++ b/app/src/main/java/com/example/ui/viewmodel/MaintenanceViewModel.kt @@ -319,7 +319,7 @@ class MaintenanceViewModel(private val repository: MaintenanceRepository) : View viewModelScope.launch { _isSyncing.value = true - _syncStatusMessage.value = "Conectando ao servidor central da Cargill..." + _syncStatusMessage.value = "Conectando ao servidor central..." when (val result = repository.synchronizeWithBackend()) { is SyncResult.Success -> { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3110b01..2fc602a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - Cargill Parada OS + Gestão Parada OS diff --git a/app/src/test/java/com/example/ExampleRobolectricTest.kt b/app/src/test/java/com/example/ExampleRobolectricTest.kt index 9eae2f1..a388600 100644 --- a/app/src/test/java/com/example/ExampleRobolectricTest.kt +++ b/app/src/test/java/com/example/ExampleRobolectricTest.kt @@ -24,7 +24,7 @@ class ExampleRobolectricTest { fun `read string from context`() { val context = ApplicationProvider.getApplicationContext() val appName = context.getString(R.string.app_name) - assertEquals("Cargill Parada OS", appName) + assertEquals("Gestão Parada OS", appName) } @Test @@ -274,9 +274,9 @@ class ExampleRobolectricTest { .build() val repository = com.example.data.repository.MaintenanceRepository(db.maintenanceDao(), context) - val userAdmin = com.example.data.model.UserAccess("admin@cargill.com", "total") - val userEditor = com.example.data.model.UserAccess("editor@cargill.com", "editor") - val userViewer = com.example.data.model.UserAccess("viewer@cargill.com", "leitor") + val userAdmin = com.example.data.model.UserAccess("admin@empresa.com", "total") + val userEditor = com.example.data.model.UserAccess("editor@empresa.com", "editor") + val userViewer = com.example.data.model.UserAccess("viewer@empresa.com", "leitor") kotlinx.coroutines.runBlocking { db.maintenanceDao().insertUserAccessList(listOf(userAdmin, userEditor, userViewer)) @@ -310,28 +310,28 @@ class ExampleRobolectricTest { // Access level should be null assertEquals(null, viewModel.userAccessLevel.value) - // Test 2: Log in as viewer (viewer@cargill.com) - viewModel.loginUser("viewer@cargill.com", "Viewer User") + // Test 2: Log in as viewer (viewer@empresa.com) + viewModel.loginUser("viewer@empresa.com", "Viewer User") Thread.sleep(100) org.robolectric.shadows.ShadowLooper.idleMainLooper() assertEquals("leitor", viewModel.userAccessLevel.value) // Attempt to edit progress (should fail because access level is leitor, which is not total or editor) - viewModel.updateProgress("OS-ACCESS", 50, "Tentando editar", null, "Viewer User", "viewer@cargill.com") + viewModel.updateProgress("OS-ACCESS", 50, "Tentando editar", null, "Viewer User", "viewer@empresa.com") Thread.sleep(100) org.robolectric.shadows.ShadowLooper.idleMainLooper() // OS percentualExecucao should remain 0 val actAfterViewer = db.maintenanceDao().getActivityByOsOneShot("OS-ACCESS") assertEquals(0, actAfterViewer?.percentualExecucao) - // Test 3: Log in as editor (editor@cargill.com) - viewModel.loginUser("editor@cargill.com", "Editor User") + // Test 3: Log in as editor (editor@empresa.com) + viewModel.loginUser("editor@empresa.com", "Editor User") Thread.sleep(100) org.robolectric.shadows.ShadowLooper.idleMainLooper() assertEquals("editor", viewModel.userAccessLevel.value) // Attempt to edit progress (should succeed because access level is editor) - viewModel.updateProgress("OS-ACCESS", 80, "Editando com editor", null, "Editor User", "editor@cargill.com") + viewModel.updateProgress("OS-ACCESS", 80, "Editando com editor", null, "Editor User", "editor@empresa.com") Thread.sleep(100) org.robolectric.shadows.ShadowLooper.idleMainLooper() // OS percentualExecucao should now be 80 diff --git a/app/src/test/java/com/example/ExampleUnitTest.kt b/app/src/test/java/com/example/ExampleUnitTest.kt index 538d19c..a197f54 100644 --- a/app/src/test/java/com/example/ExampleUnitTest.kt +++ b/app/src/test/java/com/example/ExampleUnitTest.kt @@ -177,17 +177,17 @@ class ExampleUnitTest { @Test fun testConflictResolutionComputation() { val localHistory = listOf( - com.example.data.model.OSUpdateHistory(id = 1, numeroOs = "OS1", timestamp = 1000L, percentualAnterior = 0, percentualNovo = 20, recurso = "Mecânico", emailEditor = "local@cargill.com"), - com.example.data.model.OSUpdateHistory(id = 2, numeroOs = "OS2", timestamp = 1500L, percentualAnterior = 0, percentualNovo = 50, recurso = "Elétrico", emailEditor = "local@cargill.com"), - com.example.data.model.OSUpdateHistory(id = 4, numeroOs = "OS4", timestamp = 3000L, percentualAnterior = 0, percentualNovo = 90, recurso = "Mecânico", emailEditor = "local@cargill.com"), - com.example.data.model.OSUpdateHistory(id = 5, numeroOs = "OS5", timestamp = 4000L, percentualAnterior = 0, percentualNovo = 10, recurso = "Elétrico", emailEditor = "local@cargill.com") + com.example.data.model.OSUpdateHistory(id = 1, numeroOs = "OS1", timestamp = 1000L, percentualAnterior = 0, percentualNovo = 20, recurso = "Mecânico", emailEditor = "local@empresa.com"), + com.example.data.model.OSUpdateHistory(id = 2, numeroOs = "OS2", timestamp = 1500L, percentualAnterior = 0, percentualNovo = 50, recurso = "Elétrico", emailEditor = "local@empresa.com"), + com.example.data.model.OSUpdateHistory(id = 4, numeroOs = "OS4", timestamp = 3000L, percentualAnterior = 0, percentualNovo = 90, recurso = "Mecânico", emailEditor = "local@empresa.com"), + com.example.data.model.OSUpdateHistory(id = 5, numeroOs = "OS5", timestamp = 4000L, percentualAnterior = 0, percentualNovo = 10, recurso = "Elétrico", emailEditor = "local@empresa.com") ) val remoteHistory = listOf( - com.example.data.model.OSUpdateHistory(id = 10, numeroOs = "OS1", timestamp = 1200L, percentualAnterior = 0, percentualNovo = 30, recurso = "Mecânico", emailEditor = "remote@cargill.com"), - com.example.data.model.OSUpdateHistory(id = 11, numeroOs = "OS3", timestamp = 2000L, percentualAnterior = 0, percentualNovo = 70, recurso = "Elétrico", emailEditor = "remote@cargill.com"), - com.example.data.model.OSUpdateHistory(id = 12, numeroOs = "OS4", timestamp = 2500L, percentualAnterior = 0, percentualNovo = 80, recurso = "Mecânico", emailEditor = "remote@cargill.com"), - com.example.data.model.OSUpdateHistory(id = 13, numeroOs = "OS5", timestamp = 4500L, percentualAnterior = 0, percentualNovo = 40, recurso = "Elétrico", emailEditor = "remote@cargill.com") + com.example.data.model.OSUpdateHistory(id = 10, numeroOs = "OS1", timestamp = 1200L, percentualAnterior = 0, percentualNovo = 30, recurso = "Mecânico", emailEditor = "remote@empresa.com"), + com.example.data.model.OSUpdateHistory(id = 11, numeroOs = "OS3", timestamp = 2000L, percentualAnterior = 0, percentualNovo = 70, recurso = "Elétrico", emailEditor = "remote@empresa.com"), + com.example.data.model.OSUpdateHistory(id = 12, numeroOs = "OS4", timestamp = 2500L, percentualAnterior = 0, percentualNovo = 80, recurso = "Mecânico", emailEditor = "remote@empresa.com"), + com.example.data.model.OSUpdateHistory(id = 13, numeroOs = "OS5", timestamp = 4500L, percentualAnterior = 0, percentualNovo = 40, recurso = "Elétrico", emailEditor = "remote@empresa.com") ) val localHistoryKeys = localHistory.map { "${it.numeroOs}_${it.timestamp}" }.toSet() @@ -271,10 +271,10 @@ class ExampleUnitTest { // Simulate user access lists matching dynamic headers val rows = listOf( listOf("E-mail", "Nível de Acesso"), - listOf("admin@cargill.com", "total"), - listOf("editor@cargill.com", "editor"), - listOf("viewer@cargill.com", "leitor"), - listOf("random@cargill.com", "outro") + listOf("admin@empresa.com", "total"), + listOf("editor@empresa.com", "editor"), + listOf("viewer@empresa.com", "leitor"), + listOf("random@empresa.com", "outro") ) val headers = rows[0].map { it.trim().lowercase() } @@ -292,9 +292,9 @@ class ExampleUnitTest { accessMap[email] = nivel } - assertEquals("total", accessMap["admin@cargill.com"]) - assertEquals("editor", accessMap["editor@cargill.com"]) - assertEquals("leitor", accessMap["viewer@cargill.com"]) + assertEquals("total", accessMap["admin@empresa.com"]) + assertEquals("editor", accessMap["editor@empresa.com"]) + assertEquals("leitor", accessMap["viewer@empresa.com"]) // Function to check write permission val hasWriteAccess = { email: String -> @@ -302,10 +302,10 @@ class ExampleUnitTest { level == "total" || level == "editor" } - assertTrue(hasWriteAccess("admin@cargill.com")) - assertTrue(hasWriteAccess("editor@cargill.com")) - assertFalse(hasWriteAccess("viewer@cargill.com")) - assertFalse(hasWriteAccess("random@cargill.com")) - assertFalse(hasWriteAccess("nonexistent@cargill.com")) + assertTrue(hasWriteAccess("admin@empresa.com")) + assertTrue(hasWriteAccess("editor@empresa.com")) + assertFalse(hasWriteAccess("viewer@empresa.com")) + assertFalse(hasWriteAccess("random@empresa.com")) + assertFalse(hasWriteAccess("nonexistent@empresa.com")) } } diff --git a/app/src/test/java/com/example/GreetingScreenshotTest.kt b/app/src/test/java/com/example/GreetingScreenshotTest.kt index 17e4788..339ee71 100644 --- a/app/src/test/java/com/example/GreetingScreenshotTest.kt +++ b/app/src/test/java/com/example/GreetingScreenshotTest.kt @@ -2,7 +2,7 @@ package com.example import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onRoot -import com.example.ui.components.CargillLogo +import com.example.ui.components.AppLogo import com.example.ui.theme.MyApplicationTheme import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers import com.github.takahirom.roborazzi.captureRoboImage @@ -24,7 +24,7 @@ class GreetingScreenshotTest { fun greeting_screenshot() { composeTestRule.setContent { MyApplicationTheme { - CargillLogo() + AppLogo() } } diff --git a/documentacao/arquitetura/arquitetura_do_sistema.md b/documentacao/arquitetura/arquitetura_do_sistema.md index bd674db..dc13469 100644 --- a/documentacao/arquitetura/arquitetura_do_sistema.md +++ b/documentacao/arquitetura/arquitetura_do_sistema.md @@ -1,6 +1,6 @@ -# Documentação de Arquitetura do Sistema: Gestão de Manutenção (Cargill Parada OS) +# Documentação de Arquitetura do Sistema: Gestão de Manutenção (Gestão Parada OS) -Esta documentação descreve de forma abrangente a arquitetura de software, a estrutura de dados, o design da interface e os fluxos de sincronização do aplicativo Android de Gestão de Manutenção de Parada da Cargill. +Esta documentação descreve de forma abrangente a arquitetura de software, a estrutura de dados, o design da interface e os fluxos de sincronização do aplicativo Android de Gestão de Manutenção de Parada. O aplicativo foi projetado sob uma filosofia **offline-first** para atender a técnicos e inspetores que executam suas rotinas de manutenção em áreas industriais da planta com cobertura de rede instável ou inexistente. @@ -75,12 +75,12 @@ A estrutura do código fonte está localizada no pacote `com.example` e é organ * [`MaintenanceRepository.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/data/repository/MaintenanceRepository.kt): Mediador de dados, processamento de planilhas locais (CSV) e algoritmo central de reconciliação de estado. * `ui/` (Camada de Apresentação) * [`components/`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/components/) - * [`CargillLogo.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/components/CargillLogo.kt): Logotipo customizado desenhado via Canvas vetorial utilizando cores da marca. + * [`AppLogo.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/components/AppLogo.kt): Logotipo customizado desenhado via Canvas vetorial utilizando cores da marca. * [`screens/`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/screens/) * [`MaintenanceDashboardScreen.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/screens/MaintenanceDashboardScreen.kt): Tela única modularizada contendo o painel principal, listas, modais e logs de histórico. * [`theme/`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/theme/) - * [`Color.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/theme/Color.kt): Definição de cores (Cargill Green, Cargill Black, etc.). - * [`Theme.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/theme/Theme.kt): Configuração do `MyApplicationTheme` (Material3) desabilitando dynamic colors para preservar a marca Cargill. + * [`Color.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/theme/Color.kt): Definição de cores (BrandGreen, BrandBlack, etc.). + * [`Theme.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/theme/Theme.kt): Configuração do `MyApplicationTheme` (Material3) desabilitando dynamic colors para preservar a marca. * [`Type.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/theme/Type.kt): Configuração tipográfica padrão. * [`viewmodel/`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/viewmodel/) * [`MaintenanceViewModel.kt`](file:///home/cesarjhony/dev/projects/gestao_de_manutencao/app/src/main/java/com/example/ui/viewmodel/MaintenanceViewModel.kt): Gerenciador de estados reativos e fábrica de injeção manual. @@ -267,7 +267,7 @@ val filteredActivities: StateFlow> = combine( ### 7.2. Principais Composables da Tela 1. **`MaintenanceDashboardScreen` (Tela Central):** - * Configura o Scaffold principal com uma barra superior contendo o logotipo da Cargill vetorial (`CargillLogo`), status da conexão, botão de sincronização (`SyncNow`), dados do usuário autenticado e ferramenta de busca. + * Configura o Scaffold principal com uma barra superior contendo o logotipo vetorial (`AppLogo`), status da conexão, botão de sincronização (`SyncNow`), dados do usuário autenticado e ferramenta de busca. 2. **`DashboardMetrics` (Painel de Indicadores):** * Exibe cartões informativos atualizados dinamicamente: Total de OS, OS Não Iniciadas, Em Andamento e Concluídas. 3. **`FilterPillsRow` (Filtros Avançados):** @@ -286,12 +286,12 @@ val filteredActivities: StateFlow> = combine( ## 8. Decisões de Design de UI e Identidade Visual (Design System) -A interface de usuário foi desenhada de forma a respeitar a identidade corporativa da Cargill, garantindo legibilidade e uso ideal em campo. +A interface de usuário foi desenhada de forma a respeitar a identidade corporativa da marca, garantindo legibilidade e uso ideal em campo. * **Paleta de Cores Customizada:** - * `CargillGreen` (`#005F40`): Cor principal aplicada em botões chave, barras de título e destaques de progresso concluído. - * `CargillBlack` (`#1A1A1A`): Tom escuro predominante no fundo em modo escuro. - * `CargillLightGreen` (`#E8F5E9`): Utilizado como cor de fundo para badges e indicadores secundários. + * `BrandGreen` (`#005F40`): Cor principal aplicada em botões chave, barras de título e destaques de progresso concluído. + * `BrandBlack` (`#1A1A1A`): Tom escuro predominante no fundo em modo escuro. + * `BrandLightGreen` (`#E8F5E9`): Utilizado como cor de fundo para badges e indicadores secundários. * `LightGrey` (`#F5F7F6`): Fundo claro suave para o modo diurno. * **Componentes Premium M3:** * Uso de **Glassmorphism** sutil nos diálogos e cartões de lista. diff --git a/documentacao/design/descricao_layout_e_recursos.md b/documentacao/design/descricao_layout_e_recursos.md index 56392bd..4609747 100644 --- a/documentacao/design/descricao_layout_e_recursos.md +++ b/documentacao/design/descricao_layout_e_recursos.md @@ -1,6 +1,6 @@ # Especificação de Design e Recursos Visuais -Esta documentação descreve os recursos visuais e a estrutura de tela do aplicativo **Gestão de Manutenção (Cargill Parada OS)** baseando-se no layout atual de produção (conforme print do app em execução). +Esta documentação descreve os recursos visuais e a estrutura de tela do aplicativo **Gestão de Manutenção (Gestão Parada OS)** baseando-se no layout atual de produção (conforme print do app em execução). O objetivo deste documento é servir de guia detalhado para expandir a complexidade do aplicativo, adicionando novas telas, fluxos de navegação e componentes visuais mais robustos. @@ -8,11 +8,11 @@ O objetivo deste documento é servir de guia detalhado para expandir a complexid ## 1. Análise da Identidade Visual e Estilo (Design System) -O aplicativo utiliza um visual moderno que busca equilibrar a seriedade industrial com a identidade visual da marca Cargill. +O aplicativo utiliza um visual moderno que busca equilibrar a seriedade industrial com a identidade visual da marca. * **Paleta de Cores:** * **Fundo Geral:** Cinza neutro muito claro (`#F5F7F6` / `LightGrey`), reduzindo a fadiga visual sob luz solar em campo. - * **Cor Primária (Destaques da Marca):** Verde Cargill escuro (`#005F40`), utilizado no cabeçalho do usuário, botões de ação prioritários e nos chips selecionados. + * **Cor Primária (Destaques da Marca):** Verde escuro da marca (`#005F40`), utilizado no cabeçalho do usuário, botões de ação prioritários e nos chips selecionados. * **Cor Secundária (Textos e Títulos):** Preto carvão (`#1A1A1A`), oferecendo alto contraste para textos e números. * **Cores de Status (Feedback Visual):** * *Concluído/Sincronizado:* Verde folha (`#E8F5E9` para fundo, `#005F40` para ícone/texto). diff --git a/documentacao/fluxo_de_dados_e_sincronizacao.md b/documentacao/fluxo_de_dados_e_sincronizacao.md index 1145fe2..914e7e6 100644 --- a/documentacao/fluxo_de_dados_e_sincronizacao.md +++ b/documentacao/fluxo_de_dados_e_sincronizacao.md @@ -37,7 +37,7 @@ O aplicativo adota uma arquitetura **offline-first** (local prioritário) basead ### Como funciona o armazenamento? O armazenamento é realizado por meio do **Room Database**, que é uma camada de abstração sobre o **SQLite** nativo do Android. -* O arquivo do banco de dados local (`cargill_maintenance_db`) é salvo no diretório privado do aplicativo dentro do armazenamento interno do aparelho: `/data/data/com.example/databases/cargill_maintenance_db`. +* O arquivo do banco de dados local (`maintenance_db`) é salvo no diretório privado do aplicativo dentro do armazenamento interno do aparelho: `/data/data/com.example/databases/maintenance_db`. ### Múltiplos usuários conseguem acessar a mesma base de dados diretamente? **Não.** Por ser um banco de dados **local e interno ao dispositivo**, o arquivo SQLite é isolado e privado para a instância do aplicativo instalada naquele smartphone/tablet específico. diff --git a/documentacao/instalacao.md b/documentacao/instalacao.md index 1b9861a..300e75c 100644 --- a/documentacao/instalacao.md +++ b/documentacao/instalacao.md @@ -18,10 +18,11 @@ adb install -r app/build/outputs/apk/debug/app-debug.apk export JAVA_HOME="/home/cesarjhony/dev/projects/gestao_de_manutencao/jdk" export PATH="$JAVA_HOME/bin:$PATH" -./gradle_9_3_1/gradle-9.3.1/bin/gradle assembleDebug - - - +./gradle_9_3_1/gradle-9.3.1/bin/gradle clean assembleDebug --no-build-cache --no-configuration-cache --rerun-tasks +### Build Rápido (Incremental/Offline) +```bash JAVA_HOME="/home/cesarjhony/dev/projects/gestao_de_manutencao/jdk" ./gradle_9_3_1/gradle-9.3.1/bin/gradle :app:assembleDebug --offline +``` + diff --git a/documentacao/recursos_simulados_e_truncados.md b/documentacao/recursos_simulados_e_truncados.md index 90f1834..5340c30 100644 --- a/documentacao/recursos_simulados_e_truncados.md +++ b/documentacao/recursos_simulados_e_truncados.md @@ -1,6 +1,6 @@ # Listagem de Recursos Simulados e Truncados -Durante a análise técnica do código fonte do aplicativo de Gestão de Manutenção de Parada da Cargill, foram identificados recursos que possuem comportamento simulado (mockado) ou que foram implementados de forma parcial/truncada (stubs ou no-ops). +Durante a análise técnica do código fonte do aplicativo de Gestão de Manutenção de Parada, foram identificados recursos que possuem comportamento simulado (mockado) ou que foram implementados de forma parcial/truncada (stubs ou no-ops). Abaixo está o levantamento detalhado de cada um desses elementos, com suas respectivas localizações de arquivos e descrições técnicas. diff --git a/metadata.json b/metadata.json index 31c1c24..f10fb7d 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { - "name": "Cargill Parada OS", - "description": "Aplicativo offline-first para gestão de ordens de serviço durante paradas de manutenção industrial Cargill.", + "name": "Gestão Parada OS", + "description": "Aplicativo offline-first para gestão de ordens de serviço durante paradas de manutenção industrial.", "requestFramePermissions": [], "majorCapabilities": ["MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API"] }