parent
ea3fc5a076
commit
2b3e3b7618
@ -1,36 +1,44 @@ |
||||
package io.legado.app.ui.book.arrange |
||||
|
||||
import androidx.compose.foundation.layout.Column |
||||
import androidx.compose.material.AlertDialog |
||||
import androidx.compose.material.LinearProgressIndicator |
||||
import androidx.compose.material.Text |
||||
import androidx.compose.material.TextButton |
||||
import androidx.compose.runtime.Composable |
||||
import androidx.compose.runtime.MutableState |
||||
import androidx.compose.runtime.mutableStateOf |
||||
import androidx.compose.runtime.remember |
||||
import androidx.compose.ui.Alignment |
||||
import io.legado.app.R |
||||
import splitties.init.appCtx |
||||
|
||||
|
||||
@Composable |
||||
fun BatchChangeSourceDialog(state: MutableState<Boolean>) { |
||||
val value = remember { |
||||
mutableStateOf(0) |
||||
} |
||||
fun BatchChangeSourceDialog( |
||||
state: MutableState<Boolean>, |
||||
size: MutableState<Int>, |
||||
position: MutableState<Int>, |
||||
cancel: () -> Unit |
||||
) { |
||||
if (state.value) { |
||||
AlertDialog( |
||||
onDismissRequest = { }, |
||||
confirmButton = { |
||||
TextButton(onClick = { |
||||
cancel.invoke() |
||||
state.value = false |
||||
}, content = { |
||||
Text(text = "取消") |
||||
}) |
||||
}, |
||||
title = { |
||||
Text(text = appCtx.getString(R.string.book_change_source)) |
||||
Text(text = appCtx.getString(R.string.change_source_batch)) |
||||
}, |
||||
text = { |
||||
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally) { |
||||
Text(text = "${position.value}/${size.value}") |
||||
LinearProgressIndicator( |
||||
progress = position.value / size.value.toFloat() |
||||
) |
||||
} |
||||
} |
||||
) |
||||
} |
||||
|
Loading…
Reference in new issue