Skip to content

Commit

Permalink
Setting useNativeDriver explicitly.
Browse files Browse the repository at this point in the history
  • Loading branch information
halilb committed Apr 26, 2020
1 parent 4b1f243 commit 6a2c8e8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/BaseInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class BaseInput extends Component {
toValue: isActive ? 1 : 0,
duration: animationDuration,
easing,
useNativeDriver,
useNativeDriver: useNativeDriver || false,
}).start();
}

Expand Down
40 changes: 22 additions & 18 deletions lib/Jiro.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import React from "react";
import PropTypes from "prop-types";
import {
Animated,
Easing,
Expand All @@ -8,9 +8,9 @@ import {
TouchableWithoutFeedback,
View,
StyleSheet,
} from 'react-native';
} from "react-native";

import BaseInput from './BaseInput';
import BaseInput from "./BaseInput";

export default class Jiro extends BaseInput {
static propTypes = {
Expand All @@ -20,7 +20,7 @@ export default class Jiro extends BaseInput {
};

static defaultProps = {
borderColor: 'red',
borderColor: "red",
inputPadding: 16,
height: 48,
};
Expand All @@ -45,19 +45,22 @@ export default class Jiro extends BaseInput {
toValue: animationValue,
eaasing: Easing.bezier(0.2, 1, 0.3, 1),
duration: 200,
useNativeDriver: false,
}
);
const borderHeightAnimation = Animated.timing(this.state.borderHeightAnim, {
toValue: animationValue,
eaasing: Easing.ease,
duration: 200,
useNativeDriver: false,
});
const labelPositionAnimation = Animated.timing(
this.state.labelPositionAnim,
{
toValue: animationValue,
eaasing: Easing.ease,
duration: 200,
useNativeDriver: false,
}
);

Expand Down Expand Up @@ -135,7 +138,7 @@ export default class Jiro extends BaseInput {
onBlur={this._onBlur}
onChange={this._onChange}
onFocus={this._onFocus}
underlineColorAndroid={'transparent'}
underlineColorAndroid={"transparent"}
/>
<TouchableWithoutFeedback onPress={this.focus}>
<Animated.View
Expand All @@ -144,15 +147,16 @@ export default class Jiro extends BaseInput {
{
bottom: labelPositionAnim.interpolate({
inputRange: [0, 1],
outputRange: [inputPadding / 2, inputHeight + inputPadding / 4],
outputRange: [
inputPadding / 2,
inputHeight + inputPadding / 4,
],
}),
left: inputPadding,
},
]}
>
<Text style={[styles.label, labelStyle]}>
{label}
</Text>
<Text style={[styles.label, labelStyle]}>{label}</Text>
</Animated.View>
</TouchableWithoutFeedback>
</View>
Expand All @@ -162,24 +166,24 @@ export default class Jiro extends BaseInput {

const styles = StyleSheet.create({
labelContainer: {
position: 'absolute',
backgroundColor: 'transparent',
position: "absolute",
backgroundColor: "transparent",
},
label: {
fontSize: 13,
fontWeight: 'bold',
color: '#6a7989',
fontWeight: "bold",
color: "#6a7989",
},
textInput: {
position: 'absolute',
position: "absolute",
bottom: 0,
padding: 0,
color: 'black',
color: "black",
fontSize: 18,
fontWeight: 'bold',
fontWeight: "bold",
},
border: {
position: 'absolute',
position: "absolute",
bottom: 0,
left: 0,
right: 0,
Expand Down

0 comments on commit 6a2c8e8

Please sign in to comment.