|
|
@@ -3,7 +3,6 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.view;
|
|
|
|
|
|
-import android.support.annotation.NonNull;
|
|
|
import android.support.design.widget.AppBarLayout;
|
|
|
import android.support.design.widget.CoordinatorLayout;
|
|
|
import android.support.v4.view.ViewCompat;
|
|
|
@@ -29,8 +28,9 @@ public class CustomScrollingViewBehavior extends AppBarLayout.ScrollingViewBehav
|
|
|
public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
|
|
|
|
|
|
super.onDependentViewChanged(parent, child, dependency);
|
|
|
+ final int height = parent.getHeight() - dependency.getBottom();
|
|
|
|
|
|
- child.getLayoutParams().height = parent.getHeight() - dependency.getBottom();
|
|
|
+ child.getLayoutParams().height = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY);
|
|
|
child.requestLayout();
|
|
|
|
|
|
return false;
|
|
|
@@ -94,6 +94,12 @@ public class CustomScrollingViewBehavior extends AppBarLayout.ScrollingViewBehav
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
|
|
|
+ // We depend on any AppBarLayouts
|
|
|
+ return dependency instanceof AppBarLayout;
|
|
|
+ }
|
|
|
+
|
|
|
AppBarLayout findFirstDependency(List<View> views) {
|
|
|
for (int i = 0, z = views.size(); i < z; i++) {
|
|
|
View view = views.get(i);
|
|
|
@@ -104,18 +110,26 @@ public class CustomScrollingViewBehavior extends AppBarLayout.ScrollingViewBehav
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type) {
|
|
|
- super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type);
|
|
|
-
|
|
|
-// Log.w("APP# CustomScrollingViewBehavior | onNestedScroll", "|" + " child: " + child);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View directTargetChild, @NonNull View target, int axes, int type) {
|
|
|
-// Log.w("APP# CustomScrollingViewBehavior | onStartNestedScroll", "| axes: " + axes + "type: " + type);
|
|
|
-// Log.w("APP# CustomScrollingViewBehavior | onStartNestedScroll", "|" + "-------------------------------------------------------");
|
|
|
- return super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, axes, type);
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public void onNestedPreScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View target, int dx, int dy, @NonNull int[] consumed, int type) {
|
|
|
+// Log.i("APP# CustomScrollingViewBehavior | onNestedPreScroll", "|" + " dx: " + dx + ", dy: " + dy + ", consumed: " + consumed);
|
|
|
+// Log.i("APP# CustomScrollingViewBehavior | onNestedPreScroll", "|" + "child: " + child + "\n target: " + target);
|
|
|
+// consumed[0] = dx;
|
|
|
+// consumed[1] = dy;
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int type) {
|
|
|
+// super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type);
|
|
|
+//
|
|
|
+//// Log.w("APP# CustomScrollingViewBehavior | onNestedScroll", "|" + " child: " + child);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View directTargetChild, @NonNull View target, int axes, int type) {
|
|
|
+//// Log.w("APP# CustomScrollingViewBehavior | onStartNestedScroll", "| axes: " + axes + "type: " + type);
|
|
|
+//// Log.w("APP# CustomScrollingViewBehavior | onStartNestedScroll", "|" + "-------------------------------------------------------");
|
|
|
+// return true;
|
|
|
+// }
|
|
|
|
|
|
}
|