Skip to content

Commit

Permalink
Update libraries to latest
Browse files Browse the repository at this point in the history
- Setup compile SDK to 35
- Gradle to 8.9
  • Loading branch information
rafaelekol committed Nov 22, 2024
1 parent 26aa956 commit 4c66a62
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 55 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ dependencies {
implementation "androidx.core:core-splashscreen:1.0.1"

//AppWidgets
implementation 'androidx.glance:glance-appwidget:1.0.0'
implementation 'androidx.glance:glance-appwidget:1.1.1'

// Room
def room_version = '2.6.1'
Expand Down Expand Up @@ -271,7 +271,7 @@ dependencies {
implementation("io.github.alexzhirkevich:qrose:1.0.1")

// WorkManager Kotlin
def work_version = "2.9.0"
def work_version = "2.10.0"
implementation "androidx.work:work-runtime-ktx:$work_version"
// WorkManager RxJava2 support
implementation "androidx.work:work-rxjava2:$work_version"
Expand Down Expand Up @@ -309,8 +309,8 @@ dependencies {

implementation 'com.twitter.twittertext:twitter-text:3.1.0'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-rx2:1.8.1'

// UI modules

Expand All @@ -319,7 +319,7 @@ dependencies {
implementation project(':components:chartview')

// Integration with activities
implementation 'androidx.activity:activity-compose:1.9.0'
implementation 'androidx.activity:activity-compose:1.9.3'
// Compose Material Design
implementation "androidx.compose.material:material:$compose_version"
// Animations
Expand All @@ -333,7 +333,7 @@ dependencies {

implementation "androidx.compose.runtime:runtime-livedata:$compose_version"

def coil_version = "2.5.0"
def coil_version = "2.6.0"
implementation "io.coil-kt:coil-compose:$coil_version"
implementation "io.coil-kt:coil-svg:$coil_version"
implementation("io.coil-kt:coil-gif:$coil_version")
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/io/horizontalsystems/bankwallet/core/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -545,18 +545,18 @@ class App : CoreApp(), WorkConfiguration.Provider, ImageLoaderFactory {
).signingInfo

when {
signingInfo.hasMultipleSigners() -> signingInfo.apkContentsSigners // Send all with apkContentsSigners
else -> signingInfo.signingCertificateHistory // Send one with signingCertificateHistory
signingInfo?.hasMultipleSigners() == true -> signingInfo.apkContentsSigners // Send all with apkContentsSigners
else -> signingInfo?.signingCertificateHistory // Send one with signingCertificateHistory
}
} else {
packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES).signatures
}

signatureList.map {
signatureList?.map {
val digest = MessageDigest.getInstance("SHA")
digest.update(it.toByteArray())
digest.digest()
}
} ?: emptyList()
} catch (e: Exception) {
// Handle error
emptyList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlinx.coroutines.delay
fun BackupAlert(navController: NavController) {
val viewModel = viewModel<BackupAlertViewModel>()

LifecycleResumeEffect {
LifecycleResumeEffect(Unit) {
viewModel.resume()

onPauseOrDispose {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.horizontalsystems.bankwallet.modules.market.overview.ui

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.PageSize
Expand All @@ -11,15 +10,14 @@ import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp

@Composable
@OptIn(ExperimentalFoundationApi::class)
fun MarketsHorizontalCards(
pageCount: Int,
pageContent: @Composable() (PagerScope.(page: Int) -> Unit)
) {
val pagerState = rememberPagerState(pageCount = { pageCount })
HorizontalPager(
state = pagerState,
beyondBoundsPageCount = 1,
beyondViewportPageCount = 1,
pageSize = object : PageSize {
override fun Density.calculateMainAxisPageSize(
availableSpace: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private fun ScannerView(onScan: (String) -> Unit) {
}
}
AndroidView(factory = { barcodeView })
LifecycleResumeEffect {
LifecycleResumeEffect(Unit) {
barcodeView.resume()

onPauseOrDispose {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun SendBinanceConfirmationScreen(
var confirmationData by remember { mutableStateOf(sendViewModel.getConfirmationData()) }
var refresh by remember { mutableStateOf(false) }

LifecycleResumeEffect {
LifecycleResumeEffect(Unit) {
if (refresh) {
confirmationData = sendViewModel.getConfirmationData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun SendBitcoinConfirmationScreen(
var confirmationData by remember { mutableStateOf(sendViewModel.getConfirmationData()) }
var refresh by remember { mutableStateOf(false) }

LifecycleResumeEffect {
LifecycleResumeEffect(Unit) {
if (refresh) {
confirmationData = sendViewModel.getConfirmationData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun SendSolanaConfirmationScreen(
var confirmationData by remember { mutableStateOf(sendViewModel.getConfirmationData()) }
var refresh by remember { mutableStateOf(false) }

LifecycleResumeEffect {
LifecycleResumeEffect(Unit) {
if (refresh) {
confirmationData = sendViewModel.getConfirmationData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun SendTonConfirmationScreen(
var confirmationData by remember { mutableStateOf(sendViewModel.getConfirmationData()) }
var refresh by remember { mutableStateOf(false) }

LifecycleResumeEffect {
LifecycleResumeEffect(Unit) {
if (refresh) {
confirmationData = sendViewModel.getConfirmationData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun SendZCashConfirmationScreen(
var confirmationData by remember { mutableStateOf(sendViewModel.getConfirmationData()) }
var refresh by remember { mutableStateOf(false) }

LifecycleResumeEffect {
LifecycleResumeEffect(Unit) {
if (refresh) {
confirmationData = sendViewModel.getConfirmationData()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.horizontalsystems.bankwallet.ui.compose

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.MaterialTheme
import androidx.compose.material.RippleConfiguration
import androidx.compose.material.ripple.RippleAlpha
import androidx.compose.material.ripple.RippleTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.compositionLocalOf
Expand Down Expand Up @@ -67,23 +68,11 @@ fun ComposeAppTheme(

}

object AppRippleTheme : RippleTheme {
// Here you should return the ripple color you want
// and not use the defaultRippleColor extension on RippleTheme.
// Using that will override the ripple color set in DarkMode
// or when you set light parameter to false
@Composable
override fun defaultColor(): Color = RippleTheme.defaultRippleColor(
if (isSystemInDarkTheme()) Color.White else Color.Black,
lightTheme = true
)
private val MyRippleAlpha = RippleAlpha(0.5f, 0.5f, 0.5f, 0.5f)

@Composable
override fun rippleAlpha(): RippleAlpha = RippleTheme.defaultRippleAlpha(
Color.Black,
lightTheme = true
)
}
@OptIn(ExperimentalMaterialApi::class)
val MyRippleConfiguration =
RippleConfiguration(color = Color.Black, rippleAlpha = MyRippleAlpha)

object ComposeAppTheme {
val colors: Colors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.material.*
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -140,7 +139,7 @@ fun RowScope.HsBottomNavigationItem(
// The color of the Ripple should always the selected color, as we want to show the color
// before the item is considered selected, and hence before the new contentColor is
// provided by BottomNavigationTransition.
val ripple = rememberRipple(bounded = false, color = selectedContentColor)
val ripple = ripple(bounded = false, color = selectedContentColor)

Box(
modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.material.ContentAlpha
import androidx.compose.material.Icon
import androidx.compose.material.LocalContentAlpha
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.material.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.remember
Expand Down Expand Up @@ -38,7 +38,7 @@ fun HsIconButton(
enabled = enabled,
role = Role.Button,
interactionSource = interactionSource,
indication = rememberRipple(bounded = false, radius = RippleRadius, color = rippleColor)
indication = ripple(bounded = false, radius = RippleRadius, color = rippleColor)
),
contentAlignment = Alignment.Center
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package io.horizontalsystems.bankwallet.ui.compose.components

import androidx.compose.foundation.layout.RowScope
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.LocalRippleConfiguration
import androidx.compose.material.TextButton
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import io.horizontalsystems.bankwallet.ui.compose.AppRippleTheme
import io.horizontalsystems.bankwallet.ui.compose.MyRippleConfiguration

@OptIn(ExperimentalMaterialApi::class)
@Composable
fun HsTextButton(
onClick: () -> Unit,
content: @Composable RowScope.() -> Unit
) {
CompositionLocalProvider(LocalRippleTheme provides AppRippleTheme) {
CompositionLocalProvider(LocalRippleConfiguration provides MyRippleConfiguration) {
TextButton(
onClick = onClick
) {
Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

buildscript {
ext {
compile_sdk_version = 34
compile_sdk_version = 35
min_sdk_version = 27
lifecycle_version = '2.7.0'
lifecycle_version = '2.8.7'

compose_version = '1.6.7'
compose_version = '1.7.5'
kotlin_version = '1.9.23'
material_version = "1.12.0"
appcompat_version = "1.6.1"
constraint_version = "2.1.4"
core_ktx_version = "1.13.1"
fragment_ktx_version = "1.7.0"
navigation_ktx_version = "2.7.7"
appcompat_version = "1.7.0"
constraint_version = "2.2.0"
core_ktx_version = "1.15.0"
fragment_ktx_version = "1.8.5"
navigation_ktx_version = "2.8.4"
rxjava_version = "2.2.19"
biometric_version = "1.1.0"
junit_version = "4.13.2"
Expand All @@ -25,7 +25,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.4.0'
classpath 'com.android.tools.build:gradle:8.7.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion components/chartview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ dependencies {
implementation "androidx.constraintlayout:constraintlayout:$constraint_version"
implementation "androidx.core:core-ktx:$core_ktx_version"

implementation "androidx.compose.runtime:runtime:1.3.2"
implementation "androidx.compose.runtime:runtime:1.7.5"
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Oct 10 12:47:09 KGT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 4c66a62

Please sign in to comment.