Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TestsExample/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Test748 from './src/Test748';
import Test750 from './src/Test750';
import Test765 from './src/Test765';
import Test780 from './src/Test780';
import Test817 from './src/Test817';
import Test831 from './src/Test831';

enableScreens();
Expand Down
50 changes: 50 additions & 0 deletions TestsExample/src/Test817.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* eslint-disable react/display-name */
import React from "react";
import { View, Text, Button } from "react-native";

import { NavigationContainer, ParamListBase } from "@react-navigation/native";
import { createNativeStackNavigator, NativeStackNavigationProp } from "react-native-screens/native-stack";

const Stack = createNativeStackNavigator();

const App = (): JSX.Element => {
return (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
stackAnimation: "slide_from_right",
}}
>
<Stack.Screen
name="Home"
component={Home}
/>
<Stack.Screen
name="Notifications"
component={Notifications}
options={{
headerCenter: () => <Text>Hello!</Text>,
headerRight: () => <Text>Some other text</Text>,
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
};

function Home({navigation}: {navigation: NativeStackNavigationProp<ParamListBase>}) {
return (
<View>
<Button
title="Navigate"
onPress={() => navigation.navigate("Notifications")}
/>
</View>
)
}

function Notifications() {
return <View />;
}

export default App;
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ private void maybeUpdate() {
}
}

public Toolbar getToolbar() {
return mToolbar;
}

public ScreenStackHeaderSubview getConfigSubview(int index) {
return mConfigSubviews.get(index);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ private void startTransitionRecursive(ViewGroup parent) {
for (int i = 0, size = parent.getChildCount(); i < size; i++) {
View child = parent.getChildAt(i);
parent.startViewTransition(child);
if (child instanceof ScreenStackHeaderConfig) {
// we want to start transition on children of the toolbar too,
// which is not a child of ScreenStackHeaderConfig
startTransitionRecursive(((ScreenStackHeaderConfig) child).getToolbar());
}
if (child instanceof ViewGroup) {
startTransitionRecursive((ViewGroup) child);
}
Expand Down