mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 06:35:48 +03:00
fix code static analysis
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
1897034077
commit
5056428ea3
1 changed files with 12 additions and 7 deletions
|
@ -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)) {
|
||||||
|
|
Loading…
Reference in a new issue