Skip to content

Commit

Permalink
[#1338] Redesign Update-Available screen
Browse files Browse the repository at this point in the history
- Closes  #1338
- Changelog update
  • Loading branch information
HonzaR committed May 7, 2024
1 parent b235e0c commit a97b71d
Show file tree
Hide file tree
Showing 14 changed files with 217 additions and 75 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ directly impact users rather than highlighting other key architectural updates.*

### Changed
- We've improved the visibility logic of the little loader that is part of the Balances widget
- The App-Update screen UI has been reworked to align with the latest design guidelines

### Removed
- Concatenation of the messages on a multi-messages transaction has been removed and will be addressed using a new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ abstract class PublishToGooglePlay @Inject constructor(
track,
Track().setReleases(
listOf(TrackRelease()
// TODO [#1440]: Provide a way to inject in-app-update information
// TODO [#1440]: https://github.com/Electric-Coin-Company/zashi-android/issues/1440
.setName(versionName)
.setVersionCodes(bundleVersionCodes)
.setStatus(status)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ ANDROIDX_CAMERA_VERSION=1.3.2
ANDROIDX_COMPOSE_COMPILER_VERSION=1.5.11
ANDROIDX_COMPOSE_MATERIAL3_VERSION=1.2.1
ANDROIDX_COMPOSE_MATERIAL_ICONS_VERSION=1.6.5
ANDROIDX_COMPOSE_VERSION=1.6.5
ANDROIDX_COMPOSE_VERSION=1.6.6
ANDROIDX_CONSTRAINTLAYOUT_VERSION=1.0.1
ANDROIDX_CORE_VERSION=1.12.0
ANDROIDX_ESPRESSO_VERSION=3.5.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ fun Reference(
fontWeight: FontWeight = FontWeight.SemiBold,
textAlign: TextAlign = TextAlign.Center,
textStyle: TextStyle = ZcashTheme.typography.primary.bodyLarge,
color: Color = ZcashTheme.colors.reference,
imageVector: ImageVector? = null,
imageContentDescription: String? = null
) {
Expand All @@ -303,7 +304,7 @@ fun Reference(
style =
textStyle.merge(
TextStyle(
color = ZcashTheme.colors.reference,
color = color,
textAlign = textAlign,
textDecoration = TextDecoration.Underline,
fontWeight = fontWeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data class ExtendedColors(
val textFieldWarning: Color,
val textFieldFrame: Color,
val textDescription: Color,
val textDescriptionDark: Color,
val textPending: Color,
val layoutStroke: Color,
val overlay: Color,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ internal object Dark {
val textFieldWarning = Color(0xFFF40202)
val textFieldHint = Color(0xFFB7B7B7)
val textDescription = Color(0xFF777777)
val textDescriptionDark = Color(0xFF4D4D4D)
val textProgress = Color(0xFF8B8A8A)

val aboutTextColor = Color(0xFF4E4E4E)
Expand Down Expand Up @@ -98,6 +99,7 @@ internal object Light {
val textFieldHint = Color(0xFFB7B7B7)
val textChipIndex = Color(0xFFEE8592)
val textDescription = Color(0xFF777777)
val textDescriptionDark = Color(0xFF4D4D4D)
val textProgress = Color(0xFF8B8A8A)

val screenTitleColor = Color(0xFF040404)
Expand Down Expand Up @@ -191,6 +193,7 @@ internal val DarkExtendedColorPalette =
textFieldWarning = Dark.textFieldWarning,
textFieldHint = Dark.textFieldHint,
textDescription = Dark.textDescription,
textDescriptionDark = Dark.textDescriptionDark,
textPending = Dark.textProgress,
layoutStroke = Dark.layoutStroke,
overlay = Dark.overlay,
Expand Down Expand Up @@ -240,6 +243,7 @@ internal val LightExtendedColorPalette =
textFieldWarning = Light.textFieldWarning,
textFieldHint = Light.textFieldHint,
textDescription = Light.textDescription,
textDescriptionDark = Light.textDescriptionDark,
textPending = Light.textProgress,
layoutStroke = Light.layoutStroke,
overlay = Light.overlay,
Expand Down Expand Up @@ -291,6 +295,7 @@ internal val LocalExtendedColors =
textFieldWarning = Color.Unspecified,
textFieldFrame = Color.Unspecified,
textDescription = Color.Unspecified,
textDescriptionDark = Color.Unspecified,
textPending = Color.Unspecified,
layoutStroke = Color.Unspecified,
overlay = Color.Unspecified,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ data class ExtendedTypography(
val transactionItemStyles: TransactionItemTextStyles,
val restoringTopAppBarStyle: TextStyle,
val deleteWalletWarnStyle: TextStyle,
val updateTitleStyle: TextStyle,
)

@Suppress("CompositionLocalAllowlist")
Expand Down Expand Up @@ -377,6 +378,10 @@ val LocalExtendedTypography =
deleteWalletWarnStyle =
PrimaryTypography.bodyLarge.copy(
fontWeight = FontWeight.Bold
),
updateTitleStyle =
PrimaryTypography.titleLarge.copy(
fontWeight = FontWeight.Bold
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import co.electriccoin.zcash.test.UiTestPrerequisites
import co.electriccoin.zcash.ui.fixture.UpdateInfoFixture
import co.electriccoin.zcash.ui.integration.test.common.IntegrationTestingActivity
import co.electriccoin.zcash.ui.screen.update.AppUpdateChecker
import co.electriccoin.zcash.ui.screen.update.AppUpdateCheckerMock
import co.electriccoin.zcash.ui.screen.update.model.UpdateInfo
import co.electriccoin.zcash.ui.screen.update.model.UpdateState
import co.electriccoin.zcash.ui.screen.update.viewmodel.UpdateViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.onRoot
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performScrollTo
import androidx.test.filters.MediumTest
import co.electriccoin.zcash.test.UiTestPrerequisites
import co.electriccoin.zcash.ui.R
Expand Down Expand Up @@ -147,6 +148,7 @@ class UpdateViewTest : UiTestPrerequisites() {

composeTestRule.onNodeWithText(getStringResource(R.string.update_link_text)).also {
it.assertExists()
it.performScrollTo()
it.performClick()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package co.electriccoin.zcash.ui.integration.test.screen.update.viewmodel
package co.electriccoin.zcash.ui.screen.update

import android.app.Activity
import android.content.Context
import androidx.activity.ComponentActivity
import co.electriccoin.zcash.spackle.getPackageInfoCompat
import co.electriccoin.zcash.spackle.versionCodeCompat
import co.electriccoin.zcash.ui.fixture.UpdateInfoFixture
import co.electriccoin.zcash.ui.screen.update.AppUpdateChecker
import co.electriccoin.zcash.ui.screen.update.model.UpdateInfo
import co.electriccoin.zcash.ui.screen.update.model.UpdateState
import com.google.android.play.core.appupdate.AppUpdateInfo
Expand All @@ -26,13 +25,13 @@ class AppUpdateCheckerMock private constructor() : AppUpdateChecker {

fun new() = AppUpdateCheckerMock()

// used mostly for tests
// Used mostly for tests
val resultUpdateInfo =
UpdateInfoFixture.new(
appUpdateInfo = null,
state = UpdateState.Prepared,
priority = AppUpdateChecker.Priority.HIGH,
force = true
priority = AppUpdateChecker.Priority.LOW,
force = false
)
}

Expand All @@ -52,7 +51,7 @@ class AppUpdateCheckerMock private constructor() : AppUpdateChecker {

val appUpdateInfoTask = fakeAppUpdateManager.appUpdateInfo

// to simulate a real-world situation
// To simulate a real-world situation
delay(100.milliseconds)

appUpdateInfoTask.addOnCompleteListener { infoTask ->
Expand Down Expand Up @@ -83,8 +82,8 @@ class AppUpdateCheckerMock private constructor() : AppUpdateChecker {
appUpdateInfo: AppUpdateInfo
): Flow<Int> =
flow {
// to simulate a real-world situation
delay(100.milliseconds)
// To simulate a real-world situation
delay(2000.milliseconds)
emit(Activity.RESULT_OK)
}
}

0 comments on commit a97b71d

Please sign in to comment.