Forráskód Böngészése

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

Hasemi 7 éve
szülő
commit
ebd90d913a

+ 16 - 10
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainCategoryContentsImageView.java

@@ -307,24 +307,30 @@ public class MainCategoryContentsImageView extends MainCategoryContentsView {
     mask0 = itemView.findViewById(R.id.mask_0);
     mask1 = itemView.findViewById(R.id.mask_1);
     mask2 = itemView.findViewById(R.id.mask_2);
-    imageView.setOnClickListener(v -> listener.onEvent(new Event.Builder(Event.CONTENTS).integer(index).build()));
-
-    int textYFromBottom = ResourceUtil.dpToPx(71);
-    this.screenWidth = SuperModel.getInstance().getScreenWidth();
-    this.screenHeight = SuperModel.getInstance().getScreenHeight();
-    this.textPositionMaxYOnMask = (((ViewGroup.MarginLayoutParams) textBig.getLayoutParams()).topMargin); // <- 레이아웃의 위치를 최대값으로 지정.
-    this.textPositionMinYOnMask = (ResourceUtil.getDimension(R.dimen.main_contents_first_image_offset_from_bottom)
-      - ResourceUtil.dpToPx(70 + 26 + 12) // 70: holder top padding + 26: text height + 12: text padding bottom
-      - textYFromBottom);
-    this.textPositionTargetYOnScreen = screenHeight - textYFromBottom;
 
     textBig.setText(bean.getTwoLineTitle());
+    textBig.measure(0, 0);
     textSmall.setText(bean.getSubTitleWithTrim());
 
+    screenWidth = SuperModel.getInstance().getScreenWidth();
+    screenHeight = SuperModel.getInstance().getScreenHeight();
+
     maskWidth = ResourceUtil.getDimension(R.dimen.main_contents_image_width);
     maskHeight = ResourceUtil.getDimension(R.dimen.main_contents_image_height);
 
     spaceWidth = ResourceUtil.getDimension(R.dimen.main_contents_start_gap) - ResourceUtil.getDimension(R.dimen.main_contents_image_horizontal_padding_end);
+    imageView.setOnClickListener(v -> listener.onEvent(new Event.Builder(Event.CONTENTS).integer(index).build()));
+
+    int textBottomMargin = (((ViewGroup.MarginLayoutParams) textBig.getLayoutParams()).bottomMargin);
+    int textHeight = textBig.getMeasuredHeight();
+    int textYFromScreenBottom = textHeight + ResourceUtil.dpToPx(18); // text 높이 + 전체 스크린 바닥 간격(18dp)
+
+    this.textPositionMinYOnMask = (ResourceUtil.getDimension(R.dimen.main_contents_first_image_offset_from_bottom)  // 첫 카테고리 홀더의 처음 Y 위치
+      - ((ResourceUtil.getDimension(R.dimen.main_contents_category_height) - maskHeight) >> 1) // (카테고리 높이 - 이미지 높이 ) / 2 => 상단 공백 높이(이미지가 세로 중앙에 위치함)
+      - textYFromScreenBottom);
+    this.textPositionMaxYOnMask = maskHeight - textHeight - textBottomMargin; // <- 레이아웃의 위치를 최대값으로 지정.
+    this.textPositionTargetYOnScreen = screenHeight - textYFromScreenBottom;
+
 
     String url = bean.getImageUrl();
 

+ 7 - 7
app/src/main/res/layout/fragment_main.xml

@@ -13,6 +13,11 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"/>
 
+  <kr.co.zumo.app.lifeplus.view.screen.main.PageIndicator
+    android:id="@+id/page_indicator"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"/>
+
   <LinearLayout
     android:id="@+id/layout_test_all"
     android:layout_width="match_parent"
@@ -170,16 +175,11 @@
     </LinearLayout>
   </LinearLayout>
 
-  <kr.co.zumo.app.lifeplus.view.screen.main.PageIndicator
-    android:id="@+id/page_indicator"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"/>
-
   <android.support.constraint.ConstraintLayout
     android:id="@+id/container_navigation_bar"
-    android:background="@null"
     android:layout_width="match_parent"
-    android:layout_height="@dimen/action_bar_height">
+    android:layout_height="@dimen/action_bar_height"
+    android:background="@null">
 
   </android.support.constraint.ConstraintLayout>
 </android.support.constraint.ConstraintLayout>

+ 7 - 3
app/src/main/res/layout/main_contents_category_image.xml

@@ -51,14 +51,19 @@
     android:id="@+id/text_big"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    android:layout_marginTop="218dp"
+    android:layout_marginBottom="58dp"
     android:lineSpacingExtra="4dp"
     android:textColor="#ffffff"
     android:textSize="19sp"
     android:textStyle="bold"
+    android:maxLines="2"
+    android:ellipsize="end"
+    app:layout_constraintBottom_toBottomOf="parent"
     app:layout_constraintStart_toStartOf="@+id/guide_vertical"
     app:layout_constraintTop_toTopOf="parent"
-    tools:text="며느리도 모르는\n신당동 핫플"/>
+    app:layout_constraintVertical_bias="1"
+    app:layout_constraintVertical_chainStyle="packed"
+    tools:text="며느리도 모르는\n신당동 핫플\n신당동 핫플"/>
 
   <TextView
     android:id="@+id/text_small"
@@ -73,7 +78,6 @@
     app:layout_constrainedWidth="true"
     app:layout_constraintBottom_toBottomOf="parent"
     app:layout_constraintEnd_toEndOf="@+id/mask_2"
-    app:layout_constraintHorizontal_bias="0"
     app:layout_constraintStart_toStartOf="@+id/guide_vertical"
     tools:text="신당동 JMT 리스트 신당동 \nJMT 리스트 dier8234 lkjsdf"/>
 </android.support.constraint.ConstraintLayout>