Browse Source

[알림][Common] html로 내려오게 수정요청 반영

Hasemi 6 years ago
parent
commit
172f56f2f4

+ 14 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/notification/NotiExpandableViewHolder.java

@@ -3,6 +3,7 @@ package kr.co.zumo.app.lifeplus.view.screen.notification;
 import android.support.constraint.ConstraintLayout;
 import android.text.Spanned;
 import android.view.View;
+import android.webkit.WebView;
 import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
@@ -30,6 +31,7 @@ public class NotiExpandableViewHolder extends NotiViewHolder {
   private TextView textViewAlarmContents;
   private ImageView imageViewOpenArrow;
   private ConstraintLayout layoutTop;
+  private WebView webView;
   private RelativeLayout relativeLayoutDetailContents;
 
   public NotiExpandableViewHolder(View itemView) {
@@ -37,10 +39,11 @@ public class NotiExpandableViewHolder extends NotiViewHolder {
     textViewAlarmCategory = itemView.findViewById(R.id.text_view_alarm_category);
     textViewAlarmTitle = itemView.findViewById(R.id.text_view_alarm_title);
     textViewAlarmDate = itemView.findViewById(R.id.text_view_alarm_date);
-    textViewAlarmContents = itemView.findViewById(R.id.text_view_alarm_contents);
+    //textViewAlarmContents = itemView.findViewById(R.id.text_view_alarm_contents);
     imageViewOpenArrow = itemView.findViewById(R.id.image_view_open_arrow);
     layoutTop = itemView.findViewById(R.id.layout_question);
     relativeLayoutDetailContents = itemView.findViewById(R.id.layout_detail_contents);
+    webView = itemView.findViewById(R.id.web_view);
 
   }
 
@@ -50,7 +53,16 @@ public class NotiExpandableViewHolder extends NotiViewHolder {
     textViewAlarmCategory.setText(bean.getFlagName());
     textViewAlarmTitle.setText(bean.getTitle());
     textViewAlarmDate.setText(bean.getDate());
-    textViewAlarmContents.setText(contents);
+    //textViewAlarmContents.setText(contents);
+    //textViewAlarmContents.setMovementMethod(LinkMovementMethod.getInstance());
+
+    webView.getSettings().setJavaScriptEnabled(true);
+    webView.loadData(bean.getContents(), "text/html", "UTF-8");
+    // 스크롤바 없애기
+
+    webView.setHorizontalScrollBarEnabled(false);
+    webView.setVerticalScrollBarEnabled(false);
+
 
     changed(bean.isExpanded());
 

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

@@ -85,7 +85,7 @@
 
     <LinearLayout
       android:layout_width="match_parent"
-      android:layout_height="wrap_content"
+      android:layout_height="match_parent"
       android:orientation="vertical"
       android:paddingStart="23dp"
       android:paddingEnd="23dp"
@@ -99,7 +99,7 @@
         android:background="@color/CE5E5E5"
         />
 
-      <TextView
+      <!--<TextView
         android:id="@+id/text_view_alarm_contents"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -107,8 +107,12 @@
         android:textColor="@color/C999999"
         android:textSize="12sp"
         tools:text="@string/sign_up_from_zumo_description"
-        />
+        />-->
 
+      <WebView
+        android:id="@+id/web_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"/>
     </LinearLayout>
   </RelativeLayout>