瀏覽代碼

Merge branch 'develop' of https://github.com/swict/LifePlusAndroid into develop

hyodong.min 7 年之前
父節點
當前提交
52cf735557

+ 10 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/faq/FAQExpandableListViewAdapter.java

@@ -2,6 +2,7 @@ package kr.co.zumo.app.lifeplus.view.fragment.faq;
 
 import android.support.annotation.NonNull;
 import android.support.v7.widget.RecyclerView;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -48,13 +49,16 @@ public class FAQExpandableListViewAdapter extends RecyclerView.Adapter<RecyclerV
 
   @Override
   public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+
     FAQBean bean = data.get(position);
-    ((FAQExpandableViewHolder)holder).bind(bean);
-    ((FAQExpandableViewHolder)holder).itemView.setOnClickListener(new View.OnClickListener() {
+    ((FAQExpandableViewHolder) holder).bind(bean);
+    ((FAQExpandableViewHolder) holder).itemView.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View view) {
         boolean isExpand = bean.isExpanded();
         bean.setExpanded(!isExpand);
+        Log.e("APP#  FAQExpandableListViewAdapter | onBindViewHolder", "|" + position);
+        Log.e("APP#  FAQExpandableListViewAdapter | onClick", "|" + "expand 유무" + bean.isExpanded());
         notifyItemChanged(position);
       }
     });
@@ -74,14 +78,16 @@ public class FAQExpandableListViewAdapter extends RecyclerView.Adapter<RecyclerV
       super(itemView);
       textViewCategory = itemView.findViewById(R.id.faq_category);
       textViewQuestion = itemView.findViewById(R.id.faq_question);
-      buttonArrow =itemView.findViewById(R.id.button_open_arrow);
+      buttonArrow = itemView.findViewById(R.id.button_open_arrow);
       layoutAnswer = itemView.findViewById(R.id.layout_answer);
-      textViewAnswer =itemView.findViewById(R.id.faq_answer);
+      textViewAnswer = itemView.findViewById(R.id.faq_answer);
 
     }
 
     private void bind(FAQBean faqBean) {
       boolean expanded = faqBean.isExpanded();
+      Log.e("APP#  FAQExpandableViewHolder | bind", "|" + this + "," + faqBean.getId());
+      Log.e("APP#  FAQExpandableViewHolder | bind", "|" + expanded);
       layoutAnswer.setVisibility(expanded ? View.VISIBLE : View.GONE);
       buttonArrow.setImageResource(expanded ? R.drawable.icon_closearrow : R.drawable.icon_openarrow);
       textViewAnswer.setText(faqBean.getContents());

+ 4 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/faq/FAQFragment.java

@@ -44,11 +44,11 @@ public class FAQFragment extends Fragment {
     expandableListViewFaq = (RecyclerView) view.findViewById(R.id.expandable_list_view_faq);
     expandableListViewFaq.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL ,false));
     List<FAQBean> data = new ArrayList<>();
+    data.add(new FAQBean(0, "카테고리", "타이틀", "콘텐츠", "날짜"));
     data.add(new FAQBean(1, "카테고리", "타이틀", "콘텐츠", "날짜"));
-    data.add(new FAQBean(1, "카테고리", "타이틀", "콘텐츠", "날짜"));
-    data.add(new FAQBean(1, "카테고리", "타이틀", "콘텐츠", "날짜"));
-    data.add(new FAQBean(1, "카테고리", "타이틀", "콘텐츠", "날짜"));
-    data.add(new FAQBean(1, "카테고리", "타이틀", "콘텐츠", "날짜"));
+    data.add(new FAQBean(2, "카테고리", "타이틀", "콘텐츠", "날짜"));
+    data.add(new FAQBean(3, "카테고리", "타이틀", "콘텐츠", "날짜"));
+    data.add(new FAQBean(4, "카테고리", "타이틀", "콘텐츠", "날짜"));
     FAQExpandableListViewAdapter adapter = new FAQExpandableListViewAdapter(data);
     expandableListViewFaq.setAdapter(adapter);
     expandableListViewFaq.addItemDecoration(new RecyclerView.ItemDecoration() {