|
|
@@ -7,6 +7,8 @@ import android.graphics.Rect;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
+import android.support.design.widget.AppBarLayout;
|
|
|
+import android.support.design.widget.CoordinatorLayout;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.view.LayoutInflater;
|
|
|
@@ -25,6 +27,7 @@ import kr.co.zumo.app.lifeplus.helper.NavigationBar;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.util.SoftKeyboardUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
+import kr.co.zumo.app.lifeplus.view.OverScrollDriver;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper;
|
|
|
|
|
|
@@ -45,6 +48,9 @@ public class SearchResultFragment extends FragmentBase<SearchResultPresenter> im
|
|
|
private RecyclerView recyclerViewCategory;
|
|
|
private View containerCategory;
|
|
|
private ImageView imageFilter;
|
|
|
+ private AppBarLayout appBarLayout;
|
|
|
+ private OverScrollDriver overScrollDriver;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
@@ -75,6 +81,7 @@ public class SearchResultFragment extends FragmentBase<SearchResultPresenter> im
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ appBarLayout = findViewById(R.id.app_bar_layout);
|
|
|
containerCategory = findViewById(R.id.collapsing_tool_bar);
|
|
|
recyclerViewCategory = findViewById(R.id.recycler_view_category);
|
|
|
recyclerViewCategory.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
|
|
|
@@ -94,6 +101,31 @@ public class SearchResultFragment extends FragmentBase<SearchResultPresenter> im
|
|
|
imageFilter.setOnClickListener(v -> {
|
|
|
presenter.onEvent(new Event.Builder(Event.FILTER).build());
|
|
|
});
|
|
|
+
|
|
|
+ if (appBarLayout.getLayoutParams() != null) {
|
|
|
+ CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams();
|
|
|
+ AppBarLayout.Behavior appBarLayoutBehaviour = new AppBarLayout.Behavior();
|
|
|
+ appBarLayoutBehaviour.setDragCallback(new AppBarLayout.Behavior.DragCallback() {
|
|
|
+ @Override
|
|
|
+ public boolean canDrag(@NonNull AppBarLayout appBarLayout) {
|
|
|
+// boolean isReturn;
|
|
|
+//
|
|
|
+// if (AppUtil.isDebug()) {
|
|
|
+// isReturn = true;
|
|
|
+// }
|
|
|
+// else {
|
|
|
+// isReturn = false;
|
|
|
+// }
|
|
|
+// return isReturn;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ layoutParams.setBehavior(appBarLayoutBehaviour);
|
|
|
+ overScrollDriver = new OverScrollDriver(recyclerViewResultContents, appBarLayout);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -115,7 +147,7 @@ public class SearchResultFragment extends FragmentBase<SearchResultPresenter> im
|
|
|
|
|
|
@Override
|
|
|
protected void onAfterDestroy() {
|
|
|
-
|
|
|
+ overScrollDriver.dispose();
|
|
|
}
|
|
|
|
|
|
@Override
|