|
@@ -28,6 +28,7 @@ import kr.co.zumo.app.lifeplus.bean.api.LifeplusContentsBean;
|
|
|
import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
|
|
import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.Event;
|
|
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 kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -46,13 +47,14 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendTagPre
|
|
|
private TextView textViewEventTitle;
|
|
private TextView textViewEventTitle;
|
|
|
private TextView textViewSelectTitle;
|
|
private TextView textViewSelectTitle;
|
|
|
private LinearLayout layoutTagContents;
|
|
private LinearLayout layoutTagContents;
|
|
|
- private RecyclerView recyclerViewEventList;
|
|
|
|
|
|
|
+ private RecyclerView recyclerView;
|
|
|
private ConstraintLayout layoutNothing;
|
|
private ConstraintLayout layoutNothing;
|
|
|
// private LayoutInflater inflater;
|
|
// private LayoutInflater inflater;
|
|
|
// private HorizontalScrollView scrollTag;
|
|
// private HorizontalScrollView scrollTag;
|
|
|
private EventRecommendTagAdapter adapter;
|
|
private EventRecommendTagAdapter adapter;
|
|
|
private LinearLayout layoutRecyclerViewContainer;
|
|
private LinearLayout layoutRecyclerViewContainer;
|
|
|
private AppBarLayout appBarLayout;
|
|
private AppBarLayout appBarLayout;
|
|
|
|
|
+ private OverScrollDriver overScrollDriver;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -70,21 +72,24 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendTagPre
|
|
|
layoutTagContents = findViewById(R.id.layout_contents);
|
|
layoutTagContents = findViewById(R.id.layout_contents);
|
|
|
ConstraintLayout layoutSelectBucket = findViewById(R.id.layout_select_bucket);
|
|
ConstraintLayout layoutSelectBucket = findViewById(R.id.layout_select_bucket);
|
|
|
// scrollTag = findViewById(R.id.scroll_tag);
|
|
// scrollTag = findViewById(R.id.scroll_tag);
|
|
|
- recyclerViewEventList = findViewById(R.id.recycler_view_event_list_detail);
|
|
|
|
|
|
|
+ recyclerView = findViewById(R.id.recycler_view_event_list_detail);
|
|
|
layoutNothing = findViewById(R.id.layout_nothing);
|
|
layoutNothing = findViewById(R.id.layout_nothing);
|
|
|
appBarLayout = findViewById(R.id.app_bar_layout);
|
|
appBarLayout = findViewById(R.id.app_bar_layout);
|
|
|
//inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
//inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
layoutRecyclerViewContainer = findViewById(R.id.layout_recycler_view_container);
|
|
layoutRecyclerViewContainer = findViewById(R.id.layout_recycler_view_container);
|
|
|
- recyclerViewEventList.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
|
|
|
|
+ recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
@Override
|
|
@Override
|
|
|
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
|
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
|
|
outRect.top = parent.getChildAdapterPosition(view) == 0 ? ResourceUtil.dpToPx(6) : ResourceUtil.dpToPx(10);
|
|
outRect.top = parent.getChildAdapterPosition(view) == 0 ? ResourceUtil.dpToPx(6) : ResourceUtil.dpToPx(10);
|
|
|
outRect.bottom = ResourceUtil.dpToPx(10);
|
|
outRect.bottom = ResourceUtil.dpToPx(10);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- recyclerViewEventList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
|
|
|
|
+ recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
layoutSelectBucket.setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
|
|
layoutSelectBucket.setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
|
|
|
- //.setUpOverScroll(recyclerViewEventList, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
|
|
|
|
|
|
|
+ //.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ overScrollDriver = new OverScrollDriver(recyclerView, appBarLayout);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -108,7 +113,7 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendTagPre
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onAfterDestroy() {
|
|
protected void onAfterDestroy() {
|
|
|
-
|
|
|
|
|
|
|
+ overScrollDriver.dispose();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -172,7 +177,7 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendTagPre
|
|
|
public void drawContents(List<? extends LifeplusContentsBean> beans) {
|
|
public void drawContents(List<? extends LifeplusContentsBean> beans) {
|
|
|
if (null == adapter) {
|
|
if (null == adapter) {
|
|
|
adapter = new EventRecommendTagAdapter(getContext(), beans, event -> presenter.onEvent(event));
|
|
adapter = new EventRecommendTagAdapter(getContext(), beans, event -> presenter.onEvent(event));
|
|
|
- recyclerViewEventList.setAdapter(adapter);
|
|
|
|
|
|
|
+ recyclerView.setAdapter(adapter);
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
adapter.update(beans);
|
|
adapter.update(beans);
|