|
|
@@ -3,6 +3,8 @@ package kr.co.zumo.app.lifeplus.view.screen.category.type1;
|
|
|
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.GridLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.util.Log;
|
|
|
@@ -40,6 +42,7 @@ import kr.co.zumo.app.lifeplus.view.screen.category.IFirstCategoryMainView;
|
|
|
*/
|
|
|
public class FirstCategoryMainFragment extends FragmentBase<FirstCategoryMainPresenter> implements IFirstCategoryMainView {
|
|
|
|
|
|
+ private AppBarLayout appBarLayout;
|
|
|
private MainSeriesView mainSeriesView;
|
|
|
private RecyclerView recyclerViewFirstCategoryMain;
|
|
|
private View viewFilter;
|
|
|
@@ -55,6 +58,7 @@ public class FirstCategoryMainFragment extends FragmentBase<FirstCategoryMainPre
|
|
|
|
|
|
@Override
|
|
|
protected void onAfterActivityCreated(Bundle savedInstanceState) {
|
|
|
+ appBarLayout = findViewById(R.id.app_bar_layout);
|
|
|
mainSeriesView = findViewById(R.id.series_image_text_view);
|
|
|
recyclerViewFirstCategoryMain = findViewById(R.id.recycler_view_first_category_main);
|
|
|
recyclerViewFirstCategoryMain.addItemDecoration(new GridItemDecoration(getActivity(), ResourceUtil.dpToPx(4)));
|
|
|
@@ -140,12 +144,25 @@ public class FirstCategoryMainFragment extends FragmentBase<FirstCategoryMainPre
|
|
|
@Override
|
|
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
presenter.onEvent(new Event.Builder(Event.ORDER).index(position).build());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onNothingSelected(AdapterView<?> parent) {}
|
|
|
});
|
|
|
|
|
|
+ // TODO: 스피너 변경후 appbarlayout expand되어야함
|
|
|
+ spinnerOrder.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onFocusChange(View view, boolean b) {
|
|
|
+ recyclerViewFirstCategoryMain.smoothScrollToPosition(0);
|
|
|
+ CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams();
|
|
|
+ AppBarLayout.Behavior behavior = (AppBarLayout.Behavior) params.getBehavior();
|
|
|
+ behavior.setTopAndBottomOffset(0);
|
|
|
+ behavior.onNestedPreScroll((CoordinatorLayout) appBarLayout.getParent(), appBarLayout, null, 0, 1, new int[2],0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|