|
|
@@ -8,6 +8,7 @@ import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
+import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
import kr.co.zumo.app.lifeplus.view.IEventListener;
|
|
|
|
|
|
/**
|
|
|
@@ -24,12 +25,19 @@ public class SettingExpandableListViewAdapter extends RecyclerView.Adapter<Setti
|
|
|
|
|
|
private Context context;
|
|
|
private IEventListener listener;
|
|
|
+ private RecyclerView recyclerView;
|
|
|
|
|
|
public SettingExpandableListViewAdapter(Context context, IEventListener listener) {
|
|
|
this.context = context;
|
|
|
this.listener = listener;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
|
|
+ super.onAttachedToRecyclerView(recyclerView);
|
|
|
+
|
|
|
+ this.recyclerView = recyclerView;
|
|
|
+ }
|
|
|
|
|
|
@NonNull
|
|
|
@Override
|
|
|
@@ -68,7 +76,12 @@ public class SettingExpandableListViewAdapter extends RecyclerView.Adapter<Setti
|
|
|
|
|
|
holder.bind(event -> {
|
|
|
if (null != listener) {
|
|
|
- listener.onEvent(event);
|
|
|
+ if (event.getEventId() == Event.TOGGLE) {
|
|
|
+ recyclerView.scrollToPosition(event.getInteger());
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ listener.onEvent(event);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|