...
|
...
|
@@ -184,45 +184,40 @@ export default class User extends React.Component { |
|
|
|
|
|
setAnimationValue({ value, }) {
|
|
|
|
|
|
console.log('value = ' + value);
|
|
|
if (value < 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (this.lastValue > value) {
|
|
|
//down
|
|
|
if (value < 2) {
|
|
|
// let top = 64 * (value - 0.8);
|
|
|
let top = 64 * (value - 0.5);
|
|
|
top = top > 64 ? 64 : top;
|
|
|
top = top < 0 ? 0 : top;
|
|
|
this.animView && this.animView.setNativeProps({
|
|
|
style: {
|
|
|
top: value,
|
|
|
paddingTop: top,
|
|
|
},
|
|
|
});
|
|
|
//
|
|
|
// if (value < 0) {
|
|
|
// return;
|
|
|
// }
|
|
|
//
|
|
|
// if (this.lastValue > value) {
|
|
|
// //down
|
|
|
// if (value < 2) {
|
|
|
// let top = 64 * (value - 1);
|
|
|
// top = top > 64 ? 64 : top;
|
|
|
// top = top < 0 ? 0 : top;
|
|
|
// this.animView && this.animView.setNativeProps({
|
|
|
// style: {
|
|
|
// top,
|
|
|
// },
|
|
|
// });
|
|
|
// }
|
|
|
//
|
|
|
// } else {
|
|
|
// //up
|
|
|
// if (value > 0.9) {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
//up
|
|
|
if (value > 0.5) {
|
|
|
// let top = 64 * (value - 0.6)
|
|
|
// top = top > 64 ? 64 : top;
|
|
|
// top = top < 0 ? 0 : top;
|
|
|
// this.animView && this.animView.setNativeProps({
|
|
|
// style: {
|
|
|
// top,
|
|
|
// },
|
|
|
// });
|
|
|
// }
|
|
|
//
|
|
|
// }
|
|
|
// this.lastValue = value;
|
|
|
let top = 64 * (value - 0.5)
|
|
|
top = top > 64 ? 64 : top;
|
|
|
top = top < 0 ? 0 : top;
|
|
|
this.animView && this.animView.setNativeProps({
|
|
|
style: {
|
|
|
paddingTop: top,
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
this.lastValue = value;
|
|
|
}
|
|
|
|
|
|
_renderRow(rowData, sectionID, rowID, highlightRow) {
|
...
|
...
|
@@ -318,13 +313,8 @@ export default class User extends React.Component { |
|
|
|
|
|
_updateVerticalScrollValue(offsetY) {
|
|
|
|
|
|
let delta = userBgHieght-navbarHeight;
|
|
|
this.state.scrollValueV.setValue(offsetY/delta);
|
|
|
if (offsetY >= delta) {
|
|
|
this.state.listViewMarginTop.setValue(navbarHeight);
|
|
|
} else {
|
|
|
this.state.listViewMarginTop.setValue(0);
|
|
|
}
|
|
|
this.state.scrollValueV.setValue(offsetY/150);
|
|
|
this.state.listViewMarginTop.setValue(offsetY/150);
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
@@ -340,7 +330,7 @@ export default class User extends React.Component { |
|
|
ref={(c) => {
|
|
|
this.animView = c;
|
|
|
}}
|
|
|
style={{flex:1, backgroundColor: 'transparent', top: this.state.listViewTop}}
|
|
|
style={{flex:1, backgroundColor: 'transparent',}}
|
|
|
|
|
|
>
|
|
|
<ListView
|
...
|
...
|
|