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