Skip to content

Commit

Permalink
Merge pull request #1465 from novasamatech/rc/7.11.0
Browse files Browse the repository at this point in the history
Rc/7.11.0
  • Loading branch information
valentunn committed Apr 9, 2024
2 parents b259fe8 + 164b779 commit e06c338
Show file tree
Hide file tree
Showing 65 changed files with 7,598 additions and 268 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ on:
required: true
WALLET_CONNECT_PROJECT_ID:
required: true
DEBUG_GOOGLE_OAUTH_ID:
required: true
# Special secrets for signing:
CI_MARKET_KEYSTORE_PASS:
required: false
Expand Down Expand Up @@ -90,6 +92,7 @@ env:
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
DWELLIR_API_KEY: ${{ secrets.DWELLIR_API_KEY }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
DEBUG_GOOGLE_OAUTH_ID: ${{ secrets.DEBUG_GOOGLE_OAUTH_ID }}

CI_MARKET_KEYSTORE_PASS: ${{ secrets.CI_MARKET_KEYSTORE_PASS }}
CI_MARKET_KEYSTORE_KEY_ALIAS: ${{ secrets.CI_MARKET_KEYSTORE_KEY_ALIAS }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CrossChainTransfersIntegrationTest : BaseIntegrationTest() {
) {
runBlocking {
val originChain = chainRegistry.findChain { it.name == from }!!
val asssetInOrigin = originChain.assets.find { it.symbol == what }!!
val asssetInOrigin = originChain.assets.find { it.symbol.value == what }!!

val destinationChain = chainRegistry.findChain { it.name == to }!!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ class SwapServiceIntegrationTest : BaseIntegrationTest() {
}

private fun Chain.siri(): Chain.Asset {
return assets.first { it.symbol == "SIRI" }
return assets.first { it.symbol.value == "SIRI" }
}

private fun Chain.dot(): Chain.Asset {
return assets.first { it.symbol == "DOT" }
return assets.first { it.symbol.value == "DOT" }
}

private fun Chain.wnd(): Chain.Asset {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ class ProxyExtrinsicValidationRequestBusHandler(
call = { it.call },
chainWithAsset = { it.chainWithAsset },
proxyNotEnoughFee = { payload, availableBalance, fee ->
val asset = payload.chainWithAsset.asset
ProxiedExtrinsicValidationFailure.ProxyNotEnoughFee(
payload.proxyMetaAccount,
payload.chainWithAsset.asset,
availableBalance,
fee
metaAccount = payload.proxyMetaAccount,
asset = asset,
fee = fee.amount,
availableBalance = availableBalance
)
}
)
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 = '7.10.1'
versionCode = 128
versionName = '7.11.0'
versionCode = 129

applicationId = "io.novafoundation.nova"
releaseApplicationSuffix = "market"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class ContextManager private constructor(

val currentLanguage = if (prefs.getCurrentLanguage() == null) {
val currentLocale = Locale.getDefault()
if (languagesHolder.getLanguages().map { it.iso }.contains(currentLocale.language)) {
if (languagesHolder.getLanguages().map { it.iso639Code }.contains(currentLocale.language)) {
currentLocale.language
} else {
languagesHolder.getEnglishLang().iso
languagesHolder.getDefaultLanguage().iso639Code
}
} else {
prefs.getCurrentLanguage()!!.iso
prefs.getCurrentLanguage()!!.iso639Code
}

prefs.saveCurrentLanguage(currentLanguage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ import javax.inject.Singleton
class LanguagesHolder {

companion object {
private val RUSSIAN = Language("ru")

private val ENGLISH = Language("en")
private val CHINESE = Language("zh")
private val ITALIAN = Language("it")
private val PORTUGUESE = Language("pt")
private val RUSSIAN = Language("ru")
private val SPANISH = Language("es")
private val TURKISH = Language("tr")

private val availableLanguages = mutableListOf(RUSSIAN, ENGLISH)
private val availableLanguages = mutableListOf(ENGLISH, CHINESE, ITALIAN, PORTUGUESE, RUSSIAN, SPANISH, TURKISH)
}

fun getEnglishLang(): Language {
fun getDefaultLanguage(): Language {
return ENGLISH
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.novafoundation.nova.common.utils

import java.math.BigDecimal
import java.math.BigInteger

@JvmInline
value class Precision(val value: Int)

fun Int.asPrecision() = Precision(this)

fun BigDecimal.planksFromAmount(precision: Precision) = scaleByPowerOfTen(precision.value).toBigInteger()

fun BigInteger.amountFromPlanks(precision: Precision) = toBigDecimal(scale = precision.value)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.novafoundation.nova.common.utils

import io.novafoundation.nova.common.utils.formatting.format
import java.math.BigDecimal
import java.math.RoundingMode

@JvmInline
value class TokenSymbol(val value: String) {

override fun toString() = value
}

fun String.asTokenSymbol() = TokenSymbol(this)

fun BigDecimal.formatTokenAmount(tokenSymbol: TokenSymbol, roundingMode: RoundingMode = RoundingMode.FLOOR): String {
return format(roundingMode).withTokenSymbol(tokenSymbol)
}

fun String.withTokenSymbol(tokenSymbol: TokenSymbol): String {
return "$this ${tokenSymbol.value}"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package io.novafoundation.nova.common.utils.formatting

import android.graphics.Color
import android.text.method.LinkMovementMethod
import android.widget.TextView
import io.novafoundation.nova.common.R
import io.novafoundation.nova.common.utils.clickableSpan
import io.novafoundation.nova.common.utils.colorSpan
import io.novafoundation.nova.common.utils.formatting.spannable.SpannableFormatter
import io.novafoundation.nova.common.utils.setFullSpan
import io.novafoundation.nova.common.utils.toSpannable

fun TextView.applyTermsAndPrivacyPolicy(
containerResId: Int,
termsResId: Int,
privacyResId: Int,
termsClicked: () -> Unit,
privacyClicked: () -> Unit
) {
movementMethod = LinkMovementMethod.getInstance()
highlightColor = Color.TRANSPARENT
val linkColor = context.getColor(R.color.text_primary)

text = SpannableFormatter.format(
context.getString(containerResId),
context.getString(termsResId)
.toSpannable(clickableSpan(termsClicked))
.setFullSpan(colorSpan(linkColor)),
context.getString(privacyResId)
.toSpannable(clickableSpan(privacyClicked))
.setFullSpan(colorSpan(linkColor))
)
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class ParallaxCardBitmapBaking(private val context: Context, val lruCache: BackingParallaxCardLruCache) {
class ParallaxCardBitmapBaking(context: Context, val lruCache: BackingParallaxCardLruCache) {

private var callback: OnBakingPreparedCallback? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ open class ParallaxCardView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), ParallaxCardBitmapBaking.OnBakingPreparedCallback {

private val gyroscopeListener = CardGyroscopeListener(
context,
TravelVector(DEVICE_ROTATION_ANGLE_RADIUS, DEVICE_ROTATION_ANGLE_RADIUS),
::onGyroscopeRotation
)

private val frostedGlassLayer: FrostedGlassLayer = FrostedGlassLayer()
private val cardRect = RectF()
private val cardPath = Path()
Expand Down Expand Up @@ -61,6 +55,23 @@ open class ParallaxCardView @JvmOverloads constructor(

private val cardBackgroundBitmap: Bitmap

private var gyroscopeListenerCallback: ((TravelVector) -> Unit)? = { rotation: TravelVector ->
travelOffset = rotation

if (helper.isPrepared) {
updateHighlights()
updateFrostedGlassLayer()
}

invalidate()
}

private var gyroscopeListener: CardGyroscopeListener? = CardGyroscopeListener(
context,
TravelVector(DEVICE_ROTATION_ANGLE_RADIUS, DEVICE_ROTATION_ANGLE_RADIUS),
gyroscopeListenerCallback
)

init {
clipToPadding = false

Expand All @@ -82,14 +93,16 @@ open class ParallaxCardView @JvmOverloads constructor(
setWillNotDraw(false)

postDelayed({
gyroscopeListener.start()
gyroscopeListener?.start()
}, 300) // Added small delay to avoid wrong parallax initial position
}

override fun onViewRemoved(view: View?) {
super.onViewRemoved(view)
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
helper.onViewRemove()
gyroscopeListener.cancel()
gyroscopeListener?.cancel()
gyroscopeListener = null
gyroscopeListenerCallback = null
}

override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
Expand Down Expand Up @@ -162,17 +175,6 @@ open class ParallaxCardView @JvmOverloads constructor(
return LayoutParams(p)
}

private fun onGyroscopeRotation(rotation: TravelVector) {
travelOffset = rotation

if (helper.isPrepared) {
updateHighlights()
updateFrostedGlassLayer()
}

invalidate()
}

override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
canvas.clipPath(cardPath)
Expand Down
Loading

0 comments on commit e06c338

Please sign in to comment.