Loading app/src/main/java/foundation/e/apps/ui/compose/state/InstallButtonStateMapper.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 } Loading app/src/test/java/foundation/e/apps/ui/compose/state/InstallButtonStateMapperTest.kt +0 −10 Original line number Diff line number Diff line Loading @@ -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( Loading Loading
app/src/main/java/foundation/e/apps/ui/compose/state/InstallButtonStateMapper.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 } Loading
app/src/test/java/foundation/e/apps/ui/compose/state/InstallButtonStateMapperTest.kt +0 −10 Original line number Diff line number Diff line Loading @@ -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( Loading