瀏覽代碼

[이벤트][Common] admin에서 입력한 줄바꿈 된 내용 bullet 처리

Hasemi 6 年之前
父節點
當前提交
5cb04948fc

+ 11 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/dialog/EventNoticeDialog.java

@@ -1,5 +1,6 @@
 package kr.co.zumo.app.lifeplus.view.dialog;
 
+import android.content.Context;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
@@ -8,6 +9,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.view.Window;
 import android.widget.ImageView;
+import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import kr.co.zumo.app.R;
@@ -40,9 +42,16 @@ public class EventNoticeDialog extends DialogBase {
   protected void onActivityCreatedInternal() {
     Window window = getDialog().getWindow();
     window.setBackgroundDrawableResource(R.color.C99000000);
+    LinearLayout container = getView().findViewById(R.id.dialog_contents_container);
 
-    TextView textContents = getView().findViewById(R.id.tex_view_contents);
-    textContents.setText(contents);
+    String[] contentsArray = contents.split("\n");
+    LayoutInflater inflater = (LayoutInflater) 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]);
+      container.addView(contentsView);
+    }
 
     ImageView imageViewClose = getView().findViewById(R.id.image_view_close);
     imageViewClose.setOnClickListener(view -> {

+ 7 - 21
app/src/main/res/layout/dialog_event_notice.xml

@@ -49,38 +49,24 @@
     <ScrollView
       android:layout_width="match_parent"
       android:layout_height="0dp"
-      android:layout_marginTop="19dp"
+      android:layout_marginTop="14dp"
       android:layout_marginBottom="8dp"
       android:fadeScrollbars="false"
       android:fillViewport="true"
       android:paddingStart="25dp"
       android:paddingEnd="25dp"
-      app:layout_constraintVertical_bias="0"
       app:layout_constraintBottom_toBottomOf="parent"
-      app:layout_constraintTop_toBottomOf="@+id/text_view_coin_information">
+      app:layout_constraintTop_toBottomOf="@+id/text_view_coin_information"
+      app:layout_constraintVertical_bias="0">
 
-      <android.support.constraint.ConstraintLayout
-        android:id="@+id/dialoge_contents_container"
+      <LinearLayout
+        android:id="@+id/dialog_contents_container"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:orientation="vertical"
-        tools:layout_editor_absoluteX="25dp">
+        android:orientation="vertical">
 
-        <TextView
-          android:id="@+id/tex_view_contents"
-          android:layout_width="match_parent"
-          android:layout_height="wrap_content"
-          android:lineSpacingExtra="4sp"
-          android:textColor="@color/C666666"
-          android:textSize="12sp"
-          app:layout_constraintVertical_bias="0"
-          app:layout_constraintBottom_toBottomOf="parent"
-          app:layout_constraintEnd_toEndOf="parent"
-          app:layout_constraintStart_toStartOf="parent"
-          app:layout_constraintTop_toTopOf="parent"
-          tools:text="@string/coin_information_contents_1"/>
 
-      </android.support.constraint.ConstraintLayout>
+      </LinearLayout>
 
     </ScrollView>
 

+ 35 - 0
app/src/main/res/layout/event_notice_view.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout
+  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"
+  android:layout_width="wrap_content"
+  android:layout_height="wrap_content">
+
+  <View
+    android:id="@+id/rectangle"
+    android:layout_width="2dp"
+    android:layout_height="2dp"
+    android:layout_marginTop="11dp"
+    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"/>
+
+  <TextView
+    android:id="@+id/tex_view_contents"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="5dp"
+    android:lineSpacingExtra="4sp"
+    android:paddingTop="5dp"
+    android:paddingBottom="5dp"
+    android:textColor="@color/C666666"
+    android:textSize="12sp"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintEnd_toEndOf="parent"
+    app:layout_constraintStart_toEndOf="@+id/rectangle"
+    app:layout_constraintTop_toTopOf="parent"
+    app:layout_constraintVertical_bias="0"
+    tools:text="해당 이벤트는 ID당 1회에 한해 참여 가능\n합니다."/>
+</android.support.constraint.ConstraintLayout>

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

@@ -26,7 +26,7 @@
       android:layout_marginStart="18dp"
       android:layout_marginTop="21dp"
       android:lineSpacingExtra="4sp"
-      android:text="@string/go_confirm2"
+      android:text="@string/go_confirm"
       android:textColor="@color/C000000"
       android:textSize="12sp"
       android:textStyle="bold"