Skip to content

Commit

Permalink
Fix navigation to import owner flow (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
elgatovital authored Feb 3, 2021
1 parent ccb67ad commit da8f441
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.view.ViewGroup
import androidx.navigation.Navigation
import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding
import io.gnosis.safe.R
import io.gnosis.safe.databinding.ItemBannerImportKeyBinding
import io.gnosis.safe.databinding.ItemCoinBalanceBinding
import io.gnosis.safe.databinding.ItemCoinTotalBinding
Expand Down Expand Up @@ -124,7 +125,7 @@ class BannerViewHolder(private val viewBinding: ItemBannerImportKeyBinding) : Ba
}
bannerAction.setOnClickListener {
bannerListener.get()?.onBannerActionTriggered()
Navigation.findNavController(it).navigate(AssetsFragmentDirections.actionAssetsFragmentToOwnerInfoFragment())
Navigation.findNavController(it).navigate(R.id.action_to_import_owner)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AddSafeOwnerFragment : BaseViewBindingFragment<FragmentAddSafeOwnerBinding
importButton.setOnClickListener {
tracker.logOnboardingOwnerImport()
finishAddSafeFlow()
findNavController().navigate(AssetsFragmentDirections.actionAssetsFragmentToOwnerInfoFragment())
findNavController().navigate(R.id.action_to_import_owner)
}
skip.setOnClickListener {
tracker.logOnboardingOwnerSkipped()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class NoSafeFragment : BaseViewBindingFragment<FragmentNoSafesBinding>() {
super.onViewCreated(view, savedInstanceState)

binding.loadSafeButton.setOnClickListener {
requireParentFragment().findNavController().navigate(R.id.action_to_add_safe_nav)
requireParentFragment().findNavController().navigate(R.id.action_to_add_safe)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SafeSelectionViewModel @Inject constructor(
updateState {
SafeSelectionState.AddSafeState(
ViewAction.NavigateTo(
SafeSelectionDialogDirections.actionSafeSelectionDialogToAddSafeNav()
SafeSelectionDialogDirections.actionSafeSelectionDialogToAddSafe()
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_transactions.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
Expand All @@ -23,4 +23,4 @@

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
12 changes: 6 additions & 6 deletions app/src/main/res/navigation/main_nav.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@
app:startDestination="@id/assetsFragment">

<action
android:id="@+id/action_to_add_safe_nav"
android:id="@+id/action_to_add_safe"
app:destination="@id/addSafeFragment"
app:launchSingleTop="true" />

<action
android:id="@+id/action_to_import_owner"
app:destination="@id/ownerInfoFragment" />

<dialog
android:id="@+id/safeSelectionDialog"
android:name="io.gnosis.safe.ui.safe.selection.SafeSelectionDialog"
android:label="SafeSelectionDialog"
tools:layout="@layout/dialog_safe_selection">

<action
android:id="@+id/action_safeSelectionDialog_to_add_safe_nav"
android:id="@+id/action_safeSelectionDialog_to_add_safe"
app:destination="@id/addSafeFragment"
app:launchSingleTop="true"
app:popUpTo="@id/addSafeFragment"
Expand All @@ -42,10 +46,6 @@
android:id="@+id/action_assetsFragment_to_collectiblesDetailsFragment"
app:destination="@id/collectiblesDetailsFragment" />

<action
android:id="@+id/action_assetsFragment_to_ownerInfoFragment"
app:destination="@id/ownerInfoFragment" />

</fragment>

<fragment
Expand Down

0 comments on commit da8f441

Please sign in to comment.