Вход Messenger расширяет анимацию в реагирующем - PullRequest
0 голосов
/ 01 февраля 2019

Привет, я хотел расширить свой ввод слева, как мессенджер, и скрыть аудиозапись и значок gallarey слева, как в мессенджере

 const SEARCH_FULL_WIDTH = 230 //search_width when unfocused
 const SEARCH_SHRINK_WIDTH = 280  //search_width when focused

   this.progress = new Animated.Value(SEARCH_FULL_WIDTH)
  if(focuseInput){
            this.setState({boolean: false})
            Animated.timing(this.progress, {
                toValue: SEARCH_SHRINK_WIDTH,
                duration: 400,
                useNativeDriver: true
              }).start()
           }
     // unfocuseInput
            else{

            Animated.timing(this.progress, {
                toValue: SEARCH_FULL_WIDTH,
                duration: 400,
                useNativeDriver: true
              }).start(() =>  this.setState({boolean: true}))
           }


          <Animated.View style={{width: this.progress}}>
            <Composer
                {...props}
                onFocus={() => alert("Focus")}
                placeholderTextColor={'#c0c0bf'}
                />

         </Animated.View>
...