This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val transitionNameImage = context.getString(R.string.transition_image, title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fragment.sharedElementEnterTransition = TransitionSet().apply { | |
addTransition(ChangeImageTransform()) | |
addTransition(ChangeBounds()) | |
addTransition(ChangeTransform()) | |
addTransition(ChangeOutlineRadiusTransition(animationRadiusData.startRadius, | |
animationRadiusData.endRadius)) // add this Transition | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
parentFragment?.also { parentFragment -> | |
NewsTransitioner.setupFirstFragment(parentFragment) | |
parentFragment.postponeEnterTransition() | |
} | |
// Initialization UI | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Glide | |
.with(target) | |
.load(url) | |
.apply( | |
RequestOptions().dontTransform() // this line | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object : RequestListener<Drawable> { | |
override fun onLoadFailed( | |
e: GlideException?, | |
model: Any?, | |
target: com.bumptech.glide.request.target.Target<Drawable>?, | |
isFirstResource: Boolean | |
): Boolean { | |
scheduleStartPostponedTransitions() | |
return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChangeOutlineRadiusTransition( | |
private val startRadius: Int, | |
private val endRadius: Int | |
) : Transition() { | |
private companion object { | |
/** | |
* Unique key for start and end values to be kept in [TransitionValues] [TransitionValues] | |
*/ | |
private const val RADIUS = "ChangeOutlineRadiusTransition:outlineRadius" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
parentFragment?.also { parentFragment -> | |
NewsTransitioner.setupFirstFragment(parentFragment) | |
parentFragment.postponeEnterTransition() | |
} | |
// Initialization UI | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Набор эвентов в файле Events.kt | |
interface Event | |
class OpenLinkEvent(val link: String) : Event | |
class ShowSnackbarEvent(val message: String) : Event | |
class ShareEvent(val link: String) : Event | |
class OpenEmailAppEvent(val email: String) : Event |