|
|
@@ -35,6 +35,7 @@ public class MyFAQFragment extends FragmentBase<MyFAQPresenter> implements IMyFa
|
|
|
|
|
|
private RecyclerView myFAQList;
|
|
|
private View viewRequestNotification;
|
|
|
+ private View viewNoQuestion;
|
|
|
|
|
|
@Override
|
|
|
protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
@@ -45,6 +46,8 @@ public class MyFAQFragment extends FragmentBase<MyFAQPresenter> implements IMyFa
|
|
|
|
|
|
@Override
|
|
|
protected void onAfterActivityCreated(Bundle savedInstanceState) {
|
|
|
+ myFAQList = findViewById(R.id.expandable_list_view_my_faq);
|
|
|
+ viewNoQuestion = findViewById(R.id.layout_my_faq_none);
|
|
|
viewRequestNotification = findViewById(R.id.text_view_my_faq_notice);
|
|
|
viewRequestNotification.setOnClickListener(v -> presenter.onEvent(new Event.Builder(Event.CLICK).build()));
|
|
|
}
|
|
|
@@ -89,17 +92,24 @@ public class MyFAQFragment extends FragmentBase<MyFAQPresenter> implements IMyFa
|
|
|
public void drawList(List<QuestionBean> beans) {
|
|
|
|
|
|
Log.i("APP# MyFAQFragment | drawList", "|" + beans.toString());
|
|
|
-
|
|
|
- myFAQList = findViewById(R.id.expandable_list_view_my_faq);
|
|
|
- myFAQList.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
|
|
|
- MyFAQExpandableListViewAdapter adapter = new MyFAQExpandableListViewAdapter(beans);
|
|
|
- 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);
|
|
|
+ if (beans.size() > 0) {
|
|
|
+ viewNoQuestion.setVisibility(View.GONE);
|
|
|
+ myFAQList.setVisibility(View.VISIBLE);
|
|
|
+
|
|
|
+ myFAQList.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
|
|
|
+ MyFAQExpandableListViewAdapter adapter = new MyFAQExpandableListViewAdapter(beans);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ viewNoQuestion.setVisibility(View.VISIBLE);
|
|
|
+ myFAQList.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
}
|
|
|
}
|