mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 03:12:15 +00:00
Remove: Unneeded isIndeterminate in Cancelable
This commit is contained in:
parent
11c7197feb
commit
0e6affa96d
@ -96,17 +96,15 @@ sealed interface PackageState {
|
||||
|
||||
sealed class Cancelable(
|
||||
@StringRes override val textId: Int,
|
||||
override val icon: ImageVector = Icons.Rounded.Close,
|
||||
val isIndeterminate: Boolean
|
||||
override val icon: ImageVector = Icons.Rounded.Close
|
||||
) : PackageState
|
||||
|
||||
object Pending : Cancelable(R.string.pending, isIndeterminate = true)
|
||||
object Connecting : Cancelable(R.string.connecting, isIndeterminate = true)
|
||||
class Downloading(downloaded: Long, total: Long?) :
|
||||
Cancelable(R.string.downloading, isIndeterminate = true)
|
||||
object Pending : Cancelable(R.string.pending)
|
||||
object Connecting : Cancelable(R.string.connecting)
|
||||
class Downloading(val downloaded: Long, val total: Long?) :
|
||||
Cancelable(R.string.downloading)
|
||||
|
||||
class Installing(isIndeterminate: Boolean) :
|
||||
Cancelable(R.string.installing, isIndeterminate = isIndeterminate)
|
||||
object Installing : Cancelable(R.string.installing)
|
||||
|
||||
sealed class ButtonWork(
|
||||
@StringRes override val textId: Int,
|
||||
|
@ -27,6 +27,7 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.looker.droidify.R
|
||||
import com.looker.droidify.entity.Cancelable
|
||||
import com.looker.droidify.entity.Downloading
|
||||
import com.looker.droidify.entity.Install
|
||||
import com.looker.droidify.entity.PackageState
|
||||
import com.looker.droidify.ui.compose.components.MainActionButton
|
||||
@ -121,7 +122,7 @@ fun TopBarHeader(
|
||||
DownloadProgress(
|
||||
modifier = Modifier.padding(horizontal = 12.dp),
|
||||
totalSize = 69420,
|
||||
isIndeterminate = if (state is Cancelable) state.isIndeterminate else true
|
||||
isIndeterminate = state !is Downloading,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user