|
@@ -38,21 +38,14 @@ public class CollapsingTopBarReactHeader extends ContentView implements Collapsi
|
38
|
38
|
listener = scrollListener;
|
39
|
39
|
ViewConfiguration vc = ViewConfiguration.get(context);
|
40
|
40
|
mTouchSlop = vc.getScaledTouchSlop();
|
41
|
|
- setViewMeasurer(new CollapsingReactHeaderMeasurer(this));
|
42
|
|
- createVisibilityAnimator(getHeight());
|
|
41
|
+ createVisibilityAnimator(params.reactViewHeight);
|
43
|
42
|
}
|
44
|
43
|
|
45
|
|
- private void createVisibilityAnimator(final int reactViewHeight) {
|
46
|
|
- ViewUtils.runOnPreDraw(this, new Runnable() {
|
47
|
|
- @Override
|
48
|
|
- public void run() {
|
49
|
|
- final CollapsingTopBarReactHeader header = CollapsingTopBarReactHeader.this;
|
50
|
|
- float height = ViewUtils.convertDpToPixel(reactViewHeight);
|
51
|
|
- visibilityAnimator = new CollapsingTopBarReactHeaderAnimator(header, height * 0.6f, height * 0.60f);
|
52
|
|
- visibilityAnimator.setOnHiddenListener(header);
|
53
|
|
- visibilityAnimator.setOnVisibleListener(header);
|
54
|
|
- }
|
55
|
|
- });
|
|
44
|
+ private void createVisibilityAnimator(int reactViewHeight) {
|
|
45
|
+ float height = ViewUtils.convertDpToPixel(reactViewHeight);
|
|
46
|
+ visibilityAnimator = new CollapsingTopBarReactHeaderAnimator(this, height * 0.6f, height * 0.60f);
|
|
47
|
+ visibilityAnimator.setOnHiddenListener(this);
|
|
48
|
+ visibilityAnimator.setOnVisibleListener(this);
|
56
|
49
|
}
|
57
|
50
|
|
58
|
51
|
public void collapse(float amount) {
|