diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/coin/CoinFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/coin/CoinFragment.kt index 8c6ae16ed07..ecc1081688a 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/coin/CoinFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/coin/CoinFragment.kt @@ -31,16 +31,7 @@ class CoinFragment : BaseComposeFragment() { @Composable override fun GetContent(navController: NavController) { - val uid = try { - activity?.intent?.data?.getQueryParameter("uid") - } catch (e: UnsupportedOperationException) { - null - } - - val coinUid = requireArguments().getString(COIN_UID_KEY, uid ?: "") - if (uid != null) { - activity?.intent?.data = null - } + val coinUid = requireArguments().getString(COIN_UID_KEY, "") CoinScreen( coinUid, diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/launcher/LaunchViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/launcher/LaunchViewModel.kt index cfb78bc7f2a..1a9afe93ba8 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/launcher/LaunchViewModel.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/launcher/LaunchViewModel.kt @@ -13,9 +13,8 @@ class LaunchViewModel( private val pinComponent: IPinComponent, private val systemInfoManager: ISystemInfoManager, private val keyStoreManager: IKeyStoreManager, - private val localStorage: ILocalStorage + localStorage: ILocalStorage ) : ViewModel() { - val torEnabled by localStorage::torEnabled private val mainShowedOnce = localStorage.mainShowedOnce diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt index a315ac9cdcc..ad16f65e05d 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainFragment.kt @@ -1,5 +1,6 @@ package io.horizontalsystems.bankwallet.modules.main +import android.net.Uri import android.os.Bundle import androidx.activity.OnBackPressedCallback import androidx.activity.compose.BackHandler @@ -62,24 +63,27 @@ import io.horizontalsystems.bankwallet.ui.compose.DisposableLifecycleCallbacks import io.horizontalsystems.bankwallet.ui.compose.components.HsBottomNavigation import io.horizontalsystems.bankwallet.ui.compose.components.HsBottomNavigationItem import io.horizontalsystems.bankwallet.ui.extensions.WalletSwitchBottomSheet +import kotlinx.coroutines.delay import kotlinx.coroutines.launch class MainFragment : BaseComposeFragment() { private val transactionsViewModel by navGraphViewModels(R.id.mainFragment) { TransactionsModule.Factory() } + private var intentUri: Uri? = null @Composable override fun GetContent(navController: NavController) { MainScreenWithRootedDeviceCheck( transactionsViewModel = transactionsViewModel, - deepLink = activity?.intent?.data?.toString(), + deepLink = intentUri, navController = navController, - clearActivityData = { activity?.intent?.data = null } ) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + intentUri = activity?.intent?.data + activity?.intent?.data = null //clear intent data requireActivity().onBackPressedDispatcher.addCallback( this, @@ -95,15 +99,14 @@ class MainFragment : BaseComposeFragment() { @Composable private fun MainScreenWithRootedDeviceCheck( transactionsViewModel: TransactionsViewModel, - deepLink: String?, + deepLink: Uri?, navController: NavController, - clearActivityData: () -> Unit, rootedDeviceViewModel: RootedDeviceViewModel = viewModel(factory = RootedDeviceModule.Factory()) ) { if (rootedDeviceViewModel.showRootedDeviceWarning) { RootedDeviceScreen { rootedDeviceViewModel.ignoreRootedDeviceWarning() } } else { - MainScreen(transactionsViewModel, deepLink, navController, clearActivityData) + MainScreen(transactionsViewModel, deepLink, navController) } } @@ -111,14 +114,13 @@ private fun MainScreenWithRootedDeviceCheck( @Composable private fun MainScreen( transactionsViewModel: TransactionsViewModel, - deepLink: String?, + deepLink: Uri?, fragmentNavController: NavController, - clearActivityData: () -> Unit, viewModel: MainViewModel = viewModel(factory = MainModule.Factory(deepLink)) ) { val uiState = viewModel.uiState - val selectedPage = uiState.selectedPageIndex + val selectedPage = uiState.selectedTabIndex val pagerState = rememberPagerState(initialPage = selectedPage) { uiState.mainNavItems.size } val coroutineScope = rememberCoroutineScope() @@ -242,17 +244,11 @@ private fun MainScreen( if (uiState.wcSupportState != null) { when (val wcSupportState = uiState.wcSupportState) { - SupportState.Supported -> { - fragmentNavController.slideFromRight(R.id.wallet_connect_graph) - } - SupportState.NotSupportedDueToNoActiveAccount -> { - clearActivityData.invoke() fragmentNavController.slideFromBottom(R.id.wcErrorNoAccountFragment) } is SupportState.NotSupportedDueToNonBackedUpAccount -> { - clearActivityData.invoke() val text = stringResource(R.string.WalletConnect_Error_NeedBackup) fragmentNavController.slideFromBottom( R.id.backupRequiredDialog, @@ -261,18 +257,28 @@ private fun MainScreen( } is SupportState.NotSupported -> { - clearActivityData.invoke() fragmentNavController.slideFromBottom( R.id.wcAccountTypeNotSupportedDialog, WCAccountTypeNotSupportedDialog.prepareParams(wcSupportState.accountTypeDescription) ) } - null -> {} + else -> {} } viewModel.wcSupportStateHandled() } + uiState.deeplinkPage?.let { deepLinkPage -> + LaunchedEffect(Unit) { + delay(500) + fragmentNavController.slideFromRight( + deepLinkPage.navigationId, + deepLinkPage.bundle + ) + viewModel.deeplinkPageHandled() + } + } + DisposableLifecycleCallbacks( onResume = viewModel::onResume, ) diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainModule.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainModule.kt index 6b4ad24d4ac..377097449e0 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainModule.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainModule.kt @@ -4,6 +4,7 @@ import android.app.Activity import android.content.Context import android.content.Intent import android.net.Uri +import android.os.Bundle import android.os.Parcelable import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider @@ -15,7 +16,7 @@ import kotlinx.parcelize.Parcelize object MainModule { - class Factory(private val wcDeepLink: String?) : ViewModelProvider.Factory { + class Factory(private val wcDeepLink: Uri?) : ViewModelProvider.Factory { @Suppress("UNCHECKED_CAST") override fun create(modelClass: Class): T { return MainViewModel( @@ -74,7 +75,8 @@ object MainModule { } data class UiState( - val selectedPageIndex: Int, + val selectedTabIndex: Int, + val deeplinkPage: DeeplinkPage?, val mainNavItems: List, val showRateAppDialog: Boolean, val contentHidden: Boolean, @@ -84,3 +86,8 @@ object MainModule { val wcSupportState: WC2Manager.SupportState? ) } + +data class DeeplinkPage( + val navigationId: Int, + val bundle: Bundle? = null +) diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt index 348dec0ee45..a79c4731312 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/main/MainViewModel.kt @@ -1,11 +1,13 @@ package io.horizontalsystems.bankwallet.modules.main +import android.net.Uri import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import cash.z.ecc.android.sdk.ext.collectWith +import io.horizontalsystems.bankwallet.R import io.horizontalsystems.bankwallet.core.IAccountManager import io.horizontalsystems.bankwallet.core.IBackupManager import io.horizontalsystems.bankwallet.core.ILocalStorage @@ -16,7 +18,12 @@ import io.horizontalsystems.bankwallet.core.managers.ReleaseNotesManager import io.horizontalsystems.bankwallet.entities.Account import io.horizontalsystems.bankwallet.entities.AccountType import io.horizontalsystems.bankwallet.entities.LaunchPage +import io.horizontalsystems.bankwallet.modules.coin.CoinFragment import io.horizontalsystems.bankwallet.modules.main.MainModule.MainNavigation +import io.horizontalsystems.bankwallet.modules.market.platform.MarketPlatformFragment +import io.horizontalsystems.bankwallet.modules.market.topplatforms.Platform +import io.horizontalsystems.bankwallet.modules.nft.collection.NftCollectionFragment +import io.horizontalsystems.bankwallet.modules.walletconnect.list.WCListFragment import io.horizontalsystems.bankwallet.modules.walletconnect.version2.WC2Manager import io.horizontalsystems.bankwallet.modules.walletconnect.version2.WC2SessionManager import io.horizontalsystems.core.IPinComponent @@ -33,8 +40,8 @@ class MainViewModel( private val releaseNotesManager: ReleaseNotesManager, private val localStorage: ILocalStorage, wc2SessionManager: WC2SessionManager, - wc2Manager: WC2Manager, - private val wcDeepLink: String? + private val wc2Manager: WC2Manager, + deepLink: Uri? ) : ViewModel() { private val disposables = CompositeDisposable() @@ -45,8 +52,8 @@ class MainViewModel( private val launchPage: LaunchPage get() = localStorage.launchPage ?: LaunchPage.Auto - private var currentMainTab: MainNavigation? - get() = localStorage.mainTab + private var currentMainTab: MainNavigation + get() = localStorage.mainTab ?: MainNavigation.Balance set(value) { localStorage.mainTab = value } @@ -73,7 +80,8 @@ class MainViewModel( ) } - private var selectedPageIndex = getPageIndexToOpen() + private var selectedTabIndex = getTabIndexToOpen(deepLink) + private var deeplinkPage: DeeplinkPage? = null private var mainNavItems = navigationItems() private var showRateAppDialog = false private var contentHidden = pinComponent.isLocked @@ -90,7 +98,8 @@ class MainViewModel( var uiState by mutableStateOf( MainModule.UiState( - selectedPageIndex = selectedPageIndex, + selectedTabIndex = selectedTabIndex, + deeplinkPage = deeplinkPage, mainNavItems = mainNavItems, showRateAppDialog = showRateAppDialog, contentHidden = contentHidden, @@ -143,11 +152,6 @@ class MainViewModel( } } - wcDeepLink?.let { - wcSupportState = wc2Manager.getWalletConnectSupportState() - syncState() - } - accountManager.activeAccountStateFlow.collectWith(viewModelScope) { (it as? ActiveAccountState.ActiveAccount)?.let { state -> activeWallet = state.account @@ -193,7 +197,7 @@ class MainViewModel( if (mainNavItem != MainNavigation.Settings) { currentMainTab = mainNavItem } - selectedPageIndex = items.indexOf(mainNavItem) + selectedTabIndex = items.indexOf(mainNavItem) syncNavigation() } @@ -209,7 +213,8 @@ class MainViewModel( private fun syncState() { uiState = MainModule.UiState( - selectedPageIndex = selectedPageIndex, + selectedTabIndex = selectedTabIndex, + deeplinkPage = deeplinkPage, mainNavItems = mainNavItems, showRateAppDialog = showRateAppDialog, contentHidden = contentHidden, @@ -222,7 +227,7 @@ class MainViewModel( private fun navigationItems(): List { return items.mapIndexed { index, mainNavItem -> - getNavItem(mainNavItem, index == selectedPageIndex) + getNavItem(mainNavItem, index == selectedTabIndex) } } @@ -234,6 +239,7 @@ class MainViewModel( enabled = true, ) } + MainNavigation.Transactions -> { MainModule.NavigationViewItem( mainNavItem = item, @@ -241,6 +247,7 @@ class MainViewModel( enabled = transactionsEnabled, ) } + MainNavigation.Settings -> { MainModule.NavigationViewItem( mainNavItem = item, @@ -249,6 +256,7 @@ class MainViewModel( badge = settingsBadge ) } + MainNavigation.Balance -> { MainModule.NavigationViewItem( mainNavItem = item, @@ -258,32 +266,88 @@ class MainViewModel( } } - private fun getPageIndexToOpen(): Int { - val page = when { - wcDeepLink != null -> { - MainNavigation.Settings - } + private fun getTabIndexToOpen(deepLink: Uri? = null): Int { + deepLink?.let { + val (tab, deeplinkPageData) = getNavigationDataForDeeplink(it) + deeplinkPage = deeplinkPageData + currentMainTab = tab + return items.indexOf(tab) + } + + val tab = when { relaunchBySettingChange -> { relaunchBySettingChange = false MainNavigation.Settings } + !marketsTabEnabled -> { MainNavigation.Balance } - else -> when (launchPage) { - LaunchPage.Market, - LaunchPage.Watchlist -> MainNavigation.Market - LaunchPage.Balance -> MainNavigation.Balance - LaunchPage.Auto -> currentMainTab ?: MainNavigation.Balance + + else -> getLaunchTab() + } + + return items.indexOf(tab) + } + + private fun getLaunchTab(): MainNavigation = when (launchPage) { + LaunchPage.Market, + LaunchPage.Watchlist -> MainNavigation.Market + + LaunchPage.Balance -> MainNavigation.Balance + LaunchPage.Auto -> currentMainTab + } + + private fun getNavigationDataForDeeplink(deepLink: Uri): Pair { + var tab = currentMainTab + var deeplinkPage: DeeplinkPage? = null + val deeplinkString = deepLink.toString() + when { + deeplinkString.startsWith("unstoppable:") -> { + val uid = deepLink.getQueryParameter("uid") + when { + deeplinkString.contains("coin-page") -> { + uid?.let { + deeplinkPage = DeeplinkPage(R.id.coinFragment, CoinFragment.prepareParams(it)) + } + } + + deeplinkString.contains("nft-collection") -> { + val blockchainTypeUid = deepLink.getQueryParameter("blockchainTypeUid") + if (uid != null && blockchainTypeUid != null) { + deeplinkPage = DeeplinkPage(R.id.nftCollectionFragment, NftCollectionFragment.prepareParams(uid, blockchainTypeUid)) + } + } + + deeplinkString.contains("top-platforms") -> { + val title = deepLink.getQueryParameter("title") + if (title != null && uid != null) { + val platform = Platform(uid, title) + deeplinkPage = DeeplinkPage(R.id.marketPlatformFragment, MarketPlatformFragment.prepareParams(platform)) + } + } + } + + tab = MainNavigation.Market + } + + deeplinkString.startsWith("wc:") -> { + wcSupportState = wc2Manager.getWalletConnectSupportState() + if (wcSupportState == WC2Manager.SupportState.Supported) { + deeplinkPage = DeeplinkPage(R.id.wallet_connect_graph, WCListFragment.prepareParams(deeplinkString)) + tab = MainNavigation.Settings + } } + + else -> {} } - return items.indexOf(page) + return Pair(tab, deeplinkPage) } private fun syncNavigation() { mainNavItems = navigationItems() - if (selectedPageIndex >= mainNavItems.size) { - selectedPageIndex = mainNavItems.size - 1 + if (selectedTabIndex >= mainNavItems.size) { + selectedTabIndex = mainNavItems.size - 1 } syncState() } @@ -312,4 +376,9 @@ class MainViewModel( syncNavigation() } + fun deeplinkPageHandled() { + deeplinkPage = null + syncState() + } + } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/overview/MarketOverviewScreen.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/overview/MarketOverviewScreen.kt index 9c920cd01f2..ea57d275bde 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/overview/MarketOverviewScreen.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/overview/MarketOverviewScreen.kt @@ -22,7 +22,11 @@ import io.horizontalsystems.bankwallet.core.slideFromRight import io.horizontalsystems.bankwallet.entities.ViewState import io.horizontalsystems.bankwallet.modules.coin.overview.ui.Loading import io.horizontalsystems.bankwallet.modules.market.category.MarketCategoryFragment -import io.horizontalsystems.bankwallet.modules.market.overview.ui.* +import io.horizontalsystems.bankwallet.modules.market.overview.ui.BoardsView +import io.horizontalsystems.bankwallet.modules.market.overview.ui.MetricChartsView +import io.horizontalsystems.bankwallet.modules.market.overview.ui.TopNftCollectionsBoardView +import io.horizontalsystems.bankwallet.modules.market.overview.ui.TopPlatformsBoardView +import io.horizontalsystems.bankwallet.modules.market.overview.ui.TopSectorsBoardView import io.horizontalsystems.bankwallet.modules.market.platform.MarketPlatformFragment import io.horizontalsystems.bankwallet.modules.market.topcoins.MarketTopCoinsFragment import io.horizontalsystems.bankwallet.modules.market.topnftcollections.TopNftCollectionsFragment @@ -107,7 +111,7 @@ fun MarketOverviewScreen( viewModel.onSelectTopNftsTimeDuration(timeDuration) }, onClickCollection = { blockchainType, collectionUid -> - val args = NftCollectionFragment.prepareParams(collectionUid, blockchainType) + val args = NftCollectionFragment.prepareParams(collectionUid, blockchainType.uid) navController.slideFromBottom(R.id.nftCollectionFragment, args) }, onClickSeeAll = { diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/platform/MarketPlatformFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/platform/MarketPlatformFragment.kt index 0b8b13cc2a4..32ee24265be 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/platform/MarketPlatformFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/platform/MarketPlatformFragment.kt @@ -42,14 +42,8 @@ class MarketPlatformFragment : BaseComposeFragment() { @Composable override fun GetContent(navController: NavController) { - val platformUid = activity?.intent?.data?.getQueryParameter("uid") - val platformTitle = activity?.intent?.data?.getQueryParameter("title") - val platform = if (platformUid != null && platformTitle != null) { - Platform(platformUid, platformTitle) - } else { - arguments?.parcelable(platformKey) - } + val platform = arguments?.parcelable(platformKey) if (platform == null) { navController.popBackStack() diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/topnftcollections/TopNftCollectionsFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/topnftcollections/TopNftCollectionsFragment.kt index 42f8ed58de0..4cd32b16f03 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/topnftcollections/TopNftCollectionsFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/market/topnftcollections/TopNftCollectionsFragment.kt @@ -52,7 +52,7 @@ class TopNftCollectionsFragment : BaseComposeFragment() { viewModel, { navController.popBackStack() }, { blockchainType, collectionUid -> - val args = NftCollectionFragment.prepareParams(collectionUid, blockchainType) + val args = NftCollectionFragment.prepareParams(collectionUid, blockchainType.uid) navController.slideFromBottom(R.id.nftCollectionFragment, args) } ) diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/asset/NftAssetFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/asset/NftAssetFragment.kt index 6ed8a51b9f3..248766251c0 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/asset/NftAssetFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/asset/NftAssetFragment.kt @@ -244,7 +244,7 @@ private fun AssetContent( .clickable { navController.slideFromRight( R.id.nftCollectionFragment, - NftCollectionFragment.prepareParams(asset.providerCollectionUid, asset.nftUid.blockchainType) + NftCollectionFragment.prepareParams(asset.providerCollectionUid, asset.nftUid.blockchainType.uid) ) }, verticalAlignment = Alignment.CenterVertically diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/collection/NftCollectionFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/collection/NftCollectionFragment.kt index 4deffca9aa0..b6f37cff862 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/collection/NftCollectionFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/nft/collection/NftCollectionFragment.kt @@ -36,13 +36,8 @@ class NftCollectionFragment : BaseComposeFragment() { @Composable override fun GetContent(navController: NavController) { - val uid = activity?.intent?.data?.getQueryParameter("uid") - val blockchainTypeUidFromIntent = activity?.intent?.data?.getQueryParameter("blockchainTypeUid") - if (uid != null) { - activity?.intent?.data = null - } - val nftCollectionUid = requireArguments().getString(collectionUidKey, uid ?: "") - val blockchainTypeString = requireArguments().getString(blockchainTypeKey, blockchainTypeUidFromIntent ?: "") + val nftCollectionUid = requireArguments().getString(collectionUidKey, "") + val blockchainTypeString = requireArguments().getString(blockchainTypeUidKey, "") val blockchainType = BlockchainType.fromUid(blockchainTypeString) val viewModel by navGraphViewModels(R.id.nftCollectionFragment) { @@ -57,10 +52,10 @@ class NftCollectionFragment : BaseComposeFragment() { companion object { private const val collectionUidKey = "collectionUid" - private const val blockchainTypeKey = "blockchainType" + private const val blockchainTypeUidKey = "blockchainTypeUid" - fun prepareParams(collectionUid: String, blockchainType: BlockchainType) = - bundleOf(collectionUidKey to collectionUid, blockchainTypeKey to blockchainType.uid) + fun prepareParams(collectionUid: String, blockchainTypeUid: String) = + bundleOf(collectionUidKey to collectionUid, blockchainTypeUidKey to blockchainTypeUid) } } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/walletconnect/list/WCListFragment.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/walletconnect/list/WCListFragment.kt index aa72a5e4006..3120a79eb8e 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/walletconnect/list/WCListFragment.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/walletconnect/list/WCListFragment.kt @@ -1,6 +1,7 @@ package io.horizontalsystems.bankwallet.modules.walletconnect.list import androidx.compose.runtime.Composable +import androidx.core.os.bundleOf import androidx.navigation.NavController import io.horizontalsystems.bankwallet.core.BaseComposeFragment import io.horizontalsystems.bankwallet.modules.walletconnect.list.ui.WCSessionsScreen @@ -9,12 +10,17 @@ class WCListFragment : BaseComposeFragment() { @Composable override fun GetContent(navController: NavController) { - val deepLinkUri = activity?.intent?.data?.toString() - activity?.intent?.data = null + val deepLinkUri = requireArguments().getString(WC_CONNECTION_URI_KEY) WCSessionsScreen( navController, deepLinkUri ) } + companion object { + private const val WC_CONNECTION_URI_KEY = "wc_connection_uri_key" + + fun prepareParams(deepLinkUri: String?) = bundleOf(WC_CONNECTION_URI_KEY to deepLinkUri) + } + } diff --git a/app/src/main/res/navigation/main_graph.xml b/app/src/main/res/navigation/main_graph.xml index 7b49ae1395c..40e6a976445 100644 --- a/app/src/main/res/navigation/main_graph.xml +++ b/app/src/main/res/navigation/main_graph.xml @@ -8,15 +8,7 @@ - - - - - + android:name="io.horizontalsystems.bankwallet.modules.main.MainFragment"/> @@ -147,11 +139,7 @@ android:name="io.horizontalsystems.bankwallet.modules.market.metricspage.MetricsPageFragment" /> - - + android:name="io.horizontalsystems.bankwallet.modules.coin.CoinFragment" /> @@ -253,11 +241,7 @@ android:name="io.horizontalsystems.bankwallet.modules.market.topplatforms.TopPlatformsFragment"/> - - + android:name="io.horizontalsystems.bankwallet.modules.market.platform.MarketPlatformFragment"/> @@ -340,11 +324,7 @@ android:name="io.horizontalsystems.bankwallet.modules.nft.send.SendNftFragment" /> - - + android:name="io.horizontalsystems.bankwallet.modules.nft.collection.NftCollectionFragment"/> diff --git a/build.gradle b/build.gradle index f91cfb4ddcb..b624bf29599 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { constraint_version = "2.1.4" core_ktx_version = "1.10.1" fragment_ktx_version = "1.6.1" - navigation_ktx_version = "2.7.4" + navigation_ktx_version = "2.7.5" rxjava_version = "2.2.19" biometric_version = "1.1.0" junit_version = "4.13.2" @@ -25,7 +25,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong