|
@@ -1,27 +1,22 @@
|
|
|
/*
|
|
|
* Nextcloud - Android Client
|
|
|
*
|
|
|
- * SPDX-FileCopyrightText: 2024 Alper Ozturk <alper_ozturk@proton.me>
|
|
|
- * SPDX-FileCopyrightText: 2024 Nextcloud GmbH
|
|
|
+ * SPDX-FileCopyrightText: 2024 Your Name <your@email.com>
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
*/
|
|
|
-package com.nextcloud.client.assistant.component
|
|
|
+package com.nextcloud.client.assistant.task
|
|
|
|
|
|
import androidx.compose.animation.animateContentSize
|
|
|
import androidx.compose.animation.core.Spring
|
|
|
import androidx.compose.animation.core.spring
|
|
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
|
|
-import androidx.compose.foundation.Image
|
|
|
import androidx.compose.foundation.background
|
|
|
import androidx.compose.foundation.combinedClickable
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
-import androidx.compose.foundation.layout.Row
|
|
|
import androidx.compose.foundation.layout.Spacer
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
-import androidx.compose.foundation.layout.size
|
|
|
-import androidx.compose.foundation.layout.width
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
import androidx.compose.material3.HorizontalDivider
|
|
|
import androidx.compose.material3.MaterialTheme
|
|
@@ -31,18 +26,13 @@ import androidx.compose.runtime.getValue
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
|
import androidx.compose.runtime.remember
|
|
|
import androidx.compose.runtime.setValue
|
|
|
-import androidx.compose.ui.Alignment
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.draw.clip
|
|
|
import androidx.compose.ui.graphics.Color
|
|
|
-import androidx.compose.ui.graphics.ColorFilter
|
|
|
-import androidx.compose.ui.res.painterResource
|
|
|
-import androidx.compose.ui.res.stringResource
|
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
import androidx.compose.ui.unit.sp
|
|
|
-import com.nextcloud.client.assistant.extensions.statusData
|
|
|
-import com.nextcloud.client.assistant.taskDetail.TaskDetailScreen
|
|
|
+import com.nextcloud.client.assistant.taskDetail.TaskDetailBottomSheet
|
|
|
import com.nextcloud.ui.composeComponents.bottomSheet.MoreActionsBottomSheet
|
|
|
import com.nextcloud.utils.extensions.getRandomString
|
|
|
import com.owncloud.android.R
|
|
@@ -100,25 +90,7 @@ fun TaskView(
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- Row(
|
|
|
- modifier = Modifier
|
|
|
- .fillMaxWidth()
|
|
|
- .padding(vertical = 16.dp),
|
|
|
- verticalAlignment = Alignment.CenterVertically
|
|
|
- ) {
|
|
|
- val (iconId, descriptionId) = task.statusData()
|
|
|
-
|
|
|
- Image(
|
|
|
- painter = painterResource(id = iconId),
|
|
|
- modifier = Modifier.size(16.dp),
|
|
|
- colorFilter = ColorFilter.tint(Color.White),
|
|
|
- contentDescription = "status icon"
|
|
|
- )
|
|
|
-
|
|
|
- Spacer(modifier = Modifier.width(6.dp))
|
|
|
-
|
|
|
- Text(text = stringResource(id = descriptionId), color = Color.White)
|
|
|
- }
|
|
|
+ TaskStatus(task, foregroundColor = Color.White)
|
|
|
|
|
|
if (showMoreActionsBottomSheet) {
|
|
|
val bottomSheetAction = listOf(
|
|
@@ -138,12 +110,8 @@ fun TaskView(
|
|
|
}
|
|
|
|
|
|
if (showTaskDetailBottomSheet) {
|
|
|
- task.input?.let { input ->
|
|
|
- task.output?.let { output ->
|
|
|
- TaskDetailScreen(input, output) {
|
|
|
- showTaskDetailBottomSheet = false
|
|
|
- }
|
|
|
- }
|
|
|
+ TaskDetailBottomSheet(task) {
|
|
|
+ showTaskDetailBottomSheet = false
|
|
|
}
|
|
|
}
|
|
|
}
|