Browse Source

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

hyodong.min 6 years ago
parent
commit
01c7795614

+ 34 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/recommend/EventRecommendTagFragment.java

@@ -6,6 +6,7 @@ import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.constraint.ConstraintLayout;
+import android.support.design.widget.AppBarLayout;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.util.Log;
@@ -50,9 +51,11 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
   private LinearLayout layoutTagContents;
   private RecyclerView recyclerViewEventList;
   private ConstraintLayout layoutNothing;
+  private ConstraintLayout layoutSelectBucket;
   private LayoutInflater inflater;
   private HorizontalScrollView scrollTag;
   private EventRecommendTagAdapter adapter;
+  private AppBarLayout appBarLayout;
 
 
   @Override
@@ -68,9 +71,11 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
     textViewSelectTitle = findViewById(R.id.text_view_select_title);
     layoutNothing = findViewById(R.id.layout_nothing);
     layoutTagContents = findViewById(R.id.layout_contents);
+    layoutSelectBucket = findViewById(R.id.layout_select_bucket);
     scrollTag = findViewById(R.id.scroll_tag);
     recyclerViewEventList = findViewById(R.id.recycler_view_event_list_detail);
     layoutNothing = findViewById(R.id.layout_nothing);
+    appBarLayout = findViewById(R.id.app_bar_layout);
     inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
     recyclerViewEventList.addItemDecoration(new RecyclerView.ItemDecoration() {
@@ -81,7 +86,7 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
       }
     });
     recyclerViewEventList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
-
+    layoutSelectBucket.setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
     OverScrollDecoratorHelper.setUpOverScroll(recyclerViewEventList, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
   }
 
@@ -124,6 +129,7 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
 
     textViewEventTitle.setText(title);
     textViewSelectTitle.setText(subTitle);
+    addAppbarLayoutScrollChange();
   }
 
   @Override
@@ -134,15 +140,17 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
     else {
       int len = beans.size();
       EventTagBean bean;
+      StringBuffer stringBuffer = new StringBuffer();
       View view;
+      String tag = "";
       LayoutInflater inflater = LayoutInflater.from(getContext());
       for (int i = 0; i < len; ++i) {
         bean = beans.get(i);
         view = inflater.inflate(R.layout.tag, layoutTagContents, false);
         CheckBox checkBox = view.findViewById(R.id.check_box);
         checkBox.setText(String.format("#%s", bean.getTagName()));
-
         final int index = i;
+
         // 추천 컨텐츠가 아닌 경우에만 이벤트 등록
         if (bean.isRecommed()) {
           checkBox.setChecked(true);
@@ -154,11 +162,12 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
             presenter.onEvent(new Event.Builder(Event.TAG).index(index).bool(checkBox.isChecked()).build());
           });
         }
-
-
         layoutTagContents.addView(view);
+        stringBuffer.append(String.format("#%s", bean.getTagName()) + " ");
       }
 
+      Log.e("APP#  EventRecommendTagFragment | drawTag", "| tag" + stringBuffer.toString());
+      textViewSelectTitle.setText(stringBuffer.toString());
 //      OverScrollDecoratorHelper.setUpStaticOverScroll(scrollTag, OverScrollDecoratorHelper.ORIENTATION_HORIZONTAL);
     }
   }
@@ -198,4 +207,25 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
       Log.e("APP#  EventRecommendTagFragment | setCheckedTag", "|" + "Tag 가 모자랍니다.");
     }
   }
+
+  private void addAppbarLayoutScrollChange() {
+    appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
+      @Override
+      public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
+        if (Math.abs(verticalOffset) > (appBarLayout.getTotalScrollRange() >> 1)) {
+          // 줄어든 상태
+          textViewEventTitle.setVisibility(View.GONE);
+          textViewSelectTitle.setTextColor(getResources().getColor(R.color.CFFFFFF));
+          textViewSelectTitle.setTextSize(15);
+        }
+        else {
+          // 커진 상태
+          textViewEventTitle.setVisibility(View.VISIBLE);
+          textViewSelectTitle.setVisibility(View.VISIBLE);
+          textViewSelectTitle.setTextColor(getResources().getColor(R.color.CC3C3C3));
+          textViewSelectTitle.setTextSize(14);
+        }
+      }
+    });
+  }
 }

+ 16 - 15
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/my/bucketlist/BucketListWithTagDetailFragment.java

@@ -83,20 +83,6 @@ public class BucketListWithTagDetailFragment extends FragmentBase<BucketListWith
     recyclerViewBucketListDetail = findViewById(R.id.recycler_view_bucket_list_detail);
     appBarLayout = findViewById(R.id.app_bar_layout);
 
-//    appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
-//      @Override
-//      public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
-//        if (Math.abs(verticalOffset) > (appBarLayout.getTotalScrollRange() >> 1)) {
-//          // 줄어든 상태
-//          // textBucketTitle.setTextSize(14);
-//        }
-//        else {
-//          // 커진 상태
-//          //textBucketTitle.setTextSize(21);
-//        }
-//      }
-//    });
-
     setTagTitle(0);
 
     if (appBarLayout.getLayoutParams() != null) {
@@ -233,6 +219,7 @@ public class BucketListWithTagDetailFragment extends FragmentBase<BucketListWith
     // TODO: word wrap 추가예정
     str = str.replace(" ", "\u00A0");
     textBucketTitle.setText(str);
+    addAppbarLayoutScrollChange();
   }
 
   @Override
@@ -306,5 +293,19 @@ public class BucketListWithTagDetailFragment extends FragmentBase<BucketListWith
     });
   }
 
-
+  private void addAppbarLayoutScrollChange() {
+    appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
+      @Override
+      public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
+        if (Math.abs(verticalOffset) > (appBarLayout.getTotalScrollRange() >> 1)) {
+          // 줄어든 상태
+          textBucketTitle.setTextSize(14);
+        }
+        else {
+          // 커진 상태
+          textBucketTitle.setTextSize(21);
+        }
+      }
+    });
+  }
 }

+ 9 - 3
app/src/main/res/layout/event_select_type_recommend_tag.xml

@@ -64,6 +64,7 @@
         <android.support.constraint.ConstraintLayout
           android:id="@+id/layout_select_bucket"
           android:layout_width="wrap_content"
+          tools:paddingTop="100dp"
           android:layout_height="208dp"
           android:layout_gravity="center"
           app:layout_collapseMode="parallax">
@@ -73,24 +74,29 @@
             android:id="@+id/text_view_event_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="91dp"
+            android:layout_marginBottom="8dp"
             android:lineSpacingExtra="8sp"
             android:textColor="@color/CFFFFFF"
             android:textSize="21sp"
+            android:textStyle="bold"
+            app:layout_constraintBottom_toTopOf="@+id/text_view_select_title"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
-            tools:text="한화님이 좋아하는 데이트 유형은?"/>
+            app:layout_constraintVertical_chainStyle="packed"
+            tools:text="한화님이 좋아하는 데이트 유형은?"
+            tools:visibility="visible"/>
 
           <TextView
             android:id="@+id/text_view_select_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="8dp"
             android:gravity="center_horizontal"
             android:lineSpacingExtra="5.5sp"
             android:textColor="@color/CC3C3C3"
             android:textSize="14sp"
+            app:layout_constrainedHeight="true"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/text_view_event_title"