Browse Source

Minor tweak to show hide header threshold value

Guy Carmeli 7 years ago
parent
commit
927e929b36

+ 1
- 1
android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingTopBarReactHeader.java View File

43
 
43
 
44
     private void createVisibilityAnimator(int reactViewHeight) {
44
     private void createVisibilityAnimator(int reactViewHeight) {
45
         float height = ViewUtils.convertDpToPixel(reactViewHeight);
45
         float height = ViewUtils.convertDpToPixel(reactViewHeight);
46
-        visibilityAnimator = new CollapsingTopBarReactHeaderAnimator(this, height / 2, height / 2);
46
+        visibilityAnimator = new CollapsingTopBarReactHeaderAnimator(this, height * 0.6f, height * 0.60f);
47
         visibilityAnimator.setOnHiddenListener(this);
47
         visibilityAnimator.setOnHiddenListener(this);
48
         visibilityAnimator.setOnVisibleListener(this);
48
         visibilityAnimator.setOnVisibleListener(this);
49
     }
49
     }

+ 3
- 0
android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingTopBarReactHeaderAnimator.java View File

1
 package com.reactnativenavigation.views.collapsingToolbar;
1
 package com.reactnativenavigation.views.collapsingToolbar;
2
 
2
 
3
+import android.util.Log;
3
 import android.view.animation.DecelerateInterpolator;
4
 import android.view.animation.DecelerateInterpolator;
4
 import android.view.animation.Interpolator;
5
 import android.view.animation.Interpolator;
5
 
6
 
47
     }
48
     }
48
 
49
 
49
     private boolean shouldShow(float collapse) {
50
     private boolean shouldShow(float collapse) {
51
+        Log.i("shouldShow", "collapse: " + collapse + "[" + showThreshold + "]");
50
         return Math.abs(collapse) < showThreshold && state == Invisible;
52
         return Math.abs(collapse) < showThreshold && state == Invisible;
51
     }
53
     }
52
 
54
 
53
     private boolean shouldHide(float collapse) {
55
     private boolean shouldHide(float collapse) {
56
+        Log.i("shouldHide", "collapse: " + collapse + "[" + hideThreshold + "]");
54
         return Math.abs(collapse) >= hideThreshold && state == Visible;
57
         return Math.abs(collapse) >= hideThreshold && state == Visible;
55
     }
58
     }
56
 
59