|
|
@@ -1,6 +1,6 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.screen.faq;
|
|
|
|
|
|
-import android.app.Fragment;
|
|
|
+import android.graphics.Rect;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
@@ -15,6 +15,12 @@ import java.util.List;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.FAQBean;
|
|
|
+import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
|
|
|
+import kr.co.zumo.app.lifeplus.manager.ActionButtonManager;
|
|
|
+import kr.co.zumo.app.lifeplus.model.BlankModel;
|
|
|
+import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
+import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
+import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
|
|
|
/**
|
|
|
* MyFAQFragment
|
|
|
@@ -26,27 +32,53 @@ import kr.co.zumo.app.lifeplus.bean.api.FAQBean;
|
|
|
* @history 하세미 [2018-10-15] [최초 작성]
|
|
|
* @since 2018-10-15
|
|
|
*/
|
|
|
-public class MyFAQFragment extends Fragment {
|
|
|
+public class MyFAQFragment extends FragmentBase<MyFAQPresenter> {
|
|
|
|
|
|
private RecyclerView myFAQList;
|
|
|
private List<FAQBean> data;
|
|
|
|
|
|
@Override
|
|
|
- public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
- super.onCreate(savedInstanceState);
|
|
|
+ protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
|
|
|
+ View view = inflater.inflate(R.layout.fragment_my_faq, container, false);
|
|
|
+ return view;
|
|
|
}
|
|
|
|
|
|
- @Nullable
|
|
|
@Override
|
|
|
- public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
- View view = inflater.inflate(R.layout.fragment_my_faq, container, false);
|
|
|
+ protected void onAfterActivityCreated(Bundle savedInstanceState) {
|
|
|
setMyFAQList();
|
|
|
- myFAQList = view.findViewById(R.id.expandable_list_view_my_faq);
|
|
|
+ myFAQList = findViewById(R.id.expandable_list_view_my_faq);
|
|
|
myFAQList.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
|
|
|
MyFAQExpandableListViewAdapter adapter = new MyFAQExpandableListViewAdapter(data);
|
|
|
+ myFAQList.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
+ @Override
|
|
|
+ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
|
|
+ super.getItemOffsets(outRect, view, parent, state);
|
|
|
+ outRect.bottom = ResourceUtil.dpToPx(12);
|
|
|
+ }
|
|
|
+ });
|
|
|
myFAQList.setAdapter(adapter);
|
|
|
- return view;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void defineActionButton() {
|
|
|
+ ActionButtonManager.getInstance().begin().pencil(floatingActionButton -> {
|
|
|
+ presenter.onEvent(new Event.Builder(Event.FAQ).build());
|
|
|
+ }).show();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void defineActionBar() {
|
|
|
+ ActionBarManager.getInstance().begin().title(R.string.my_faq)
|
|
|
+ .menu(actionBar -> presenter.onClickMenu(actionBar))
|
|
|
+ .search(actionBar -> presenter.onClickSearch(actionBar))
|
|
|
+ .back(actionBar -> presenter.onClickBack(actionBar))
|
|
|
+ .show();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected MyFAQPresenter definePresenter() {
|
|
|
+ return new MyFAQPresenter(getModel(BlankModel.class), this);
|
|
|
}
|
|
|
|
|
|
public void setMyFAQList(){
|