From 4f7f99c6ea914bcd38de78bd8371be566026b905 Mon Sep 17 00:00:00 2001
From: zuoxiao <470321431@qq.com>
Date: 星期三, 26 二月 2025 15:54:14 +0800
Subject: [PATCH] -为按钮和列表项添加波纹效果,以获得更好的视觉反馈 -改进MapFragment中的底部布局动画 -在MapFragment中添加设备状态和RTU地址显示 -更新BaseListResult以支持泛型类型 -为设备数据添加IntakeListResult和IntakeResult -通过数据库支持增强标记位置更新功能 -添加电话拨号意图以分隔标记详细信息 -通过过期检查改进磁贴缓存 -添加问题报告的确认对话框 -更新登录活动以限制用户名长度 -为波纹效果和UI元素添加新颜色 -重构XML布局以使用新的波纹图 -改进MapFragment中的错误处理和用户反馈

---
 app/src/main/java/com/dayu/pipirrapp/service/MyLocationService.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/app/src/main/java/com/dayu/pipirrapp/service/MyLocationService.java b/app/src/main/java/com/dayu/pipirrapp/service/MyLocationService.java
index a55e156..cc6113b 100644
--- a/app/src/main/java/com/dayu/pipirrapp/service/MyLocationService.java
+++ b/app/src/main/java/com/dayu/pipirrapp/service/MyLocationService.java
@@ -29,6 +29,7 @@
 import com.dayu.pipirrapp.R;
 import com.dayu.pipirrapp.activity.MainActivity;
 import com.dayu.pipirrapp.bean.db.LatLonBean;
+import com.dayu.pipirrapp.utils.CommonKeyName;
 import com.dayu.pipirrapp.utils.MyLog;
 import com.dayu.pipirrapp.utils.ToastUtil;
 import com.jeremyliao.liveeventbus.LiveEventBus;
@@ -41,6 +42,7 @@
  * 澶囨敞锛�
  */
 public class MyLocationService extends Service {
+
 
     private LocationManager locationManager;
     private MyLocationListener listener;
@@ -66,7 +68,9 @@
     @Override
     public int onStartCommand(Intent intent, int flags, int startId) {
         MyLog.i("onStartCommand()");
-        isSingle = intent.getBooleanExtra("isSingle", false);
+        if (intent != null) {
+            isSingle = intent.getBooleanExtra("isSingle", false);
+        }
         if (!isSingle) {
             // 鍦ˋPI11涔嬪悗鏋勫缓Notification鐨勬柟寮�
             Notification.Builder builder = new Notification.Builder
@@ -117,8 +121,8 @@
         PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE);
 
         Notification notification = new NotificationCompat.Builder(this, "location_channel")
-                .setContentTitle("瀹氫綅鏈嶅姟")
-                .setContentText("瀹氫綅鏈嶅姟姝e湪鍚庡彴杩愯")
+                .setContentTitle("宸℃瀹氫綅")
+                .setContentText("宸℃瀹氫綅鏈嶅姟姝e湪鍚庡彴杩愯")
                 .setSmallIcon(R.mipmap.ic_launcher)
                 .setContentIntent(pendingIntent)
                 .build();
@@ -158,7 +162,7 @@
                 MyLog.i("鍘熺敓瀹氫綅娌℃湁鏉冮檺>>>>");
                 return;
             }
-            locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER , 1000, 0, listener);
+            locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 1, listener);
         } catch (Exception e) {
             CrashReport.postCatchedException(e);
         }
@@ -218,13 +222,13 @@
 
             String longitude = "Longitude:" + location.getLongitude();
             String latitude = "Latitude:" + location.getLatitude();
-            MyLog.i("鍘熺敓瀹氫綅onLocationChanged:  Latitude锛�" + latitude + "  Longitude锛�" + longitude);
+            MyLog.d("鍘熺敓瀹氫綅onLocationChanged:  Latitude锛�" + latitude + "  Longitude锛�" + longitude);
             postPosition(location.getLatitude(), location.getLongitude());
 //            鏄惁涓�娆℃�у畾浣�
             if (isSingle) {
                 stopSelf();  // 鑾峰彇鍒扮粡绾害浠ュ悗锛屽仠姝㈣service
             }
-            ToastUtil.showToast(MyLocationService.this, "鍘熺敓瀹氫綅onLocationChanged:  Latitude锛�" + latitude + "  Longitude锛�" + longitude);
+//            ToastUtil.showToast(MyLocationService.this, "鍘熺敓瀹氫綅onLocationChanged:  Latitude锛�" + latitude + "  Longitude锛�" + longitude);
         }
 
         // 鐘舵�佹敼鍙樻椂
@@ -286,13 +290,14 @@
         LatLonBean latLonBean = new LatLonBean();
         latLonBean.setLatitude(latitude);
         latLonBean.setLongitude(longitude);
-        LiveEventBus.get("location").post(latLonBean);
+        LiveEventBus.get(CommonKeyName.locationData).post(latLonBean);
     }
 
 
     @Override
     public void onDestroy() {
         MyLog.i("MyLocationService--onDestroy");
+
         // 鍋滄鍓嶅彴鏈嶅姟--鍙傛暟锛氳〃绀烘槸鍚︾Щ闄や箣鍓嶇殑閫氱煡
         stopForeground(true);
         // 鑾峰彇NotificationManager骞跺彇娑堥�氱煡锛岀‘淇濋�氱煡琚Щ闄�

--
Gitblit v1.8.0