|
@@ -184,45 +184,40 @@ export default class User extends React.Component { |
|
@@ -184,45 +184,40 @@ export default class User extends React.Component { |
184
|
|
184
|
|
185
|
setAnimationValue({ value, }) {
|
185
|
setAnimationValue({ value, }) {
|
186
|
|
186
|
|
187
|
- console.log('value = ' + value);
|
187
|
+ if (value < 0) {
|
|
|
188
|
+ return;
|
|
|
189
|
+ }
|
|
|
190
|
+
|
|
|
191
|
+ if (this.lastValue > value) {
|
|
|
192
|
+ //down
|
|
|
193
|
+ if (value < 2) {
|
|
|
194
|
+ // let top = 64 * (value - 0.8);
|
|
|
195
|
+ let top = 64 * (value - 0.5);
|
|
|
196
|
+ top = top > 64 ? 64 : top;
|
|
|
197
|
+ top = top < 0 ? 0 : top;
|
188
|
this.animView && this.animView.setNativeProps({
|
198
|
this.animView && this.animView.setNativeProps({
|
189
|
style: {
|
199
|
style: {
|
190
|
- top: value,
|
200
|
+ paddingTop: top,
|
191
|
},
|
201
|
},
|
192
|
});
|
202
|
});
|
193
|
- //
|
|
|
194
|
- // if (value < 0) {
|
|
|
195
|
- // return;
|
|
|
196
|
- // }
|
|
|
197
|
- //
|
|
|
198
|
- // if (this.lastValue > value) {
|
|
|
199
|
- // //down
|
|
|
200
|
- // if (value < 2) {
|
|
|
201
|
- // let top = 64 * (value - 1);
|
|
|
202
|
- // top = top > 64 ? 64 : top;
|
|
|
203
|
- // top = top < 0 ? 0 : top;
|
|
|
204
|
- // this.animView && this.animView.setNativeProps({
|
|
|
205
|
- // style: {
|
|
|
206
|
- // top,
|
|
|
207
|
- // },
|
|
|
208
|
- // });
|
|
|
209
|
- // }
|
|
|
210
|
- //
|
|
|
211
|
- // } else {
|
|
|
212
|
- // //up
|
|
|
213
|
- // if (value > 0.9) {
|
203
|
+ }
|
|
|
204
|
+
|
|
|
205
|
+ } else {
|
|
|
206
|
+ //up
|
|
|
207
|
+ if (value > 0.5) {
|
214
|
// let top = 64 * (value - 0.6)
|
208
|
// let top = 64 * (value - 0.6)
|
215
|
- // top = top > 64 ? 64 : top;
|
|
|
216
|
- // top = top < 0 ? 0 : top;
|
|
|
217
|
- // this.animView && this.animView.setNativeProps({
|
|
|
218
|
- // style: {
|
|
|
219
|
- // top,
|
|
|
220
|
- // },
|
|
|
221
|
- // });
|
|
|
222
|
- // }
|
|
|
223
|
- //
|
|
|
224
|
- // }
|
|
|
225
|
- // this.lastValue = value;
|
209
|
+ let top = 64 * (value - 0.5)
|
|
|
210
|
+ top = top > 64 ? 64 : top;
|
|
|
211
|
+ top = top < 0 ? 0 : top;
|
|
|
212
|
+ this.animView && this.animView.setNativeProps({
|
|
|
213
|
+ style: {
|
|
|
214
|
+ paddingTop: top,
|
|
|
215
|
+ },
|
|
|
216
|
+ });
|
|
|
217
|
+ }
|
|
|
218
|
+
|
|
|
219
|
+ }
|
|
|
220
|
+ this.lastValue = value;
|
226
|
}
|
221
|
}
|
227
|
|
222
|
|
228
|
_renderRow(rowData, sectionID, rowID, highlightRow) {
|
223
|
_renderRow(rowData, sectionID, rowID, highlightRow) {
|
|
@@ -318,13 +313,8 @@ export default class User extends React.Component { |
|
@@ -318,13 +313,8 @@ export default class User extends React.Component { |
318
|
|
313
|
|
319
|
_updateVerticalScrollValue(offsetY) {
|
314
|
_updateVerticalScrollValue(offsetY) {
|
320
|
|
315
|
|
321
|
- let delta = userBgHieght-navbarHeight;
|
|
|
322
|
- this.state.scrollValueV.setValue(offsetY/delta);
|
|
|
323
|
- if (offsetY >= delta) {
|
|
|
324
|
- this.state.listViewMarginTop.setValue(navbarHeight);
|
|
|
325
|
- } else {
|
|
|
326
|
- this.state.listViewMarginTop.setValue(0);
|
|
|
327
|
- }
|
316
|
+ this.state.scrollValueV.setValue(offsetY/150);
|
|
|
317
|
+ this.state.listViewMarginTop.setValue(offsetY/150);
|
328
|
|
318
|
|
329
|
}
|
319
|
}
|
330
|
|
320
|
|
|
@@ -340,7 +330,7 @@ export default class User extends React.Component { |
|
@@ -340,7 +330,7 @@ export default class User extends React.Component { |
340
|
ref={(c) => {
|
330
|
ref={(c) => {
|
341
|
this.animView = c;
|
331
|
this.animView = c;
|
342
|
}}
|
332
|
}}
|
343
|
- style={{flex:1, backgroundColor: 'transparent', top: this.state.listViewTop}}
|
333
|
+ style={{flex:1, backgroundColor: 'transparent',}}
|
344
|
|
334
|
|
345
|
>
|
335
|
>
|
346
|
<ListView
|
336
|
<ListView
|