|
@@ -21,7 +21,6 @@
|
|
|
|
|
|
package com.nextcloud.client.assistant.component
|
|
|
|
|
|
-import android.annotation.SuppressLint
|
|
|
import androidx.compose.animation.animateContentSize
|
|
|
import androidx.compose.animation.core.Spring
|
|
|
import androidx.compose.animation.core.spring
|
|
@@ -34,9 +33,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
+import androidx.compose.material3.HorizontalDivider
|
|
|
import androidx.compose.material3.Text
|
|
|
import androidx.compose.runtime.Composable
|
|
|
-import androidx.compose.runtime.collectAsState
|
|
|
import androidx.compose.runtime.getValue
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
|
import androidx.compose.runtime.remember
|
|
@@ -47,58 +46,54 @@ import androidx.compose.ui.graphics.Color
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
-import com.nextcloud.ui.composeActivity.ComposeActivity.Companion.schemeFlow
|
|
|
+import com.nextcloud.ui.composeActivity.ComposeActivity.Companion.colorScheme
|
|
|
import com.nextcloud.ui.composeComponents.bottomSheet.MoreActionsBottomSheet
|
|
|
import com.owncloud.android.R
|
|
|
import com.owncloud.android.lib.resources.assistant.model.Task
|
|
|
|
|
|
@OptIn(ExperimentalFoundationApi::class)
|
|
|
-@SuppressLint("ResourceAsColor")
|
|
|
@Suppress("LongMethod", "MagicNumber")
|
|
|
@Composable
|
|
|
fun TaskView(
|
|
|
task: Task,
|
|
|
showDeleteTaskAlertDialog: (Long) -> Unit
|
|
|
) {
|
|
|
- val scheme = schemeFlow.collectAsState().value
|
|
|
var expanded by remember { mutableStateOf(false) }
|
|
|
var showMoreActionsBottomSheet by remember { mutableStateOf(false) }
|
|
|
|
|
|
- // TODO Check color
|
|
|
Column(
|
|
|
modifier = Modifier
|
|
|
.fillMaxWidth()
|
|
|
.clip(RoundedCornerShape(16.dp))
|
|
|
- .background(scheme.primary)
|
|
|
+ .background(colorScheme.primary)
|
|
|
.combinedClickable(onClick = {
|
|
|
expanded = !expanded
|
|
|
}, onLongClick = {
|
|
|
showMoreActionsBottomSheet = true
|
|
|
})
|
|
|
+ .padding(start = 8.dp)
|
|
|
) {
|
|
|
Spacer(modifier = Modifier.height(8.dp))
|
|
|
|
|
|
Text(
|
|
|
text = stringResource(id = R.string.assistant_screen_task_view_input),
|
|
|
- modifier = Modifier.padding(4.dp),
|
|
|
color = Color.White
|
|
|
)
|
|
|
|
|
|
task.input?.let {
|
|
|
Text(
|
|
|
text = it,
|
|
|
- modifier = Modifier.padding(4.dp),
|
|
|
color = Color.White
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- Spacer(modifier = Modifier.height(16.dp))
|
|
|
+ Spacer(modifier = Modifier.height(4.dp))
|
|
|
+ HorizontalDivider()
|
|
|
+ Spacer(modifier = Modifier.height(4.dp))
|
|
|
|
|
|
Text(
|
|
|
text = stringResource(id = R.string.assistant_screen_task_view_output),
|
|
|
color = Color.White,
|
|
|
- modifier = Modifier
|
|
|
- .padding(4.dp)
|
|
|
)
|
|
|
|
|
|
task.output?.let {
|
|
@@ -112,7 +107,6 @@ fun TaskView(
|
|
|
stiffness = Spring.StiffnessLow
|
|
|
)
|
|
|
)
|
|
|
- .padding(4.dp)
|
|
|
)
|
|
|
}
|
|
|
|