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,7 +43,7 @@ public class CollapsingTopBarReactHeader extends ContentView implements Collapsi
43 43
 
44 44
     private void createVisibilityAnimator(int reactViewHeight) {
45 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 47
         visibilityAnimator.setOnHiddenListener(this);
48 48
         visibilityAnimator.setOnVisibleListener(this);
49 49
     }

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

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