react-native-in-app-debugger 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/package.json +1 -1
- package/useAnimation.ts +8 -5
package/README.md
CHANGED
|
@@ -56,6 +56,14 @@ export default () => (
|
|
|
56
56
|
Call `InAppDebugger` component on top most component, then a floating debugger will appear.
|
|
57
57
|
|
|
58
58
|
|
|
59
|
+
### Installation
|
|
60
|
+
|
|
61
|
+
You can declare this in your `package.json` without the need to specify version
|
|
62
|
+
```
|
|
63
|
+
"react-native-in-app-debugger": "latest",
|
|
64
|
+
```
|
|
65
|
+
because we are committed to ensure that no breaking changes for every released version and all releases will be backward compatible. Therefore, you will enjoy latest version hassle free.
|
|
66
|
+
|
|
59
67
|
### Properties
|
|
60
68
|
|
|
61
69
|
All FlatList props should work plus props mentioned below
|
package/package.json
CHANGED
package/useAnimation.ts
CHANGED
|
@@ -13,22 +13,22 @@ export default (defaultBadgeHeight) => {
|
|
|
13
13
|
const badgeHeight = useRef(new Animated.Value(defaultBadgeHeight)).current;
|
|
14
14
|
const badgeWidth = useRef(new Animated.Value(defaultBadgeWidth)).current;
|
|
15
15
|
const { width, height } = useWindowDimensions();
|
|
16
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
16
17
|
|
|
17
18
|
useEffect(() => {
|
|
18
19
|
const showSubscription = Keyboard.addListener('keyboardDidShow', () => {
|
|
19
|
-
Animated.spring(position, { ...und, toValue: { x: cachePosition.current.x, y: 0 } }).start();
|
|
20
|
+
!isOpen && Animated.spring(position, { ...und, toValue: { x: cachePosition.current.x, y: 0 } }).start();
|
|
20
21
|
});
|
|
21
22
|
const hideSubscription = Keyboard.addListener('keyboardDidHide', () => {
|
|
22
|
-
Animated.spring(position, { ...und, toValue: cachePosition.current }).start();
|
|
23
|
+
!isOpen && Animated.spring(position, { ...und, toValue: cachePosition.current }).start();
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
return () => {
|
|
26
27
|
showSubscription.remove();
|
|
27
28
|
hideSubscription.remove();
|
|
28
29
|
};
|
|
29
|
-
}, []);
|
|
30
|
+
}, [isOpen]);
|
|
30
31
|
|
|
31
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
32
32
|
|
|
33
33
|
const panResponder = useRef(
|
|
34
34
|
PanResponder.create({
|
|
@@ -43,7 +43,10 @@ export default (defaultBadgeHeight) => {
|
|
|
43
43
|
onPanResponderMove: Animated.event([null, { dx: position.x, dy: position.y }], und),
|
|
44
44
|
onPanResponderRelease: (_, g) => {
|
|
45
45
|
position.flattenOffset();
|
|
46
|
-
cachePosition.current = {
|
|
46
|
+
cachePosition.current = {
|
|
47
|
+
x: g.moveX > width / 2 ? width - defaultBadgeWidth : 0,
|
|
48
|
+
y: Math.min(g.moveY, height - defaultBadgeHeight),
|
|
49
|
+
};
|
|
47
50
|
Animated.spring(position, { ...und, toValue: cachePosition.current }).start();
|
|
48
51
|
},
|
|
49
52
|
}),
|