瀏覽代碼

[이벤트][Common] 이벤트 공지사항 마지막 텍스트일때 패딩 따로 처리함

Hasemi 6 年之前
父節點
當前提交
c575e5a0e0

+ 4 - 3
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/event/entry/EventQuestionNoticeView.java

@@ -24,6 +24,7 @@ class EventQuestionNoticeView extends RecyclerView.ViewHolder {
 
   //private TextView textViewNoticeTitle;
   private LinearLayout layoutContainer;
+  private TextView textViewContents;
 
   public EventQuestionNoticeView(View itemView) {
     super(itemView);
@@ -34,14 +35,14 @@ class EventQuestionNoticeView extends RecyclerView.ViewHolder {
   public void draw(String notice) {
     String[] contentsArray = notice.split("\n");
     LayoutInflater inflater = (LayoutInflater) itemView.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-
     for (int i = 0; i < contentsArray.length; ++i) {
       View contentsView = inflater.inflate(R.layout.event_notice_view, null);
-      ((TextView) contentsView.findViewById(R.id.tex_view_contents)).setText(contentsArray[i]);
+      textViewContents = contentsView.findViewById(R.id.text_view_contents);
+      textViewContents.setText(contentsArray[i]);
       layoutContainer.addView(contentsView);
 
       if (i == contentsArray.length - 1) {
-        ((TextView) contentsView.findViewById(R.id.tex_view_contents)).setPadding(0, 0, 0, ResourceUtil.dpToPx(21));
+        textViewContents.setPadding(textViewContents.getPaddingLeft(), textViewContents.getPaddingTop(), textViewContents.getPaddingRight(), ResourceUtil.dpToPx(21));
       }
     }
   }

+ 1 - 1
app/src/main/res/layout/event_notice_view.xml

@@ -14,7 +14,7 @@
     android:background="@color/C666666"
     app:layout_constraintEnd_toStartOf="@+id/tex_view_contents"
     app:layout_constraintStart_toStartOf="parent"
-    app:layout_constraintTop_toTopOf="@+id/tex_view_contents"/>
+    app:layout_constraintTop_toTopOf="parent"/>
 
   <TextView
     android:id="@+id/tex_view_contents"