Skip to content

Commit

Permalink
Merge pull request #1632 from novasamatech/rc/8.5.0
Browse files Browse the repository at this point in the history
Rc/8.5.0
  • Loading branch information
valentunn authored Aug 14, 2024
2 parents 2d31159 + fd714f0 commit f710307
Show file tree
Hide file tree
Showing 26 changed files with 246 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ concurrency:
jobs:
build-app:
name: Build app and test
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout particualr branch
Expand Down
13 changes: 12 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@

<activity
android:name="io.novafoundation.nova.app.root.presentation.RootActivity"
android:configChanges="orientation|screenSize"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.NovaFoundation.Nova"
android:windowSoftInputMode="adjustResize">

Expand Down Expand Up @@ -110,6 +110,17 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="app.novawallet.io" />
</intent-filter>
</activity>

<activity
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
// App version
versionName = '8.4.0'
versionCode = 152
versionName = '8.5.0'
versionCode = 153

applicationId = "io.novafoundation.nova"
releaseApplicationSuffix = "market"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.novafoundation.nova.common.utils.formatting.spannable

import android.content.Context
import android.text.SpannedString
import androidx.annotation.StringRes
import io.novafoundation.nova.common.resources.ResourceManager
import io.novafoundation.nova.common.utils.formatting.spannable.SpannableFormatter.fill
import java.util.regex.Pattern

Expand Down Expand Up @@ -68,13 +65,3 @@ object SpannableFormatter {
fun result(): CharSequence
}
}

fun SpannableFormatter.format(resourceManager: ResourceManager, @StringRes resId: Int, vararg args: Any): SpannedString {
val format = resourceManager.getString(resId)
return format(format, *args)
}

fun SpannableFormatter.format(context: Context, @StringRes resId: Int, vararg args: Any): SpannedString {
val format = context.getString(resId)
return format(format, *args)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
package io.novafoundation.nova.common.utils.formatting.spannable

import android.content.Context
import android.text.SpannedString
import androidx.annotation.StringRes
import io.novafoundation.nova.common.R
import io.novafoundation.nova.common.resources.ResourceManager
import io.novafoundation.nova.common.utils.colorSpan
import io.novafoundation.nova.common.utils.toSpannable

fun CharSequence.spannableFormatting(vararg args: Any): CharSequence {
return SpannableFormatter.format(this, *args)
}

fun SpannableFormatter.format(resourceManager: ResourceManager, @StringRes resId: Int, vararg args: Any): SpannedString {
val format = resourceManager.getString(resId)
return format(format, *args)
}

fun SpannableFormatter.format(context: Context, @StringRes resId: Int, vararg args: Any): SpannedString {
val format = context.getString(resId)
return format(format, *args)
}

fun Context.highlightedText(mainRes: Int, vararg highlightedRes: Int): SpannedString {
val highlighted = highlightedRes.map {
getString(it).toSpannable(colorSpan(getColor(R.color.text_primary)))
}.toTypedArray()

return SpannableFormatter.format(this, mainRes, *highlighted)
}

fun ResourceManager.highlightedText(mainRes: Int, vararg highlightedRes: Int): SpannedString {
val highlighted = highlightedRes.map {
getString(it).toSpannable(colorSpan(getColor(R.color.text_primary)))
}.toTypedArray()

return SpannableFormatter.format(this, mainRes, *highlighted)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.LinearLayout
import androidx.core.content.res.getResourceIdOrThrow
import io.novafoundation.nova.common.R
import io.novafoundation.nova.common.utils.getResourceIdOrNull
import io.novafoundation.nova.common.utils.useAttributes
import kotlinx.android.synthetic.main.view_instruction_step.view.instructionStepIndicator
import kotlinx.android.synthetic.main.view_instruction_step.view.instructionStepText
Expand Down Expand Up @@ -37,7 +37,7 @@ class InstructionStepView @JvmOverloads constructor(
instructionStepIndicator.text = stepNumber

// use getResourceId() instead of getString() since resources might contain spans which will be lost if getString() is used
val stepText = it.getResourceIdOrThrow(R.styleable.InstructionStepView_stepText)
instructionStepText.setText(stepText)
val stepText = it.getResourceIdOrNull(R.styleable.InstructionStepView_stepText)
stepText?.let { instructionStepText.setText(it) }
}
}
65 changes: 48 additions & 17 deletions common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyEllipsis">

<!--<string name="account_ledger_generic_import_start_step_1">Make sure <font color='#FFFFFF'>Generic app is installed</font> to your Ledger device using Ledger Live app</string>-->
<string name="account_ledger_generic_import_start_step_1">Make sure %s to your Ledger device using Ledger Live app</string>
<string name="account_ledger_generic_import_start_step_1_highlighted">Generic app is installed</string>

<!--<string name="account_ledger_generic_import_start_step_2"><font color='#FFFFFF'>Open the Generic app</font> on your Ledger device</string>-->
<string name="account_ledger_generic_import_start_step_2">%s on your Ledger device</string>
<string name="account_ledger_generic_import_start_step_2_highlighted">Open the Generic app</string>

<!--<string name="account_ledger_import_start_step_3">Allow Nova Wallet to <font color='#FFFFFF'>access Bluetooth and Location</font></string>-->
<string name="account_ledger_import_start_step_3">Allow Nova Wallet to %s</string>
<string name="account_ledger_import_start_step_3_highlighted">access Bluetooth and Location</string>

<!--<string name="account_ledger_import_start_step_4"><font color='#FFFFFF'>Select account</font> to add to wallet</string>-->
<string name="account_ledger_import_start_step_4">%s to add to wallet</string>
<string name="account_ledger_import_start_step_4_highlighted">Select account</string>

<!--<string name="account_polkadot_vault_import_start_step_3">Polkadot Vault will provide you <font color='#FFFFFF'>QR code to scan</font></string>-->
<string name="account_polkadot_vault_import_start_step_3">Polkadot Vault will provide you %s</string>
<string name="account_polkadot_vault_import_start_step_3_highlighted">QR code to scan</string>

<!--<string name="account_polkadot_vault_import_start_step_2"><font color='#FFFFFF'>Go to “Key Sets” tab.</font> Select your Key set, Network, and then the account you would like to add to Nova Wallet</string>-->
<string name="account_polkadot_vault_import_start_step_2">%s Select your Key set, Network, and then the account you would like to add to Nova Wallet</string>
<string name="account_polkadot_vault_import_start_step_2_highlighted">Go to “Key Sets” tab.</string>

<!--<string name="account_polkadot_vault_import_start_step_1"><font color='#FFFFFF'>Open Polkadot Vault</font> application on your smartphone</string>-->
<string name="account_polkadot_vault_import_start_step_1">%s application on your smartphone</string>
<string name="account_polkadot_vault_import_start_step_1_highlighted">Open Polkadot Vault</string>

<!--<string name="account_ledger_import_start_step_2"><font color='#FFFFFF'>Open the network app</font> on your Ledger device</string>-->
<string name="account_ledger_import_start_step_2">%s on your Ledger device</string>
<string name="account_ledger_import_start_step_2_highlighted">Open the network app</string>

<!--<string name="account_ledger_import_start_step_1">Make sure <font color='#FFFFFF'>Network app is installed</font> to your Ledger device using Ledger Live app</string>-->
<string name="account_ledger_import_start_step_1">Make sure %s to your Ledger device using Ledger Live app</string>
<string name="account_ledger_import_start_step_1_highlighted">Network app is installed</string>

<!--<string name="account_parity_signer_import_start_step_3">Parity Signer will provide you <font color='#FFFFFF'>QR code to scan</font></string>-->
<string name="account_parity_signer_import_start_step_3">Parity Signer will provide you %s</string>
<string name="account_parity_signer_import_start_step_3_highlighted">QR code to scan</string>

<!--<string name="account_parity_signer_import_start_step_2"><font color='#FFFFFF'>Go to “Keys” tab. Select seed, then account</font> you would like to add to Nova Wallet</string>-->
<string name="account_parity_signer_import_start_step_2">%s you would like to add to Nova Wallet</string>
<string name="account_parity_signer_import_start_step_2_highlighted">Go to “Keys” tab. Select seed, then account</string>

<!--<string name="account_parity_signer_import_start_step_1"><font color='#FFFFFF'>Open Parity Signer</font> application on your smartphone</string>-->
<string name="account_parity_signer_import_start_step_1">%s application on your smartphone</string>
<string name="account_parity_signer_import_start_step_1_highlighted">Open Parity Signer</string>

<string name="setup_referendum_vote_conviction_info">Conviction will be set to 0.1x when you vote Abstain</string>

<string name="referendum_abstain_voters_title">Abstain votes</string>
Expand All @@ -25,9 +73,6 @@
<string name="account_ledger_migration_app">Polkadot Migration</string>
<string name="account_ledger_migration_generic">Polkadot</string>

<string name="account_ledger_generic_import_start_step_1">Make sure <font color='#FFFFFF'>Generic app is installed</font> to your Ledger device using Ledger Live app</string>
<string name="account_ledger_generic_import_start_step_2"><font color='#FFFFFF'>Open the Generic app</font> on your Ledger device</string>

<string name="account_ledger_legacy_warning_title">New Ledger app has been released</string>
<string name="account_ledger_legacy_warning_message">To sign operations and migrate your accounts to the new Generic Ledger app install and open Migration app. Legacy Old and Migration Ledger apps will not be supported in the future.</string>

Expand Down Expand Up @@ -811,10 +856,6 @@
<string name="account_parity_signer_chain_not_supported">%s doesn’t support %s</string>

<string name="account_polkadot_vault_import_start_empty_derivation_hint">Pay attention, the derivation path name should be empty</string>
<string name="account_polkadot_vault_import_start_step_3">Polkadot Vault will provide you <font color='#FFFFFF'>QR code to scan</font></string>
<string name="account_polkadot_vault_import_start_step_2"><font color='#FFFFFF'>Go to “Key Sets” tab.</font> Select your Key set, Network, and then the account you would like to add to Nova Wallet</string>
<string name="account_polkadot_vault_import_start_step_1"><font color='#FFFFFF'>Open Polkadot Vault</font> application on your smartphone</string>


<string name="account_parity_signer">Parity Signer</string>
<string name="account_polkadot_vault">Polkadot Vault</string>
Expand Down Expand Up @@ -962,8 +1003,6 @@

<string name="common_no_app_to_handle_intent">No suitable app found on device to handle this intent</string>

<string name="account_ledger_import_start_step_3">Allow Nova Wallet to <font color='#FFFFFF'>access Bluetooth and Location</font></string>

<string name="select_ledger_location_enable_request_title">Please enable geo-location in device settings</string>
<string name="select_ledger_location_enable_request_message">Nova needs location to be enabled to be able to perform bluetooth scanning to find your Ledger device</string>

Expand Down Expand Up @@ -1403,10 +1442,6 @@
<string name="account_ledger_import_start_title">Connect Ledger Nano X</string>
<string name="account_ledger_import_start_guide">Ledger’s official Bluetooth Connection Guide</string>

<string name="account_ledger_import_start_step_4"><font color='#FFFFFF'>Select account</font> to add to wallet</string>
<string name="account_ledger_import_start_step_2"><font color='#FFFFFF'>Open the network app</font> on your Ledger device</string>
<string name="account_ledger_import_start_step_1">Make sure <font color='#FFFFFF'>Network app is installed</font> to your Ledger device using Ledger Live app</string>

<string name="common_total">Total</string>

<string name="wallet_currency_title">Currency</string>
Expand Down Expand Up @@ -1442,10 +1477,6 @@
<string name="common_to_settings">Open Settings</string>

<string name="account_parity_signer_import_start_select_top">Make sure to select top one</string>
<string name="account_parity_signer_import_start_step_3">Parity Signer will provide you <font color='#FFFFFF'>QR code to scan</font></string>
<string name="account_parity_signer_import_start_step_2"><font color='#FFFFFF'>Go to “Keys” tab. Select seed, then account</font> you would like to add to Nova Wallet</string>
<string name="account_parity_signer_import_start_step_1"><font color='#FFFFFF'>Open Parity Signer</font> application on your smartphone</string>

<string name="account_delete_confirmation_description">Make sure you have exported your wallet before proceeding.</string>
<string name="account_delete_confirmation_title">Forget wallet?</string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ interface PolkadotVaultVariantConfigBuilder {

fun step(@StringRes contentRes: Int)

fun step(content: CharSequence)

fun image(@StringRes labelRes: Int, @DrawableRes imageRes: Int)
}
}
Expand Down Expand Up @@ -118,21 +120,21 @@ private class RealInstructionsBuilder(

override fun step(contentRes: Int) {
val content = resourceManager.getText(contentRes)
addStep(content)
}

override fun image(labelRes: Int, imageRes: Int) {
val imageInstruction = Instruction.Image(resourceManager.getString(labelRes), imageRes)
instructions.add(imageInstruction)
step(content)
}

private fun addStep(content: CharSequence) {
override fun step(content: CharSequence) {
stepsCounter += 1

val stepInstruction = Instruction.Step(stepsCounter, content)
instructions.add(stepInstruction)
}

override fun image(labelRes: Int, imageRes: Int) {
val imageInstruction = Instruction.Image(resourceManager.getString(labelRes), imageRes)
instructions.add(imageInstruction)
}

fun build(): List<Instruction> {
require(instructions.isNotEmpty())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.novafoundation.nova.feature_account_impl.presentation.paritySigner.co

import io.novafoundation.nova.common.data.network.AppLinksProvider
import io.novafoundation.nova.common.resources.ResourceManager
import io.novafoundation.nova.common.utils.formatting.spannable.highlightedText
import io.novafoundation.nova.feature_account_api.presenatation.account.polkadotVault.config.PolkadotVaultVariantConfig
import io.novafoundation.nova.feature_account_impl.R
import io.novafoundation.nova.feature_account_impl.presentation.paritySigner.config.BuildPolkadotVaultVariantConfig
Expand All @@ -14,12 +15,27 @@ internal fun ParitySignerConfig(resourceManager: ResourceManager, appLinksProvid

connect {
instructions {
step(R.string.account_parity_signer_import_start_step_1)
step(
resourceManager.highlightedText(
R.string.account_parity_signer_import_start_step_1,
R.string.account_parity_signer_import_start_step_1_highlighted
)
)

step(R.string.account_parity_signer_import_start_step_2)
step(
resourceManager.highlightedText(
R.string.account_parity_signer_import_start_step_2,
R.string.account_parity_signer_import_start_step_2_highlighted
)
)
image(R.string.account_parity_signer_import_start_select_top, R.drawable.my_parity_signer)

step(R.string.account_parity_signer_import_start_step_3)
step(
resourceManager.highlightedText(
R.string.account_parity_signer_import_start_step_3,
R.string.account_parity_signer_import_start_step_3_highlighted
)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.novafoundation.nova.feature_account_impl.presentation.paritySigner.co

import io.novafoundation.nova.common.data.network.AppLinksProvider
import io.novafoundation.nova.common.resources.ResourceManager
import io.novafoundation.nova.common.utils.formatting.spannable.highlightedText
import io.novafoundation.nova.feature_account_api.presenatation.account.polkadotVault.config.PolkadotVaultVariantConfig
import io.novafoundation.nova.feature_account_impl.R
import io.novafoundation.nova.feature_account_impl.presentation.paritySigner.config.BuildPolkadotVaultVariantConfig
Expand All @@ -14,12 +15,27 @@ internal fun PolkadotVaultConfig(resourceManager: ResourceManager, appLinksProvi

connect {
instructions {
step(R.string.account_polkadot_vault_import_start_step_1)
step(
resourceManager.highlightedText(
R.string.account_polkadot_vault_import_start_step_1,
R.string.account_polkadot_vault_import_start_step_1_highlighted
)
)

step(R.string.account_polkadot_vault_import_start_step_2)
step(
resourceManager.highlightedText(
R.string.account_polkadot_vault_import_start_step_2,
R.string.account_polkadot_vault_import_start_step_2_highlighted
)
)
image(R.string.account_polkadot_vault_import_start_empty_derivation_hint, R.drawable.polkadot_vault_account)

step(R.string.account_polkadot_vault_import_start_step_3)
step(
resourceManager.highlightedText(
R.string.account_polkadot_vault_import_start_step_3,
R.string.account_polkadot_vault_import_start_step_3_highlighted
)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.novafoundation.nova.feature_deep_linking.di

import io.novafoundation.nova.app.root.presentation.deepLinks.handlers.AssetDetailsDeepLinkHandler
import io.novafoundation.nova.feature_deep_linking.presentation.handling.handlers.AssetDetailsDeepLinkHandler
import io.novafoundation.nova.feature_deep_linking.presentation.handling.handlers.ReferendumDeepLinkHandler
import io.novafoundation.nova.feature_deep_linking.presentation.handling.RootDeepLinkHandler

Expand Down
Loading

0 comments on commit f710307

Please sign in to comment.