add voice play of wear state change.
authorTrillGates <williamtrillgates@gmail.com>
Tue, 3 Aug 2021 06:56:43 +0000 (14:56 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Tue, 3 Aug 2021 06:56:43 +0000 (14:56 +0800)
app/release/ICL02Blood_V79_202107071723_release.apk [deleted file]
app/release/ICL02Blood_V84_202107271558_release.apk [new file with mode: 0644]
app/release/output.json
app/src/main/java/com/ic/blood/presenter/BloodPresenter.java
app/version_code.properties

diff --git a/app/release/ICL02Blood_V79_202107071723_release.apk b/app/release/ICL02Blood_V79_202107071723_release.apk
deleted file mode 100644 (file)
index 7cf6e99..0000000
Binary files a/app/release/ICL02Blood_V79_202107071723_release.apk and /dev/null differ
diff --git a/app/release/ICL02Blood_V84_202107271558_release.apk b/app/release/ICL02Blood_V84_202107271558_release.apk
new file mode 100644 (file)
index 0000000..1691e45
Binary files /dev/null and b/app/release/ICL02Blood_V84_202107271558_release.apk differ
index 73d3836..db4761e 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":81,"versionName":"202107081941","enabled":true,"outputFile":"ICL02Blood_V81_202107081941_release.apk","fullName":"release","baseName":"release"},"path":"ICL02Blood_V81_202107081941_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":84,"versionName":"202107271558","enabled":true,"outputFile":"ICL02Blood_V84_202107271558_release.apk","fullName":"release","baseName":"release"},"path":"ICL02Blood_V84_202107271558_release.apk","properties":{}}]
\ No newline at end of file
index 73cf5d6..c7132fa 100644 (file)
@@ -10,6 +10,7 @@ import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
+import android.media.AudioManager;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Looper;
@@ -33,6 +34,8 @@ import com.ic.work.domain.HeartRate;
 import com.xuexiang.xui.widget.dialog.DialogLoader;
 import com.xuexiang.xui.widget.dialog.strategy.impl.MaterialDialogStrategy;
 
+import static android.media.AudioManager.FX_FOCUS_NAVIGATION_DOWN;
+
 
 public class BloodPresenter {
 
@@ -127,9 +130,16 @@ public class BloodPresenter {
     public static final int STATE_ANTI_OFF = 1;
     public static final int STATE_ANTI_NONE = -1;
 
-    private BroadcastReceiver mAntiStateReceiver = new BroadcastReceiver() {
+    private final BroadcastReceiver mAntiStateReceiver = new BroadcastReceiver() {
+
+
+        private AudioManager audioManager = null;
+
         @Override
         public void onReceive(Context context, Intent intent) {
+            if (audioManager == null) {
+                audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+            }
             //如果来了佩戴的广播,判断到没有绑定远程服务的话,那么就绑定吧
             int state = intent.getIntExtra(KEY_ANTI_EVENT, -1);
             IcLog.i(TAG, "on AntiStateChange...." + state);
@@ -137,6 +147,7 @@ public class BloodPresenter {
                 IcLog.i(TAG, "state error === > " + state);
                 return;
             }
+            audioManager.playSoundEffect(FX_FOCUS_NAVIGATION_DOWN);
             if (state == STATE_ANTI_OFF) {
                 //手表脱掉了0
                 mObsStateTips.postValue(mContext.getString(R.string.tips_not_wear));
@@ -154,6 +165,7 @@ public class BloodPresenter {
         }
     };
 
+
     /**
      * 绑定远程服务
      */
@@ -275,9 +287,9 @@ public class BloodPresenter {
                 if (dialog != null) {
                     dialog.dismiss();
                 }
-            }catch (Exception e){
+            } catch (Exception e) {
                 Log.getStackTraceString(e.fillInStackTrace());
-            }finally {
+            } finally {
                 updateBoolValue(heartRate.getBloodHeight(), heartRate.getBloodLow(),
                         heartRate.getHeartRate(), heartRate.getOxygen());
             }
@@ -355,10 +367,10 @@ public class BloodPresenter {
 
                     @Override
                     public void onClick(DialogInterface dialogInterface, int i) {
-                        if(dialogInterface != null){
+                        if (dialogInterface != null) {
                             dialogInterface.dismiss();
                         }
-                        if(mActivity != null){
+                        if (mActivity != null) {
                             mActivity.onBackPressed();
                         }
                     }
index 32ee19d..24231e2 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Jul 21 10:43:30 CST 2021\r
-VERSION_CODE=83\r
+#Tue Jul 27 15:58:04 CST 2021\r
+VERSION_CODE=84\r