Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71fc0879 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Have cancel button in queued state have accent outline as well

parent 40b0d833
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ private fun buildDefaultBlockedLabel(app: Application): ButtonLabel {

private fun buildStyleFor(status: Status, enabled: Boolean): InstallButtonStyle {
    return when {
        status == Status.QUEUED || status == Status.AWAITING -> InstallButtonStyle.Disabled
        status == Status.QUEUED -> InstallButtonStyle.Disabled
        status == Status.INSTALLED || status == Status.UPDATABLE -> {
            if (enabled) InstallButtonStyle.AccentFill else InstallButtonStyle.Disabled
        }
+0 −10
Original line number Diff line number Diff line
@@ -215,16 +215,6 @@ class InstallButtonStateMapperTest {
        assertTrue(state.enabled)
    }

    @Test
    fun awaiting_maps_to_disabled_style() {
        val state = mapAppToInstallState(
            input = defaultInput(app = baseApp(Status.AWAITING)),
        )
        assertEquals(R.string.cancel, state.label.resId)
        assertEquals(InstallButtonStyle.Disabled, state.style)
        assertTrue(state.enabled)
    }

    @Test
    fun downloading_progress_below_zero_uses_cancel_label() {
        val state = mapAppToInstallState(