Browse Source

축소 시 Image 위치 조절 IOS

goodboy 6 years ago
parent
commit
a22f912607
1 changed files with 34 additions and 6 deletions
  1. 34 6
      src/components/Player.js

+ 34 - 6
src/components/Player.js

@@ -27,7 +27,7 @@ const { width, height } = Dimensions.get('window');
 const statusBarHeight = getStatusBarHeight(true);
 const minHeight = height * 0.1;
 const midBound = height - height / 2.5;
-const upperBound = height * 0.75;
+const upperBound = midBound + minHeight;
 //const destination = height - height * 0.2
 //const destination = height - height*0.16 -2 - getStatusBarHeight(true);
 //getInset('bottom')
@@ -56,7 +56,8 @@ const {
   neq,
   or,
   and,
-  greaterThan
+  greaterThan,
+  call
 } = Animated;
 
 const shadow = {
@@ -157,7 +158,7 @@ const onShare = async () => {
 export default props => {
   const [modalVisible, setModalVisible] = useState(null);
   const { y: tabY } = props.tabPosition;
-  const destination = tabY - minHeight - getStatusBarHeight(true);
+  const destination = tabY - minHeight - statusBarHeight;
   const [currentPlayerValue, setCurrentPlayerValue] = useState(0);
   const [isPlay, setPlay] = useState(false);
 
@@ -240,7 +241,7 @@ export default props => {
         { useNativeDriver: true }
       ),
       opacity: interpolate(translateY, {
-        inputRange: [0, midBound - 100],
+        inputRange: [0, midBound],
         outputRange: [1, 0],
         extrapolate: Extrapolate.CLAMP
       }),
@@ -304,6 +305,33 @@ export default props => {
   const slideUp = () => {};
   return (
     <>
+    {/* <C.View
+        style={{ ...StyleSheet.absoluteFillObject, zIndex: 1000, marginTop:getStatusBarHeight(true) }}
+        cls="h20 bgc-rgba-white-0_5"
+      >
+        <C.Text cls="f5 ta-c bgc-rgba-red-0_5">테스트용 Component</C.Text>
+        <C.View cls="h10 ai-c bgc-rgba-blue-0_5">
+          <Slider
+            style={{ width: '95%' }}
+            trackStyle={{ height: 2 }}
+            thumbTintColor="#333"
+            thumbStyle={{ width: 10, height: 5 }}
+            value={currentPlayerValue}
+            onValueChange={value => setCurrentPlayerValue(value)}
+          />
+          <C.View cls="w95 jc-sb flx-row">
+            <C.Text>Time : {currentPlayerValue}</C.Text>
+          </C.View>
+        </C.View>
+        <C.TouchableOpacity 
+          cls="h5 bgc-rgba-black-0_5"
+          onPress={() => {
+            setPlay(!isPlay);
+          }}
+        >
+          <C.Text cls="f5 ta-c rgba-white-0_5">Click Test</C.Text>
+        </C.TouchableOpacity>
+      </C.View> */}
       <PanGestureHandler
         onHandlerStateChange={onGestureEvent}
         activeOffsetY={[-10, 10]}
@@ -423,7 +451,7 @@ export default props => {
             }
           ]}
           onPress={() => {
-            setModalVisible(!modalVisible);
+            setModalVisible(null);
           }}
         >
           <C.EL.Icon
@@ -445,7 +473,7 @@ export default props => {
           }}
         >
           <ScrollView>
-            <View style={{ height: getStatusBarHeight(true) }} />
+            <View style={{ height: statusBarHeight }} />
             <View style={{ marginHorizontal: '5%', alignItems: 'flex-end' }}>
               <C.EL.Icon
                 color="black"