fix code static analysis

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-10-01 13:27:08 +02:00 committed by Alper Öztürk
parent 1897034077
commit 5056428ea3

View file

@ -73,12 +73,14 @@ fun AssistantScreen(viewModel: AssistantViewModel, activity: Activity) {
val pullRefreshState = rememberPullToRefreshState() val pullRefreshState = rememberPullToRefreshState()
@Suppress("MagicNumber") @Suppress("MagicNumber")
Box(modifier = Modifier.pullToRefresh(isRefreshing, pullRefreshState, onRefresh = { Box(
scope.launch { modifier = Modifier.pullToRefresh(isRefreshing, pullRefreshState, onRefresh = {
delay(1500) scope.launch {
viewModel.fetchTaskList() delay(1500)
} viewModel.fetchTaskList()
})) { }
})
) {
if (state == AssistantViewModel.State.Loading || isRefreshing) { if (state == AssistantViewModel.State.Loading || isRefreshing) {
CenterText(text = stringResource(id = R.string.assistant_screen_loading)) CenterText(text = stringResource(id = R.string.assistant_screen_loading))
} else { } else {
@ -101,7 +103,10 @@ fun AssistantScreen(viewModel: AssistantViewModel, activity: Activity) {
if (isRefreshing) { if (isRefreshing) {
LinearProgressIndicator(modifier = Modifier.fillMaxWidth()) LinearProgressIndicator(modifier = Modifier.fillMaxWidth())
} else { } else {
LinearProgressIndicator(progress = { pullRefreshState.distanceFraction }, modifier = Modifier.fillMaxWidth()) LinearProgressIndicator(
progress = { pullRefreshState.distanceFraction },
modifier = Modifier.fillMaxWidth()
)
} }
if (selectedTaskType?.name != stringResource(id = R.string.assistant_screen_all_task_type)) { if (selectedTaskType?.name != stringResource(id = R.string.assistant_screen_all_task_type)) {