|
|
@@ -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();
|
|
|
|