From 03318a98e29f633b074d5aa1861e8839e32ac79c Mon Sep 17 00:00:00 2001 From: Taras Smakula <tarassmakula@gmail.com> Date: Fri, 27 Oct 2023 15:33:34 +0300 Subject: [PATCH] Update handle url click in home fragment --- .../feature/home/DeepLinkIntentHandler.kt | 5 +++++ .../futo/circles/feature/home/HomeFragment.kt | 19 +++++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 app/src/main/java/org/futo/circles/feature/home/DeepLinkIntentHandler.kt diff --git a/app/src/main/java/org/futo/circles/feature/home/DeepLinkIntentHandler.kt b/app/src/main/java/org/futo/circles/feature/home/DeepLinkIntentHandler.kt new file mode 100644 index 000000000..60a9f98e0 --- /dev/null +++ b/app/src/main/java/org/futo/circles/feature/home/DeepLinkIntentHandler.kt @@ -0,0 +1,5 @@ +package org.futo.circles.feature.home + +interface DeepLinkIntentHandler { + fun onNewIntent() +} \ No newline at end of file diff --git a/app/src/main/java/org/futo/circles/feature/home/HomeFragment.kt b/app/src/main/java/org/futo/circles/feature/home/HomeFragment.kt index cf90204f3..b32ed46a3 100644 --- a/app/src/main/java/org/futo/circles/feature/home/HomeFragment.kt +++ b/app/src/main/java/org/futo/circles/feature/home/HomeFragment.kt @@ -18,17 +18,15 @@ import dagger.hilt.android.AndroidEntryPoint import org.futo.circles.MainActivity import org.futo.circles.R import org.futo.circles.auth.feature.workspace.WorkspaceDialogFragment -import org.futo.circles.core.base.SHARE_PROFILE_URL_PREFIX -import org.futo.circles.core.base.SHARE_ROOM_URL_PREFIX import org.futo.circles.core.extensions.navigateSafe import org.futo.circles.core.extensions.observeData import org.futo.circles.core.extensions.observeResponse import org.futo.circles.core.extensions.setSupportActionBar +import org.futo.circles.core.feature.picker.helper.RuntimePermissionHelper import org.futo.circles.core.model.CircleRoomTypeArg import org.futo.circles.core.model.GROUP_TYPE import org.futo.circles.core.model.LoadingData import org.futo.circles.core.model.TIMELINE_TYPE -import org.futo.circles.core.feature.picker.helper.RuntimePermissionHelper import org.futo.circles.core.provider.MatrixSessionProvider import org.futo.circles.core.view.LoadingDialog import org.futo.circles.databinding.FragmentBottomNavigationBinding @@ -36,9 +34,6 @@ import org.futo.circles.gallery.feature.backup.service.MediaBackupServiceManager import org.matrix.android.sdk.api.session.getRoomSummary import javax.inject.Inject -interface DeepLinkIntentHandler { - fun onNewIntent() -} @AndroidEntryPoint class HomeFragment : Fragment(R.layout.fragment_bottom_navigation), DeepLinkIntentHandler { @@ -104,14 +99,10 @@ class HomeFragment : Fragment(R.layout.fragment_bottom_navigation), DeepLinkInte private fun handleOpenFromShareRoomUrl() { val uri = activity?.intent?.data ?: return val uriString = uri.toString() - if (uriString.startsWith(SHARE_ROOM_URL_PREFIX) - || uriString.startsWith(SHARE_PROFILE_URL_PREFIX) - ) { - findNavController().navigateSafe( - HomeFragmentDirections.toRoomWellKnownDialogFragment(uriString) - ) - activity?.intent?.data = null - } + findNavController().navigateSafe( + HomeFragmentDirections.toRoomWellKnownDialogFragment(uriString) + ) + activity?.intent?.data = null } private fun setupObservers() { -- GitLab