Skip to content

Commit

Permalink
Fix setupFragmentTransaction in sample app.
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok committed Apr 17, 2021
1 parent 82256a9 commit ff77162
Showing 1 changed file with 11 additions and 6 deletions.
Expand Up @@ -10,6 +10,7 @@ import com.github.terrakok.cicerone.Navigator
import com.github.terrakok.cicerone.NavigatorHolder
import com.github.terrakok.cicerone.Replace
import com.github.terrakok.cicerone.androidx.AppNavigator
import com.github.terrakok.cicerone.androidx.FragmentScreen
import com.github.terrakok.cicerone.sample.R
import com.github.terrakok.cicerone.sample.SampleApplication
import com.github.terrakok.cicerone.sample.Screens.ProfileInfo
Expand Down Expand Up @@ -47,14 +48,18 @@ class ProfileActivity : AppCompatActivity() {
}

private val navigator: Navigator = object : AppNavigator(this, R.id.container) {

override fun setupFragmentTransaction(fragmentTransaction: FragmentTransaction, currentFragment: Fragment?, nextFragment: Fragment?) {
override fun setupFragmentTransaction(
screen: FragmentScreen,
fragmentTransaction: FragmentTransaction,
currentFragment: Fragment?,
nextFragment: Fragment
) {
if (currentFragment is ProfileFragment
&& nextFragment is SelectPhotoFragment) {
&& nextFragment is SelectPhotoFragment) {
setupSharedElementForProfileToSelectPhoto(
currentFragment,
nextFragment,
fragmentTransaction
currentFragment,
nextFragment,
fragmentTransaction
)
}
}
Expand Down

0 comments on commit ff77162

Please sign in to comment.