button on feed not visible when task is checked
This commit is contained in:
		
							parent
							
								
									529adbcab3
								
							
						
					
					
						commit
						6a560fee79
					
				
					 4 changed files with 24 additions and 10 deletions
				
			
		|  | @ -20,6 +20,7 @@ import androidx.compose.material.icons.filled.Add | ||||||
| import androidx.compose.runtime.Composable | import androidx.compose.runtime.Composable | ||||||
| import androidx.compose.ui.Alignment | import androidx.compose.ui.Alignment | ||||||
| import androidx.compose.ui.Modifier | import androidx.compose.ui.Modifier | ||||||
|  | import androidx.compose.ui.draw.scale | ||||||
| import androidx.compose.ui.graphics.Color | import androidx.compose.ui.graphics.Color | ||||||
| import androidx.compose.ui.res.stringResource | import androidx.compose.ui.res.stringResource | ||||||
| import androidx.compose.ui.tooling.preview.Preview | import androidx.compose.ui.tooling.preview.Preview | ||||||
|  | @ -84,7 +85,7 @@ fun StealthButton( | ||||||
|             backgroundColor = MaterialTheme.colors.surface, |             backgroundColor = MaterialTheme.colors.surface, | ||||||
|             contentColor = MaterialTheme.colors.onSurface.copy(alpha = 0.4f) |             contentColor = MaterialTheme.colors.onSurface.copy(alpha = 0.4f) | ||||||
|         ), |         ), | ||||||
|         border = BorderStroke(3.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.4f)) |         border = BorderStroke(2.dp, MaterialTheme.colors.onSurface.copy(alpha = 0.4f)) | ||||||
|     ) |     ) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,7 +4,10 @@ import androidx.compose.foundation.background | ||||||
| import androidx.compose.foundation.layout.* | import androidx.compose.foundation.layout.* | ||||||
| import androidx.compose.foundation.shape.CircleShape | import androidx.compose.foundation.shape.CircleShape | ||||||
| import androidx.compose.material.Card | import androidx.compose.material.Card | ||||||
|  | import androidx.compose.material.Icon | ||||||
| import androidx.compose.material.Text | import androidx.compose.material.Text | ||||||
|  | import androidx.compose.material.icons.Icons | ||||||
|  | import androidx.compose.material.icons.filled.Info | ||||||
| import androidx.compose.runtime.Composable | import androidx.compose.runtime.Composable | ||||||
| import androidx.compose.ui.Alignment | import androidx.compose.ui.Alignment | ||||||
| import androidx.compose.ui.Modifier | import androidx.compose.ui.Modifier | ||||||
|  | @ -16,6 +19,7 @@ import androidx.compose.ui.tooling.preview.Preview | ||||||
| import androidx.compose.ui.unit.dp | import androidx.compose.ui.unit.dp | ||||||
| import be.ugent.sel.studeez.R | import be.ugent.sel.studeez.R | ||||||
| import be.ugent.sel.studeez.common.composable.StealthButton | import be.ugent.sel.studeez.common.composable.StealthButton | ||||||
|  | import be.ugent.sel.studeez.common.ext.fieldModifier | ||||||
| import be.ugent.sel.studeez.data.local.models.FeedEntry | import be.ugent.sel.studeez.data.local.models.FeedEntry | ||||||
| import be.ugent.sel.studeez.data.local.models.timer_functional.HoursMinutesSeconds | import be.ugent.sel.studeez.data.local.models.timer_functional.HoursMinutesSeconds | ||||||
| 
 | 
 | ||||||
|  | @ -69,13 +73,20 @@ fun FeedEntry( | ||||||
|                     Text(text = HoursMinutesSeconds(feedEntry.totalStudyTime).toString()) |                     Text(text = HoursMinutesSeconds(feedEntry.totalStudyTime).toString()) | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             StealthButton( |             if (!feedEntry.isArchived) { | ||||||
|                 text = R.string.continue_task, |                 StealthButton( | ||||||
|                 modifier = Modifier |                     text = R.string.continue_task, | ||||||
|                     .padding(start = 10.dp, end = 5.dp) |                     modifier = Modifier | ||||||
|                     .weight(6f) |                         .padding(start = 10.dp, end = 5.dp) | ||||||
|             ) { |                         .weight(6f) | ||||||
|                 continueWithTask() |                 ) { | ||||||
|  |                     continueWithTask() | ||||||
|  |                 } | ||||||
|  |             } else { | ||||||
|  |                 Row { | ||||||
|  |                     Icon(imageVector = Icons.Default.Info, contentDescription = null) | ||||||
|  |                     Text(text = "Deleted", modifier = Modifier.padding(horizontal = 5.dp)) | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -9,5 +9,6 @@ data class FeedEntry( | ||||||
|     val taskId: String = "", // Name of task is not unique |     val taskId: String = "", // Name of task is not unique | ||||||
|     val subjectId: String = "", |     val subjectId: String = "", | ||||||
|     val totalStudyTime: Int = 0, |     val totalStudyTime: Int = 0, | ||||||
|     val endTime: Timestamp = Timestamp(0, 0) |     val endTime: Timestamp = Timestamp(0, 0), | ||||||
|  |     val isArchived: Boolean = false | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | @ -72,7 +72,8 @@ class FirebaseFeedDAO @Inject constructor( | ||||||
|             taskId = task.id, |             taskId = task.id, | ||||||
|             subjectId = subject.id, |             subjectId = subject.id, | ||||||
|             totalStudyTime = sessionReport.studyTime, |             totalStudyTime = sessionReport.studyTime, | ||||||
|             endTime = sessionReport.endTime |             endTime = sessionReport.endTime, | ||||||
|  |             isArchived = task.completed | ||||||
|         ) |         ) | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Reference in a new issue
	
	 lbarraga
						lbarraga