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
<animated-vector | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:aapt="http://schemas.android.com/aapt"> | |
<aapt:attr name="android:drawable"> | |
<vector | |
android:name="vector" | |
android:width="24dp" | |
android:height="24dp" | |
android:viewportWidth="24" | |
android:viewportHeight="24"> |
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
<animated-vector | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:aapt="http://schemas.android.com/aapt"> | |
<aapt:attr name="android:drawable"> | |
<vector | |
android:name="vector" | |
android:width="24dp" | |
android:height="24dp" | |
android:viewportWidth="24" | |
android:viewportHeight="24"> |
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 fromView: View = ReactFindViewUtil.findView(from, fromViewNativeID)!! | |
ReactFindViewUtil.findView(toScreen, object : OnViewFoundListener { | |
override fun getNativeId(): String { | |
return enteringViewNativeID | |
} | |
override fun onViewFound(to: View) { | |
// We found the corresponding entering view - move on to the next step! | |
} | |
}) |
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 XAnimatorCreator(from: View, to: View) : PropertyAnimatorCreator(from, to) { | |
private val dx: Int | |
init { | |
val fromXy = ViewUtils.getLocationOnScreen(from) | |
val toXy = ViewUtils.getLocationOnScreen(to) | |
dx = fromXy.x - toXy.x | |
} | |
override fun shouldAnimateProperty() = dx != 0 |
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 onViewFound(to: View) { | |
to.doOnLayout { | |
// Create transition animators after entering view is laid out | |
animateSharedElement(from, to) | |
} | |
} |
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
Navigation.push(this.props.componentId, { | |
component: { | |
Name: `MY_SCREEN`, | |
options: { | |
animations: { | |
push: { | |
sharedElementTransitions: [ | |
{ | |
fromId: `sourceImage`, | |
toId: `destinationImage` |
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
<Image | |
source={this.props.image} | |
nativeID={`destinationImage`} /> |
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
<Image | |
source={this.props.image} | |
nativeID={`sourceImage`} /> |
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
import android.support.annotation.Nullable; | |
import java.lang.reflect.Field; | |
class ReflectionUtils { | |
@Nullable | |
static Object getDeclaredField(Object obj, String fieldName) { | |
try { | |
Field f = getField(obj.getClass(), fieldName); |
NewerOlder