Browse Source

<修改推送通知显示问题>

weizhengliang 4 năm trước cách đây
mục cha
commit
b034cbb81b

+ 4 - 1
app/src/main/java/com/wdkl/callingbed/ui/CallingBedActivity.java

@@ -1247,13 +1247,16 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
      * 设置通知页面
      * 设置通知页面
      */
      */
     private void setNoticeView() {
     private void setNoticeView() {
-        if (null != noticeArrayList) {
+        if (null != noticeArrayList && noticeArrayList.size() > 0) {
             String strNotice = "";
             String strNotice = "";
             for (int i = 0; i < noticeArrayList.size(); i++) {
             for (int i = 0; i < noticeArrayList.size(); i++) {
                 strNotice += "      【" + (i + 1) + "】 " + noticeArrayList.get(i).getNoticeContent() + "  " + noticeArrayList.get(i).getNoticeEndTime();
                 strNotice += "      【" + (i + 1) + "】 " + noticeArrayList.get(i).getNoticeContent() + "  " + noticeArrayList.get(i).getNoticeEndTime();
             }
             }
             Log.e(TAG,"setNoticeView() 通知消息"+strNotice);
             Log.e(TAG,"setNoticeView() 通知消息"+strNotice);
+            tvNoticeContent.setVisibility(View.VISIBLE);
             tvNoticeContent.setText(strNotice);
             tvNoticeContent.setText(strNotice);
+        } else {
+            tvNoticeContent.setVisibility(View.INVISIBLE);
         }
         }
     }
     }
 
 

+ 18 - 0
app/src/main/res/layout/view_main_layout.xml

@@ -387,6 +387,24 @@
                             android:textSize="50sp"
                             android:textSize="50sp"
                             android:textStyle="bold" />
                             android:textStyle="bold" />
 
 
+                        <com.wdkl.callingbed.widget.view.MyTextView
+                            android:id="@+id/view_main_layout_tv_msg"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_alignParentBottom="true"
+                            android:layout_marginLeft="@dimen/margin_to_side_20"
+                            android:layout_marginRight="@dimen/margin_to_side_20"
+                            android:ellipsize="marquee"
+                            android:focusable="true"
+                            android:focusableInTouchMode="true"
+                            android:marqueeRepeatLimit="marquee_forever"
+                            android:scrollHorizontally="true"
+                            android:singleLine="true"
+                            android:text="notice"
+                            android:textColor="@color/zmcx_orange_color"
+                            android:textSize="@dimen/font_size_20"
+                            android:visibility="invisible" />
+
                     </RelativeLayout>
                     </RelativeLayout>
 
 
                     <TextView
                     <TextView

+ 0 - 20
app/src/main/res/layout/view_message_layout.xml

@@ -16,26 +16,6 @@
         android:src="@mipmap/ic_notice"
         android:src="@mipmap/ic_notice"
         android:visibility="invisible" />
         android:visibility="invisible" />
 
 
-    <com.wdkl.callingbed.widget.view.MyTextView
-        android:id="@+id/view_main_layout_tv_msg"
-        android:layout_width="200dp"
-        android:layout_height="wrap_content"
-        android:layout_centerInParent="true"
-        android:layout_centerVertical="true"
-        android:layout_marginLeft="@dimen/margin_to_side_10"
-        android:layout_marginRight="@dimen/margin_to_side_20"
-        android:layout_toLeftOf="@+id/view_main_iv_logo"
-        android:layout_toRightOf="@+id/view_main_iv_notice_logo"
-        android:ellipsize="marquee"
-        android:focusable="true"
-        android:focusableInTouchMode="true"
-        android:marqueeRepeatLimit="marquee_forever"
-        android:scrollHorizontally="true"
-        android:singleLine="true"
-        android:textColor="#FCFF16"
-        android:textSize="@dimen/font_size_20"
-        android:visibility="invisible" />
-
     <TextView
     <TextView
         android:id="@+id/view_main_layout_tv_hosp_number"
         android:id="@+id/view_main_layout_tv_hosp_number"
         android:layout_width="330dp"
         android:layout_width="330dp"