|
@@ -7,6 +7,7 @@ import android.support.annotation.Nullable;
|
|
|
import android.support.v4.view.PagerAdapter;
|
|
import android.support.v4.view.PagerAdapter;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
|
|
+import android.util.Log;
|
|
|
import android.util.SparseArray;
|
|
import android.util.SparseArray;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
@@ -74,6 +75,8 @@ public class NotiViewPagerAdapter extends PagerAdapter {
|
|
|
@NonNull
|
|
@NonNull
|
|
|
@Override
|
|
@Override
|
|
|
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
|
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
|
|
|
|
+ Log.e("APP# NotiViewPagerAdapter | instantiateItem, 77", "position |" + position);
|
|
|
|
|
+
|
|
|
View view = inflater.inflate(R.layout.fragment_noti_list, container, false);
|
|
View view = inflater.inflate(R.layout.fragment_noti_list, container, false);
|
|
|
recyclerView = view.findViewById(R.id.recycler_view_alarm_list);
|
|
recyclerView = view.findViewById(R.id.recycler_view_alarm_list);
|
|
|
layoutNothing = view.findViewById(R.id.layout_nothing);
|
|
layoutNothing = view.findViewById(R.id.layout_nothing);
|
|
@@ -176,4 +179,30 @@ public class NotiViewPagerAdapter extends PagerAdapter {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public void setFocusPage(int position) {
|
|
|
|
|
+ Log.e("APP# NotiViewPagerAdapter | setFocusPage, 185", "position |" + position);
|
|
|
|
|
+ Log.e("APP# NotiViewPagerAdapter | setFocusPage, 186", "type |" + NoticeBean.getCategoryName(position));
|
|
|
|
|
+ if (null != notiListAdapter) {
|
|
|
|
|
+ if (NoticeBean.CATEGORY_NOTICE.equals(NoticeBean.getCategoryName(position))) {
|
|
|
|
|
+ // 공지 탭 보여질 때 첫 번째 아이템 확장
|
|
|
|
|
+ notiListAdapter.expand(0, true);
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (NoticeBean.CATEGORY_ALL.equals(NoticeBean.getCategoryName(position))) {
|
|
|
|
|
+ // 전체 탭 모든 아이탬 축소
|
|
|
|
|
+ notiListAdapter.collapseDataAll();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ if (null != recyclerView) {
|
|
|
|
|
+ recyclerView.scrollToPosition(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
|
|
|
|
|
+ container.removeView((View) object);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|