Skip to content

Commit dfa3a66

Browse files
committed
Add logging-debug setup
1 parent b2a561d commit dfa3a66

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

android/src/main/java/com/swmansion/rnscreens/Screen.kt

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44
import android.content.pm.ActivityInfo
55
import android.graphics.Paint
66
import android.os.Parcelable
7+
import android.util.Log
78
import android.util.SparseArray
89
import android.view.View
910
import android.view.ViewGroup
@@ -376,6 +377,7 @@ class Screen(
376377
var nativeBackButtonDismissalEnabled: Boolean = true
377378

378379
fun startRemovalTransition() {
380+
Log.w(TAG, "$this startRemovalTransition")
379381
// isBeingRemoved is marked as volatile to ensure memory ordering.
380382
// Synchronization is not required, because this method is called either from commit hook
381383
// running on JS thread (before mounting) or from mounting code running on UI thread.
@@ -391,12 +393,16 @@ class Screen(
391393
if (!isBeingRemoved) {
392394
isBeingRemoved = true
393395
if (!reactContext.isOnUiQueueThread) {
396+
Log.w(TAG, "$this startRemovalTransition schedule")
394397
reactContext.runOnUiQueueThread {
398+
Log.w(TAG, "$this startRemovalTransition exec")
395399
startTransitionRecursive(this)
396400
}
397401
} else {
402+
Log.w(TAG, "$this startRemovalTransition sync")
398403
startTransitionRecursive(this)
399404
}
405+
// startTransitionRecursive(this)
400406
}
401407
}
402408

android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.swmansion.rnscreens
22

3+
import android.util.Log
34
import android.view.View
45
import com.facebook.react.bridge.ReactApplicationContext
56
import com.facebook.react.module.annotations.ReactModule
@@ -46,6 +47,7 @@ class ScreenStackViewManager :
4647
}
4748

4849
private fun prepareOutTransition(screen: Screen?) {
50+
Log.w("StackViewManager", "$screen startRemovalTransition")
4951
screen?.startRemovalTransition()
5052
}
5153

apps/App.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
22
import { enableFreeze } from 'react-native-screens';
3-
import Example from './Example';
4-
// import * as Test from './src/tests';
3+
// import Example from './Example';
4+
import * as Test from './src/tests';
55

66
enableFreeze(true);
77

88
export default function App() {
9-
return <Example />;
10-
// return <Test.Test42 />;
9+
// return <Example />;
10+
return <Test.Test2282 />;
1111
}

apps/src/tests/Test2282.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ function Home({ navigation }: any) {
3333
);
3434
}
3535

36-
function ListScreen() {
36+
function ListScreen({ navigation }: any) {
3737
return (
3838
<View
3939
style={{ flex: 1, backgroundColor: 'slateblue' }}
4040
removeClippedSubviews>
4141
<ParentFlatlist />
4242
<View removeClippedSubviews>
4343
<View style={{ backgroundColor: 'pink', width: '100%', height: 50 }} />
44+
<Button title='Go back' onPress={() => navigation.goBack()} />
4445
</View>
4546
<ParentFlatlist horizontal />
4647
</View>
@@ -140,7 +141,7 @@ export default function App(): React.JSX.Element {
140141
<NavigationContainer>
141142
<Stack.Navigator screenOptions={{ animation: 'slide_from_right' }}>
142143
<Stack.Screen name="Home" component={Home} />
143-
<Stack.Screen name="List" component={ListScreenSimplified}/>
144+
<Stack.Screen name="List" component={ListScreen}/>
144145
</Stack.Navigator>
145146
</NavigationContainer>
146147
);

0 commit comments

Comments
 (0)