Procházet zdrojové kódy

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

hyodong.min před 7 roky
rodič
revize
960e221902

+ 16 - 5
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsListicleCoverHolder.java

@@ -7,6 +7,9 @@ import android.widget.TextView;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailBean;
 import kr.co.zumo.app.lifeplus.util.StringUtil;
@@ -31,6 +34,7 @@ public class ContentsListicleCoverHolder extends ContentsHolder<ContentsDetailBe
   private TextView textViewSubTitle;
   private TextView textViewTitle;
   private TextView textViewTag1;
+  private TextView textViewTag2;
   private TextView textViewCopyRight;
   private View viewBar;
   private String seriesTitle;
@@ -44,9 +48,9 @@ public class ContentsListicleCoverHolder extends ContentsHolder<ContentsDetailBe
     textViewSubTitle = itemView.findViewById(R.id.text_view_sub_title);
     textViewTitle = itemView.findViewById(R.id.text_view_title);
     textViewTag1 = itemView.findViewById(R.id.text_view_tag1);
+    textViewTag2 = itemView.findViewById(R.id.text_view_tag2);
     textViewCopyRight = itemView.findViewById(R.id.text_view_copy_right);
     viewBar = itemView.findViewById(R.id.view_bar);
-
     this.seriesTitle = seriesTitle;
   }
 
@@ -73,15 +77,21 @@ public class ContentsListicleCoverHolder extends ContentsHolder<ContentsDetailBe
 
     textViewSubTitle.setText(bean.getSubTitle());
     textViewTitle.setText(bean.getTwoLineTitle());
-    StringBuilder stringBuilder = new StringBuilder();
     int len = bean.getTagList().size();
     len = Math.min(len, 2);
+
+    List<TextView> tagTextViewList = new ArrayList<>();
+    tagTextViewList.add(textViewTag1);
+    tagTextViewList.add(textViewTag2);
+
     for (int i = 0; i < len; i++) {
-      stringBuilder.append(String.format("#%s", bean.getTagList().get(i).getTagName())).append("      ");
+      StringBuilder stringBuilder = new StringBuilder();
+      stringBuilder.append(String.format("#%s", bean.getTagList().get(i).getTagName()));
+      tagTextViewList.get(i).setText(stringBuilder.toString());
+      int tagIndex = i;
+      tagTextViewList.get(i).setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.TAG).index(tagIndex).build());});
     }
 
-    textViewTag1.setText(stringBuilder.toString());
-
     // TODO: copyright 처리
     if (null != bean.getCopyRight()) {
       textViewCopyRight.setText(bean.getCopyRight());
@@ -91,6 +101,7 @@ public class ContentsListicleCoverHolder extends ContentsHolder<ContentsDetailBe
     }
 
     imageViewArrow.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.SCROLL).build());});
+
   }
 
   @Override

+ 5 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsPresenter.java

@@ -162,6 +162,11 @@ public class ContentsPresenter extends ContentsBasePresenter<ContentsModel, ICon
         //표지 클릭시 다음 페이지 이동
         view.setSmoothScrollToPosition(1);
         break;
+      case Event.TAG:
+        //리스티클 표지에서 태그 클릭시 태그검색이동
+        // TODO:  추후 구현 예정
+        showErrorDialog(R.string.ready_comment);
+        break;
       default:
         break;
     }

+ 3 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/notification/NotiFragment.java

@@ -37,6 +37,7 @@ public class NotiFragment extends FragmentBase<NotiPresenter> implements INotiVi
   public static final int CATEGORY_KEY_MEMBER = 1;
   public static final int CATEGORY_KEY_BENEFIT = 2;
   private TabLayout tabLayoutAlarm;
+  private TabLayout tabBarLayoutAlarm;
   private ViewPager viewPagerAlarm;
 
   @Override
@@ -49,7 +50,7 @@ public class NotiFragment extends FragmentBase<NotiPresenter> implements INotiVi
     tabLayoutAlarm = findViewById(R.id.alarm_tab_layout);
     viewPagerAlarm = findViewById(R.id.alarm_view_pager);
     tabLayoutAlarm.setTabGravity(TabLayout.GRAVITY_FILL);
-
+    tabBarLayoutAlarm = findViewById(R.id.noti_tab_bar);
   }
 
   @Override
@@ -96,6 +97,7 @@ public class NotiFragment extends FragmentBase<NotiPresenter> implements INotiVi
     String[] tab = {CATEGORY_ALL, CATEGORY_NEWS, CATEGORY_NOTICE};
     NotiPagerAdapter notiPagerAdapter = new NotiPagerAdapter(getChildFragmentManager(), tab, beans);
     tabLayoutAlarm.setupWithViewPager(viewPagerAlarm, true);
+    tabBarLayoutAlarm.setupWithViewPager(viewPagerAlarm, true);
     viewPagerAlarm.setAdapter(notiPagerAdapter);
     notiPagerAdapter.notifyDataSetChanged();
   }

+ 1 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/notification/NotiListFragment.java

@@ -98,6 +98,7 @@ public class NotiListFragment extends Fragment {
     recyclerViewAlarmList = getView().findViewById(R.id.recycler_view_alarm_list);
     NotiListAdapter notiListAdapter = new NotiListAdapter(notificationBeans);
     recyclerViewAlarmList.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
+    recyclerViewAlarmList.setAdapter(notiListAdapter);
     recyclerViewAlarmList.addItemDecoration(new RecyclerView.ItemDecoration() {
       @Override
       public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
@@ -105,7 +106,6 @@ public class NotiListFragment extends Fragment {
         outRect.bottom = ResourceUtil.dpToPx(12);
       }
     });
-    recyclerViewAlarmList.setAdapter(notiListAdapter);
   }
 
   interface INotiListFragmentListener {

+ 3 - 1
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/notification/NotiTextLinkViewHolder.java

@@ -1,6 +1,7 @@
 package kr.co.zumo.app.lifeplus.view.screen.notification;
 
 import android.view.View;
+import android.widget.ImageView;
 import android.widget.TextView;
 
 import kr.co.zumo.app.R;
@@ -24,6 +25,7 @@ public class NotiTextLinkViewHolder extends NotiViewHolder {
   protected TextView textViewAlarmDate;
   protected TextView textViewAlarmDetail;
   protected TextView textViewShowContents;
+  protected ImageView imageViewArrow;
 
   public NotiTextLinkViewHolder(View itemView) {
     super(itemView);
@@ -32,7 +34,7 @@ public class NotiTextLinkViewHolder extends NotiViewHolder {
     textViewAlarmDate = itemView.findViewById(R.id.text_view_date);
     textViewAlarmDetail = itemView.findViewById(R.id.text_view_detail);
     textViewShowContents = itemView.findViewById(R.id.text_view_show_contents);
-
+    imageViewArrow = itemView.findViewById(R.id.image_view_open_arrow);
   }
 
   @Override

+ 1 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/notification/NotiTextViewHolder.java

@@ -20,6 +20,7 @@ public class NotiTextViewHolder extends NotiTextLinkViewHolder {
 
   @Override
   protected void setLink() {
+    imageViewArrow.setVisibility(View.GONE);
     textViewShowContents.setVisibility(View.GONE);
   }
 }

+ 12 - 5
app/src/main/res/layout/contents_listicle_cover.xml

@@ -91,7 +91,7 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginStart="30dp"
-    android:layout_marginBottom="15dp"
+    android:layout_marginBottom="5dp"
     android:lineSpacingExtra="7dp"
     android:textColor="@color/CFFFFFF"
     android:textSize="28sp"
@@ -106,9 +106,13 @@
     android:id="@+id/text_view_tag1"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    android:layout_marginStart="30dp"
-    android:layout_marginBottom="49dp"
+    android:layout_marginStart="25dp"
+    android:layout_marginBottom="39dp"
     android:lineSpacingExtra="4dp"
+    android:paddingTop="10dp"
+    android:paddingBottom="10dp"
+    android:paddingStart="5dp"
+    android:paddingEnd="5dp"
     android:textColor="@color/CFFFFFF"
     android:textSize="12dp"
     app:layout_constraintBottom_toBottomOf="parent"
@@ -119,8 +123,11 @@
     android:id="@+id/text_view_tag2"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    android:layout_marginStart="16dp"
-    android:layout_marginBottom="8dp"
+    android:layout_marginStart="6dp"
+    android:paddingTop="10dp"
+    android:paddingBottom="10dp"
+    android:paddingStart="5dp"
+    android:paddingEnd="5dp"
     android:lineSpacingExtra="2dp"
     android:textColor="@color/CFFFFFF"
     android:textSize="12sp"

+ 3 - 3
app/src/main/res/layout/fragment_faq_list.xml

@@ -12,13 +12,13 @@
     android:id="@+id/expandable_list_view_faq"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginBottom="10dp"
     android:layout_marginLeft="25dp"
     android:layout_marginRight="25dp"
-    android:paddingTop="26dp"
+    android:layout_marginBottom="10dp"
+    android:clipToPadding="false"
     android:divider="@color/CFFFFFF"
     android:dividerHeight="50dp"
-    android:clipToPadding="false"
+    android:paddingTop="26dp"
     >
   </android.support.v7.widget.RecyclerView>
 

+ 56 - 13
app/src/main/res/layout/fragment_noti.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
+<android.support.design.widget.CoordinatorLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
@@ -9,27 +9,70 @@
   android:background="@color/CFFFFFF"
   android:orientation="vertical">
 
-  <android.support.design.widget.TabLayout
-    android:id="@+id/alarm_tab_layout"
+  <android.support.design.widget.AppBarLayout
     android:layout_width="match_parent"
-    android:layout_height="55dp"
-    android:layout_marginLeft="25dp"
-    android:layout_marginRight="25dp"
+    android:layout_height="wrap_content"
     android:background="@color/CFFFFFF"
-    app:tabBackground="@drawable/tab_indicator"
-    app:tabGravity="center"
-    app:tabIndicatorColor="@color/C000000"/>
+    app:elevation="0dp"
+    >
 
-  <RelativeLayout
+    <android.support.design.widget.CollapsingToolbarLayout
+      android:id="@+id/collapsing_tool_bar"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:background="@color/CFFFFFF"
+      app:layout_scrollFlags="scroll|exitUntilCollapsed">
+
+      <android.support.design.widget.TabLayout
+        android:id="@+id/alarm_tab_layout"
+        android:layout_width="match_parent"
+        android:layout_height="55dp"
+        android:layout_marginStart="25dp"
+        android:layout_marginEnd="25dp"
+        app:layout_collapseMode="parallax"
+        app:tabIndicatorHeight="0dp"/>
+
+      <android.support.v7.widget.Toolbar
+        android:id="@+id/toolbar_invisible"
+        android:layout_width="match_parent"
+        android:layout_height="30dp"
+        android:background="@null"
+        android:visibility="invisible"
+        app:elevation="0dp"
+        app:layout_collapseMode="pin"
+        app:layout_scrollFlags="scroll"
+        tools:visibility="visible"
+        />
+
+    </android.support.design.widget.CollapsingToolbarLayout>
+
+    <android.support.design.widget.TabLayout
+      android:id="@+id/noti_tab_bar"
+      android:layout_width="match_parent"
+      android:layout_height="3dp"
+      android:layout_gravity="bottom"
+      android:layout_marginStart="25dp"
+      android:layout_marginEnd="25dp"
+      android:clickable="false"
+      app:tabBackground="@color/CEBEBEB"
+      app:tabIndicatorHeight="3dp"
+      app:tabTextColor="@color/CEBEBEB"
+      />
+
+  </android.support.design.widget.AppBarLayout>
+
+  <LinearLayout
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    app:layout_behavior="@string/appbar_scrolling_view_behavior"
+    >
 
     <android.support.v4.view.ViewPager
       android:id="@+id/alarm_view_pager"
       android:layout_width="match_parent"
       android:layout_height="match_parent"/>
 
-  </RelativeLayout>
+  </LinearLayout>
 
 
-</LinearLayout>
+</android.support.design.widget.CoordinatorLayout>

+ 5 - 4
app/src/main/res/layout/fragment_noti_list.xml

@@ -10,14 +10,15 @@
 
   <android.support.v7.widget.RecyclerView
     android:id="@+id/recycler_view_alarm_list"
+    android:clipToPadding="false"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginBottom="10dp"
-    android:layout_marginLeft="25dp"
-    android:layout_marginRight="25dp"
-    android:layout_marginTop="26dp"
+    android:layout_marginStart="25dp"
+    android:layout_marginEnd="25dp"
+    android:paddingTop="20dp"
     android:divider="@color/CFFFFFF"
-    android:dividerHeight="50dp">
+    android:dividerHeight="26dp">
 
   </android.support.v7.widget.RecyclerView>
 

+ 13 - 6
app/src/main/res/layout/noti_image_text_contents.xml

@@ -24,13 +24,15 @@
 
   <TextView
     android:id="@+id/text_view_title"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginStart="23dp"
     android:layout_marginTop="5dp"
+    android:layout_marginEnd="23dp"
     android:lineSpacingExtra="6sp"
     android:textColor="@color/C333333"
     android:textSize="14sp"
+    app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
     app:layout_constraintTop_toBottomOf="@+id/text_view_category"
     tools:text="디뮤지엄 전시회 티켓 증정 이벤트"
@@ -52,13 +54,15 @@
 
   <TextView
     android:id="@+id/text_view_detail"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginStart="23dp"
     android:layout_marginTop="17dp"
+    android:layout_marginEnd="23dp"
     android:lineSpacingExtra="10sp"
     android:textColor="@color/C999999"
     android:textSize="12sp"
+    app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
     app:layout_constraintTop_toBottomOf="@+id/text_view_date"
     tools:text="이벤트에 참여해주시는 분들이 많아지는만큼,관련하여
@@ -68,12 +72,15 @@
 
   <ImageView
     android:id="@+id/image_view_contents"
-    android:layout_width="266dp"
+    android:layout_width="match_parent"
     android:layout_height="175dp"
     android:layout_marginStart="23dp"
     android:layout_marginTop="12dp"
-    android:scaleType="fitXY"
+    android:layout_marginEnd="23dp"
+    android:scaleType="centerCrop"
+    app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
+
     app:layout_constraintTop_toBottomOf="@+id/text_view_detail"
     tools:src="@drawable/img_bestbucket_banner_1"/>
 
@@ -100,11 +107,11 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginStart="2dp"
-    android:layout_marginBottom="25dp"
     android:rotation="-90"
     android:scaleType="center"
-    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintBottom_toBottomOf="@+id/text_view_show_contents"
     app:layout_constraintStart_toEndOf="@+id/text_view_show_contents"
+    app:layout_constraintTop_toTopOf="@+id/text_view_show_contents"
     app:srcCompat="@drawable/icon_openarrow"/>
 
 

+ 16 - 11
app/src/main/res/layout/noti_text_contents.xml

@@ -24,15 +24,18 @@
 
   <TextView
     android:id="@+id/text_view_title"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginStart="23dp"
     android:layout_marginTop="5dp"
+    android:layout_marginEnd="23dp"
     android:lineSpacingExtra="6sp"
     android:textColor="@color/C333333"
     android:textSize="14sp"
+    app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
     app:layout_constraintTop_toBottomOf="@+id/text_view_category"
+    app:layout_goneMarginEnd="23dp"
     tools:text="포인트 소멸 안내3일 이내 포인트가 소멸될 예정입니다.
 기간 내 포인트 혜택을 누려보세요.3일 이내 포인트가 소멸될 예정입니다.
 기간 내 포인트 혜택을 누려보세요.3일 이내 포인트가 소멸될 예정입니다.
@@ -55,14 +58,16 @@
 
   <TextView
     android:id="@+id/text_view_detail"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:layout_marginStart="23dp"
     android:layout_marginTop="17dp"
+    android:layout_marginEnd="23dp"
     android:lineSpacingExtra="10sp"
     android:textColor="@color/C999999"
     android:textSize="12sp"
     app:layout_constraintBottom_toTopOf="@+id/text_view_show_contents"
+    app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
     app:layout_constraintTop_toBottomOf="@+id/text_view_date"
     app:layout_goneMarginBottom="23dp"
@@ -84,32 +89,32 @@
     android:id="@+id/text_view_show_contents"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    android:layout_marginStart="23dp"
     android:layout_marginTop="12dp"
     android:layout_marginBottom="23dp"
     android:gravity="center_horizontal"
     android:lineSpacingExtra="10sp"
     android:textColor="@color/C000000"
     android:textSize="12sp"
-    app:layout_constraintBottom_toBottomOf="parent"
+    android:layout_marginStart="23dp"
     app:layout_constraintStart_toStartOf="parent"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toStartOf="@+id/image_view_open_arrow"
+    app:layout_constraintHorizontal_chainStyle="packed"
     app:layout_constraintTop_toBottomOf="@+id/text_view_detail"
-    tools:text="포인트 내역 확인"
-    tools:visibility="visible"
-    />
+    tools:visibility="visible"/>
 
   <ImageView
     android:id="@+id/image_view_open_arrow"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_marginStart="2dp"
-    android:layout_marginBottom="25dp"
     android:rotation="-90"
     android:scaleType="center"
-    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintBottom_toBottomOf="@+id/text_view_show_contents"
+    app:layout_constraintTop_toTopOf="@+id/text_view_show_contents"
+    app:layout_constraintHorizontal_chainStyle="packed"
     app:layout_constraintStart_toEndOf="@+id/text_view_show_contents"
     app:srcCompat="@drawable/icon_openarrow"
-    tools:visibility="visible"
-    />
+    tools:visibility="visible"/>
 
 </android.support.constraint.ConstraintLayout>