1.分离血压和天气,加入混淆,加入carsh
authorkfl_614 <kfl_614@163.com>
Mon, 23 Mar 2020 12:44:09 +0000 (20:44 +0800)
committerkfl_614 <kfl_614@163.com>
Mon, 23 Mar 2020 12:44:09 +0000 (20:44 +0800)
54 files changed:
app/build.gradle
app/proguard-rules.pro
app/src/main/AndroidManifest.xml
app/src/main/aidl/com/ic/aidl/blood/BloodState.java [deleted file]
app/src/main/aidl/com/ic/aidl/blood/IBloodAidlInterface.aidl [deleted file]
app/src/main/aidl/com/ic/aidl/blood/IBloodRemoteService.aidl [deleted file]
app/src/main/aidl/com/ic/aidl/weather/IWeatherAidlInterface.aidl [deleted file]
app/src/main/aidl/com/ic/aidl/weather/IWeatherRemoteService.aidl [deleted file]
app/src/main/aidl/com/ic/aidl/weather/WeatherParcelable.aidl [deleted file]
app/src/main/aidl/com/ic/aidl/weather/WeatherParcelable.java [deleted file]
app/src/main/assets/only_hr_check.gif [deleted file]
app/src/main/java/com/ic/hardware/BloodActivity.java [deleted file]
app/src/main/java/com/ic/hardware/HardwareApp.java
app/src/main/java/com/ic/hardware/WeatherActivity.java [deleted file]
app/src/main/java/com/ic/hardware/fragment/BloodFragment.java [deleted file]
app/src/main/java/com/ic/hardware/fragment/WeatherFragment.java [deleted file]
app/src/main/java/com/ic/hardware/model/BloodCheckModel.java [deleted file]
app/src/main/java/com/ic/hardware/model/WeatherModel.java [deleted file]
app/src/main/java/com/ic/hardware/presenter/BloodPresenter.java [deleted file]
app/src/main/java/com/ic/hardware/presenter/PedometerPresenter.java
app/src/main/java/com/ic/hardware/presenter/WeatherPresenter.java [deleted file]
app/src/main/java/com/ic/hardware/util/CrashHandler.java [new file with mode: 0644]
app/src/main/java/com/ic/hardware/util/IcLog.java
app/src/main/java/com/ic/hardware/util/ServiceUtil.java
app/src/main/res/layout/activity_blood.xml [deleted file]
app/src/main/res/layout/activity_weather.xml [deleted file]
app/src/main/res/layout/fragment_blood.xml [deleted file]
app/src/main/res/layout/fragment_weather.xml [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_baoxue.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_baoyu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_bingbao.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_daxue.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_dayu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_duoyun.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_leizhenyu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_none.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_qing.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_qingwu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_qingyu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_qingyun.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_shachenbao.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_wu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_xiaoxue.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_xiaoyu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_yangsha.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_yin.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_yinduoyun.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_yinyu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_zhenyu.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_zhongxue.png [deleted file]
app/src/main/res/mipmap-mdpi/weather_status_zhongyu.png [deleted file]
app/src/main/res/values/strings.xml
app/src/main/res/values/styles.xml
app/version_code.properties [new file with mode: 0644]

index b95b0e3..284fc0f 100644 (file)
@@ -1,14 +1,22 @@
 apply plugin: 'com.android.application'
 
+static def getL02ApkBaseName() {
+    return "ICL02Hardware"
+}
+
 android {
+
+    def currentVersionCode = getVersionCode()
+    def currentVersionName = releaseTime()
+
     compileSdkVersion 29
     buildToolsVersion "29.0.2"
     defaultConfig {
         applicationId "com.ic.hardware"
         minSdkVersion 19
         targetSdkVersion 29
-        versionCode 1
-        versionName "1.0"
+        versionCode currentVersionCode
+        versionName "${currentVersionName}"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
 
@@ -22,13 +30,6 @@ android {
         enabled = true
     }
 
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
-        }
-    }
-
     sourceSets {
         main {
             jni.srcDirs = []
@@ -40,6 +41,66 @@ android {
             assets.srcDirs = ['src/main/assets']
         }
     }
+
+    signingConfigs {
+        key {
+            storeFile file("EQC_G5.jks")
+            storePassword "123456"
+            keyAlias "watch_g5"
+            keyPassword "123456"
+        }
+    }
+
+    buildTypes {
+        release {
+            zipAlignEnabled true     // zip 对齐优化
+            shrinkResources true       // 移除未使用的资源文件
+            signingConfig signingConfigs.key
+            minifyEnabled true
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            renderscriptDebuggable = false
+            debuggable = false
+            jniDebuggable = false
+            manifestPlaceholders = [:]
+        }
+
+        debug {
+            signingConfig signingConfigs.key
+        }
+    }
+
+    android.applicationVariants.all { variant ->
+        variant.outputs.all {
+            if (variant.buildType.name == "release") {
+                outputFileName = "${getL02ApkBaseName()}_V${currentVersionCode}_${currentVersionName}_release.apk"
+            } else {
+                outputFileName = "${getL02ApkBaseName()}_V${currentVersionCode}_${currentVersionName}_debug.apk"
+            }
+        }
+    }
+}
+
+def getVersionCode() {
+    def versionCodeFile = file('version_code.properties')
+    if (versionCodeFile.canRead()) {
+        Properties properties = new Properties()
+        properties.load(new FileInputStream(versionCodeFile))
+        def versionCode = properties['VERSION_CODE'].toInteger()//读取version_code.properties文件存放的版本号。
+        def runTasks = gradle.startParameter.taskNames
+        def task = ':app:assembleRelease'
+        if (task in runTasks) {
+            properties['VERSION_CODE'] = (++versionCode).toString()
+            properties.store(versionCodeFile.newWriter(), null)
+        }
+
+        return versionCode
+    } else {
+        throw new GradleException("无法读取version_code.properties文件!")
+    }
+}
+
+def releaseTime() {
+    return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
 }
 
 dependencies {
index f1b4245..8c7cff6 100644 (file)
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
 #-renamesourcefileattribute SourceFile
+-dontoptimize                           # 混合时不使用大小写混合,混合后的类名为小写
+-dontusemixedcaseclassnames             # 混合时不使用大小写混合,混合后的类名为小写
+-dontskipnonpubliclibraryclasses        # 不跳过library中的非public的类
+-dontskipnonpubliclibraryclassmembers   # 不跳过library中的非public的类成员
+-dontpreverify                          # 不做预校验,preverify是proguard的四个步骤之一,Android平台不需要preverify,去掉这一步能够加快混淆速度
+-verbose                                # 在处理时打印冗长的信息
+
+# 保留异常表,以便编译器知道哪些异常可能被抛出
+# 保留InnerClasses,否则外部无法引用内部类
+# 保留Signature,否则无法访问泛型
+-keepattributes Exceptions,SourceFile,LineNumberTable,EnclosingMethod,Signature,*Annotation*,InnerClasses,Deprecated
+
+################################## 需要保留的公共部分 ##################################
+# 保留四大组件,自定义的Application等等这些类不被混淆
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class * extends android.view.View
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keep class android.support.** { *; }
+-keep public class * extends android.support.v4.**
+-keep public class * extends android.support.v7.**
+-keep public class * extends android.support.annotation.**
+-keep public class * extends android.app.Fragment
+-keep class com.google.** { *; }
+
+# 保留R下面的资源
+-keep class **.R$* {*;}
+-keepclassmembers class **.R$* {
+    public static <fields>;
+}
+
+# 保留本地native方法不被混淆
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+# 保留在Activity中的方法参数是view的方法,
+# 这样以来我们在layout中写的onClick就不会被影响
+-keepclassmembers class * extends android.app.Activity{
+    public void *(android.view.View);
+}
+
+# 保留我们自定义控件(继承自View)不被混淆
+-keep public class * extends android.view.View{
+    *** get*();
+    void set*(***);
+    public <init>(android.content.Context);
+    public <init>(android.content.Context, android.util.AttributeSet);
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclasseswithmembernames class * {
+    public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembernames class * {
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+# 保留枚举类不被混淆
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+-keep public interface com.ic.aidl.ped.IPedAidlInterface
+-keep public abstract interface com.ic.aidl.ped.IPedAidlInterface{
+public protected <methods>;
+}
+
+-keep public interface com.ic.aidl.ped.IPedRemoteService
+-keep public abstract interface com.ic.aidl.ped.IPedRemoteService{
+public protected <methods>;
+}
+
+# 保留Parcelable序列化类不被混淆
+-keep class * implements android.os.Parcelable {
+  public static final android.os.Parcelable$Creator *;
+}
+
+# 保留Serializable序列化的类不被混淆
+-keepclassmembers class * implements java.io.Serializable {
+    static final long serialVersionUID;
+    private static final java.io.ObjectStreamField[] serialPersistentFields;
+    !static !transient <fields>;
+    !private <fields>;
+    !private <methods>;
+    private void writeObject(java.io.ObjectOutputStream);
+    private void readObject(java.io.ObjectInputStream);
+    java.lang.Object writeReplace();
+    java.lang.Object readResolve();
+}
+
+# 对于带有回调函数的onXXEvent、**On*Listener的,不能被混淆
+-keepclassmembers class * {
+    void *(**On*Event);
+    void *(**On*Listener);
+}
+
+
+-keep class com.sun.jna.** { *; }
+-dontwarn com.sun.jna.**
+
+-keep public class com.android.support.a
+-keep public class com.android.support.b
+-keep public class rx.internal.util
\ No newline at end of file
index aa92f96..0c3a75a 100644 (file)
@@ -5,6 +5,9 @@
     <uses-permission android:name="android.permission.WAKE_LOCK" />
     <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
 
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+
     <application
         android:name=".HardwareApp"
         android:allowBackup="true"
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name=".BloodActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.intent.action.VIEW" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".WeatherActivity">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.intent.action.VIEW" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
     </application>
 
 </manifest>
\ No newline at end of file
diff --git a/app/src/main/aidl/com/ic/aidl/blood/BloodState.java b/app/src/main/aidl/com/ic/aidl/blood/BloodState.java
deleted file mode 100644 (file)
index 82ed7f7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.ic.aidl.blood;
-
-public class BloodState {
-
-    public static final int BLOOD_NULL_TIPS = -1;
-    public static final int BLOOD_NOT_DEVICE = 1001;
-
-    public static final int BLOOD_PLEASE_QUIET = 1002;
-    public static final int BLOOD_START_CHECK= 1003;
-
-    public static final int BLOOD_NOT_WEAR=1004;
-    public static final int BLOOD_ING_CHECK=1005;
-
-    public static final int BLOOD_STOP_CHECK=1006;
-    public static final int BLOOD_NOT_DATA_CHECK=1007;
-}
diff --git a/app/src/main/aidl/com/ic/aidl/blood/IBloodAidlInterface.aidl b/app/src/main/aidl/com/ic/aidl/blood/IBloodAidlInterface.aidl
deleted file mode 100644 (file)
index 092c192..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// IWeatherAidlInterface.aidl
-package com.ic.aidl.blood;
-
-// Declare any non-default types here with import statements
-
-interface IBloodAidlInterface {
-    /**
-     * Demonstrates some basic types that you can use as parameters
-     * and return values in AIDL.
-     */
-
-     void updateBloodCheckResult(int high,int low,int heart);
-     void updateBloodCheckTips(int top,int bottom);
-}
diff --git a/app/src/main/aidl/com/ic/aidl/blood/IBloodRemoteService.aidl b/app/src/main/aidl/com/ic/aidl/blood/IBloodRemoteService.aidl
deleted file mode 100644 (file)
index 00546c2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// IWeatherRemoteService.aidl
-package com.ic.aidl.blood;
-
-// Declare any non-default types here with import statements
-
-import com.ic.aidl.blood.IBloodAidlInterface;
-
-interface IBloodRemoteService {
-    /**
-     * Demonstrates some basic types that you can use as parameters
-     * and return values in AIDL.
-     */
-    void registerCallback(IBloodAidlInterface cb);
-    void unregisterCallback(IBloodAidlInterface cb);
-
-    void startCheckBlood();
-    void stopCheckBlood();
-}
diff --git a/app/src/main/aidl/com/ic/aidl/weather/IWeatherAidlInterface.aidl b/app/src/main/aidl/com/ic/aidl/weather/IWeatherAidlInterface.aidl
deleted file mode 100644 (file)
index 219c69e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// IWeatherAidlInterface.aidl
-package com.ic.aidl.weather;
-
-// Declare any non-default types here with import statements
-import com.ic.aidl.weather.WeatherParcelable;
-
-interface IWeatherAidlInterface {
-    /**
-     * Demonstrates some basic types that you can use as parameters
-     * and return values in AIDL.
-     */
-     void updateCurrWeather(in WeatherParcelable weather);
-
-}
diff --git a/app/src/main/aidl/com/ic/aidl/weather/IWeatherRemoteService.aidl b/app/src/main/aidl/com/ic/aidl/weather/IWeatherRemoteService.aidl
deleted file mode 100644 (file)
index 2f33b2b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// IWeatherRemoteService.aidl
-package com.ic.aidl.weather;
-
-// Declare any non-default types here with import statements
-
-import com.ic.aidl.weather.IWeatherAidlInterface;
-
-interface IWeatherRemoteService {
-    /**
-     * Demonstrates some basic types that you can use as parameters
-     * and return values in AIDL.
-     */
-    void registerCallback(IWeatherAidlInterface cb);
-    void unregisterCallback(IWeatherAidlInterface cb);
-
-    void queryWeatherInfo();
-}
diff --git a/app/src/main/aidl/com/ic/aidl/weather/WeatherParcelable.aidl b/app/src/main/aidl/com/ic/aidl/weather/WeatherParcelable.aidl
deleted file mode 100644 (file)
index 59b6fd3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-package com.ic.aidl.weather;
-
-parcelable WeatherParcelable;
\ No newline at end of file
diff --git a/app/src/main/aidl/com/ic/aidl/weather/WeatherParcelable.java b/app/src/main/aidl/com/ic/aidl/weather/WeatherParcelable.java
deleted file mode 100644 (file)
index e7c9bbb..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-package com.ic.aidl.weather;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-public class WeatherParcelable implements Parcelable {
-    private String city;
-    private String statusDay;   // 白天状态,如:晴
-    private String statusNight; // 晚上状态
-    private String figureDay;   // 状态索引
-    private String figureNight;
-    private String temperatureDay;  // 白天温度 或 最低温度
-    private String temperatureNight; // 晚上温度 或 最低温度
-    private String updateTime;       // 更新时间
-
-    public WeatherParcelable() {
-        city = "";
-        statusDay = "";
-        statusNight = "";
-        figureDay = "";
-        figureNight = "";
-        temperatureDay = "";
-        temperatureNight = "";
-        updateTime = "";
-    }
-
-    public WeatherParcelable(String city,
-                             String statusDay, String statusNight,
-                             String figureDay, String figureNight,
-                             String temperatureDay, String temperatureNight,
-                             String updateTime) {
-        this.city = city;
-        this.statusDay = statusDay;
-        this.statusNight = statusNight;
-        this.figureDay = figureDay;
-        this.figureNight =figureNight;
-        this.temperatureDay = temperatureDay;
-        this.temperatureNight = temperatureNight;
-        this.updateTime =updateTime;
-    }
-
-    public WeatherParcelable(Parcel p) {
-        this.city =  p.readString();
-        this.statusDay =  p.readString();
-        this.statusNight =  p.readString();
-        this.figureDay =  p.readString();
-        this.figureNight = p.readString();
-        this.temperatureDay =  p.readString();
-        this.temperatureNight =  p.readString();
-        this.updateTime = p.readString();
-    }
-
-    @Override
-    public int describeContents() {
-        return 0;
-    }
-
-    @Override
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeString(city);
-        dest.writeString(statusDay);
-        dest.writeString(statusNight);
-        dest.writeString(figureDay);
-        dest.writeString(figureNight);
-        dest.writeString(temperatureDay);
-        dest.writeString(temperatureNight);
-        dest.writeString(updateTime);
-    }
-
-    public static final Creator<WeatherParcelable> CREATOR
-            = new Creator<WeatherParcelable>() {
-        public WeatherParcelable createFromParcel(Parcel in) {
-            return new WeatherParcelable(in);
-        }
-
-        public WeatherParcelable[] newArray(int size) {
-            return new WeatherParcelable[size];
-        }
-    };
-
-    public String getCity() {
-        return city;
-    }
-
-    public void setCity(String city) {
-        this.city = city;
-    }
-
-    public String getStatusDay() {
-        return statusDay;
-    }
-
-    public void setStatusDay(String statusDay) {
-        this.statusDay = statusDay;
-    }
-
-    public String getStatusNight() {
-        return statusNight;
-    }
-
-    public void setStatusNight(String statusNight) {
-        this.statusNight = statusNight;
-    }
-
-    public String getFigureDay() {
-        return figureDay;
-    }
-
-    public void setFigureDay(String figureDay) {
-        this.figureDay = figureDay;
-    }
-
-    public String getFigureNight() {
-        return figureNight;
-    }
-
-    public void setFigureNight(String figureNight) {
-        this.figureNight = figureNight;
-    }
-
-    public String getTemperatureDay() {
-        return temperatureDay;
-    }
-
-    public void setTemperatureDay(String temperatureDay) {
-        this.temperatureDay = temperatureDay;
-    }
-
-    public String getTemperatureNight() {
-        return temperatureNight;
-    }
-
-    public void setTemperatureNight(String temperatureNight) {
-        this.temperatureNight = temperatureNight;
-    }
-
-    public String getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(String updateTime) {
-        this.updateTime = updateTime;
-    }
-}
diff --git a/app/src/main/assets/only_hr_check.gif b/app/src/main/assets/only_hr_check.gif
deleted file mode 100644 (file)
index 67011c6..0000000
Binary files a/app/src/main/assets/only_hr_check.gif and /dev/null differ
diff --git a/app/src/main/java/com/ic/hardware/BloodActivity.java b/app/src/main/java/com/ic/hardware/BloodActivity.java
deleted file mode 100644 (file)
index dd89530..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.ic.hardware;
-
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-import androidx.fragment.app.FragmentTransaction;
-
-import android.os.Bundle;
-
-import com.ic.hardware.fragment.BloodFragment;
-
-public class BloodActivity extends AppCompatActivity {
-
-    private FragmentManager fragmentManager;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_blood);
-        fragmentManager = getSupportFragmentManager();
-        commitFragment(BloodFragment.newInstance());
-    }
-
-    private void commitFragment(Fragment fragment) {
-        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
-        fragmentTransaction.replace(R.id.main_content_fl, fragment);
-        fragmentTransaction.commit();
-    }
-
-
-}
index e6e1e68..34e303f 100644 (file)
@@ -2,6 +2,7 @@ package com.ic.hardware;
 
 import android.app.Application;
 
+import com.ic.hardware.util.CrashHandler;
 import com.ic.hardware.util.IcLog;
 import com.jakewharton.threetenabp.AndroidThreeTen;
 
@@ -13,5 +14,8 @@ public class HardwareApp extends Application {
         IcLog.setLogHead("IcHardware");
 
         AndroidThreeTen.init(this);
+
+        CrashHandler crashHandler = CrashHandler.getInstance();
+        crashHandler.init(getApplicationContext());
     }
 }
diff --git a/app/src/main/java/com/ic/hardware/WeatherActivity.java b/app/src/main/java/com/ic/hardware/WeatherActivity.java
deleted file mode 100644 (file)
index d786e16..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.ic.hardware;
-
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-import androidx.fragment.app.FragmentTransaction;
-
-import android.os.Bundle;
-
-import com.ic.hardware.fragment.WeatherFragment;
-
-public class WeatherActivity extends AppCompatActivity {
-
-    private FragmentManager fragmentManager;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_weather);
-        fragmentManager = getSupportFragmentManager();
-        commitFragment(WeatherFragment.newInstance());
-    }
-
-    private void commitFragment(Fragment fragment) {
-        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
-        fragmentTransaction.replace(R.id.weather_content_fl, fragment);
-        fragmentTransaction.commit();
-    }
-
-}
diff --git a/app/src/main/java/com/ic/hardware/fragment/BloodFragment.java b/app/src/main/java/com/ic/hardware/fragment/BloodFragment.java
deleted file mode 100644 (file)
index 5845042..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-package com.ic.hardware.fragment;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.net.Uri;
-import android.nfc.Tag;
-import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.fragment.app.Fragment;
-import androidx.lifecycle.ViewModelProvider;
-
-import android.os.PowerManager;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-
-import com.ic.hardware.HardwareApp;
-import com.ic.hardware.BloodActivity;
-import com.ic.hardware.databinding.FragmentBloodBinding;
-import com.ic.hardware.model.BloodCheckModel;
-import com.ic.hardware.util.IcLog;
-
-import java.io.IOException;
-
-import pl.droidsonroids.gif.GifDrawable;
-import pl.droidsonroids.gif.GifImageView;
-
-import static android.content.Context.POWER_SERVICE;
-
-
-public class BloodFragment extends Fragment {
-
-    private static final String TAG = "BloodFragment";
-
-    private Context mContext;
-    private HardwareApp mApp;
-
-    private FragmentBloodBinding bloodBinding;
-
-    private PowerManager.WakeLock mWakeLock = null;
-    private BloodCheckModel bloodModel;
-
-    private GifDrawable gifFromAssets;
-
-    public static BloodFragment newInstance() {
-        return new BloodFragment();
-    }
-
-    @Override
-    public void onAttach(@NonNull Context context) {
-        super.onAttach(context);
-        this.mContext = context;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        mApp = (HardwareApp) mContext.getApplicationContext();
-        initWakeLock(mContext);
-    }
-
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
-        bloodBinding = FragmentBloodBinding.inflate(inflater, container, false);
-
-        bloodBinding.setIsShowTips(true);
-
-        initBloodModel();
-        setGifDrawable();
-        bloodModel.registerScreenReceiver();
-        return bloodBinding.getRoot();
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        if (mWakeLock != null) {
-            mWakeLock.acquire();
-        }
-
-        bloodModel.startCheckBlood();
-
-        gifFromAssets.start();
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        bloodModel.stopCheckBlood();
-        gifFromAssets.stop();
-
-        releaseWakeLock();
-    }
-
-    private void initBloodModel() {
-        BloodCheckModel.Factory factory = new BloodCheckModel.Factory(mApp);
-        bloodModel= new ViewModelProvider(this, factory).get(BloodCheckModel.class);
-        bloodModel.getObsBloodValue().observe(getViewLifecycleOwner(), value -> {
-            bloodBinding.setIsShowTips(false);
-            bloodBinding.setHighValue(value[0]);
-            bloodBinding.setLowValue(value[1]);
-            bloodBinding.setHeartValue(value[2]);
-        });
-
-        bloodModel.getObsTipsInfo().observe(getViewLifecycleOwner(),tips ->{
-            bloodBinding.setIsShowTips(true);
-            bloodBinding.setTopTips(tips[0]);
-            bloodBinding.setBottomTips(tips[1]);
-        });
-
-        bloodModel.getObsCheckEnd().observe(getViewLifecycleOwner(),end ->{
-            switch (end){
-                case 1:
-                    IcLog.i(TAG,"Release WakeLock");
-                    releaseWakeLock();
-                    break;
-                case 2:
-                    ((BloodActivity)mContext).finish();
-                    break;
-            }
-        });
-    }
-
-    @SuppressLint("InvalidWakeLockTag")
-    private void initWakeLock(Context context) {
-        PowerManager powerManager = (PowerManager) context.getSystemService(POWER_SERVICE);
-        if (powerManager != null) {
-            mWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "BloodWakeLock");
-        }
-    }
-
-    private void releaseWakeLock() {
-        if (mWakeLock != null) {
-            mWakeLock.release();
-        }
-        mWakeLock = null;
-    }
-
-    private void setGifDrawable() {
-        GifImageView gifImageView = bloodBinding.icHeartGif;
-        gifImageView.setScaleType(ImageView.ScaleType.CENTER);
-        try {
-            gifFromAssets = new GifDrawable(mContext.getAssets(), "only_hr_check.gif");
-            gifImageView.setImageDrawable(gifFromAssets);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Override
-    public void onDestroy() {
-        super.onDestroy();
-        IcLog.i(TAG,"onDestroy");
-
-        bloodModel.unregisterScreenReceiver();
-        bloodModel = null;
-
-        if (gifFromAssets != null) {
-            gifFromAssets.recycle();
-        }
-    }
-}
diff --git a/app/src/main/java/com/ic/hardware/fragment/WeatherFragment.java b/app/src/main/java/com/ic/hardware/fragment/WeatherFragment.java
deleted file mode 100644 (file)
index ee38dd3..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-package com.ic.hardware.fragment;
-
-
-import android.content.Context;
-import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.content.ContextCompat;
-import androidx.fragment.app.Fragment;
-import androidx.lifecycle.ViewModelProvider;
-
-import android.util.SparseArray;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.ic.hardware.HardwareApp;
-import com.ic.hardware.R;
-import com.ic.hardware.databinding.FragmentWeatherBinding;
-import com.ic.hardware.model.WeatherModel;
-
-import org.threeten.bp.OffsetDateTime;
-
-/**
- * A simple {@link Fragment} subclass.
- */
-public class WeatherFragment extends Fragment {
-
-    private Context mContext;
-    private HardwareApp mApp;
-
-    private FragmentWeatherBinding weatherBinding;
-    private WeatherModel weatherModel;
-
-    public static WeatherFragment newInstance() {
-        return new WeatherFragment();
-    }
-
-    @Override
-    public void onAttach(@NonNull Context context) {
-        super.onAttach(context);
-        this.mContext = context;
-    }
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        mApp = (HardwareApp) mContext.getApplicationContext();
-    }
-
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
-        // Inflate the layout for this fragment
-        weatherBinding = FragmentWeatherBinding.inflate(inflater, container, false);
-        initWeatherModel();
-        return weatherBinding.getRoot();
-    }
-
-    @Override
-    public void onDestroy() {
-        super.onDestroy();
-        weatherModel.onUnBindService();
-    }
-
-    private void initWeatherModel() {
-        WeatherModel.Factory factory = new WeatherModel.Factory(mApp);
-        weatherModel = new ViewModelProvider(this, factory).get(WeatherModel.class);
-
-
-        weatherModel.getObsWeatherParcelable().observe(getViewLifecycleOwner(), parcelable -> {
-
-            if (parcelable == null) {
-                weatherBinding.setIsShowTips(true);
-                weatherBinding.setIsErrorTips(getString(R.string.tips_error_weather_no_data));
-                return;
-            }
-
-            OffsetDateTime time = OffsetDateTime.now();
-
-            boolean inNight = time.getHour() > 18;
-            weatherBinding.setWeatherCity(parcelable.getCity());
-            weatherBinding.setWeatherSection(
-                    String.format(getString(R.string.weather_temp_space_degree),
-                            parcelable.getTemperatureDay(),
-                            parcelable.getTemperatureNight()));
-
-            String degree = getString(R.string.weather_temp_degree);
-
-            if (inNight) {
-                weatherBinding.setWeatherState(parcelable.getStatusNight());
-                weatherBinding.setWeatherTemp(String.format(degree, parcelable.getTemperatureNight()));
-                weatherBinding.setWeatherIcon(ContextCompat.getDrawable(mContext, getStatusImage(parcelable.getStatusNight())));
-            } else {
-                weatherBinding.setWeatherState(parcelable.getStatusDay());
-                weatherBinding.setWeatherTemp(String.format(degree, parcelable.getTemperatureDay()));
-                weatherBinding.setWeatherIcon(ContextCompat.getDrawable(mContext, getStatusImage(parcelable.getStatusDay())));
-            }
-        });
-
-        weatherModel.onBindService();
-    }
-
-    public static int getStatusImage(String stuats) {
-        int imageId = R.mipmap.weather_status_none;
-        if (stuats != null) {
-            if (stuats.contains("多云") || stuats.contains("晴")) {
-                imageId = R.mipmap.weather_status_qingyun;
-            } else if (stuats.contains("多云") && stuats.contains("阴")) {
-                imageId = R.mipmap.weather_status_yinduoyun;
-            } else if (stuats.contains("阴") && stuats.contains("雨")) {
-                imageId = R.mipmap.weather_status_yinyu;
-            } else if (stuats.contains("晴") && stuats.contains("雨")) {
-                imageId = R.mipmap.weather_status_qingyu;
-            } else if (stuats.contains("晴") && stuats.contains("雾")) {
-                imageId = R.mipmap.weather_status_qingwu;
-            } else if (stuats.contains("晴")) {
-                imageId = R.mipmap.weather_status_qing;
-            } else if (stuats.contains("多云")) {
-                imageId = R.mipmap.weather_status_duoyun;
-            } else if (stuats.contains("雷阵雨")) {
-                imageId = R.mipmap.weather_status_leizhenyu;
-            } else if (stuats.contains("阵雨")) {
-                imageId = R.mipmap.weather_status_zhenyu;
-            } else if (stuats.contains("小雨")) {
-                imageId = R.mipmap.weather_status_xiaoyu;
-            } else if (stuats.contains("中雨")) {
-                imageId = R.mipmap.weather_status_zhongyu;
-            } else if (stuats.contains("大雨")) {
-                imageId = R.mipmap.weather_status_dayu;
-            } else if (stuats.contains("暴雨")) {
-                imageId = R.mipmap.weather_status_baoyu;
-            } else if (stuats.contains("冰雹")) {
-                imageId = R.mipmap.weather_status_bingbao;
-            } else if (stuats.contains("小雪")) {
-                imageId = R.mipmap.weather_status_xiaoxue;
-            } else if (stuats.contains("中雪")) {
-                imageId = R.mipmap.weather_status_zhongxue;
-            } else if (stuats.contains("大雪")) {
-                imageId = R.mipmap.weather_status_daxue;
-            } else if (stuats.contains("暴雪")) {
-                imageId = R.mipmap.weather_status_baoxue;
-            } else if (stuats.contains("扬沙")) {
-                imageId = R.mipmap.weather_status_yangsha;
-            } else if (stuats.contains("沙尘")) {
-                imageId = R.mipmap.weather_status_shachenbao;
-            } else if (stuats.contains("雾")) {
-                imageId = R.mipmap.weather_status_wu;
-
-                // PARRY 2017.04.27
-            } else if (stuats.contains("阴")) {
-                imageId = R.mipmap.weather_status_yin;
-            }
-        }
-
-        return imageId;
-    }
-}
diff --git a/app/src/main/java/com/ic/hardware/model/BloodCheckModel.java b/app/src/main/java/com/ic/hardware/model/BloodCheckModel.java
deleted file mode 100644 (file)
index d4284d8..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.ic.hardware.model;
-
-import android.app.Application;
-
-import androidx.annotation.NonNull;
-import androidx.lifecycle.AndroidViewModel;
-import androidx.lifecycle.LiveData;
-import androidx.lifecycle.ViewModel;
-import androidx.lifecycle.ViewModelProvider;
-
-import com.ic.hardware.presenter.BloodPresenter;
-
-
-public class BloodCheckModel extends AndroidViewModel {
-
-    private final BloodPresenter bloodPresenter;
-
-    private LiveData<String[]> mObsBloodValue;
-    private LiveData<String[]> mObsTipsInfo;
-    private LiveData<Integer> mObsCheckEnd;
-
-    private BloodCheckModel(@NonNull Application application) {
-        super(application);
-        this.bloodPresenter = new BloodPresenter(application.getApplicationContext());
-        mObsBloodValue = bloodPresenter.getObsBloodValue();
-        mObsTipsInfo = bloodPresenter.getObsTipsInfo();
-        mObsCheckEnd = bloodPresenter.getObsCheckEnd();
-    }
-
-    public LiveData<String[]> getObsBloodValue() {
-        return mObsBloodValue;
-    }
-
-    public LiveData<String[]> getObsTipsInfo() {
-        return mObsTipsInfo;
-    }
-
-    public LiveData<Integer> getObsCheckEnd() {
-        return mObsCheckEnd;
-    }
-
-    public void startCheckBlood(){
-        bloodPresenter.startCheckBlood();
-    }
-
-    public void stopCheckBlood(){
-        bloodPresenter.stopCheckBlood();
-    }
-
-    public void registerScreenReceiver(){
-        bloodPresenter.registerScreenReceiver();
-    }
-
-    public void unregisterScreenReceiver(){
-        bloodPresenter.unregisterScreenReceiver();
-    }
-
-    public static class Factory extends ViewModelProvider.NewInstanceFactory {
-
-        @NonNull
-        private final Application mApplication;
-
-        public Factory(@NonNull Application application) {
-            mApplication = application;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        @NonNull
-        public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
-            return (T) new BloodCheckModel(mApplication);
-        }
-    }
-}
diff --git a/app/src/main/java/com/ic/hardware/model/WeatherModel.java b/app/src/main/java/com/ic/hardware/model/WeatherModel.java
deleted file mode 100644 (file)
index 0761933..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.ic.hardware.model;
-
-import android.app.Application;
-
-import androidx.annotation.NonNull;
-import androidx.lifecycle.AndroidViewModel;
-import androidx.lifecycle.LiveData;
-import androidx.lifecycle.ViewModel;
-import androidx.lifecycle.ViewModelProvider;
-
-import com.ic.aidl.weather.WeatherParcelable;
-import com.ic.hardware.presenter.WeatherPresenter;
-
-public class WeatherModel extends AndroidViewModel {
-
-    private final LiveData<WeatherParcelable> weatherParcelable;
-    private final WeatherPresenter weatherPresenter;
-
-    private WeatherModel(@NonNull Application application) {
-        super(application);
-        weatherPresenter = new WeatherPresenter(application.getApplicationContext());
-        weatherParcelable = weatherPresenter.getObsWeatherInfo();
-    }
-
-    public LiveData<WeatherParcelable> getObsWeatherParcelable() {
-        return weatherParcelable;
-    }
-
-    public void onBindService(){
-        weatherPresenter.bindService();
-    }
-
-    public void onUnBindService(){
-        weatherPresenter.unbindService();
-    }
-
-    public static class Factory extends ViewModelProvider.NewInstanceFactory {
-
-        @NonNull
-        private final Application mApplication;
-
-        public Factory(@NonNull Application application) {
-            mApplication = application;
-        }
-
-        @SuppressWarnings("unchecked")
-        @Override
-        @NonNull
-        public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
-            return (T) new WeatherModel(mApplication);
-        }
-    }
-}
diff --git a/app/src/main/java/com/ic/hardware/presenter/BloodPresenter.java b/app/src/main/java/com/ic/hardware/presenter/BloodPresenter.java
deleted file mode 100644 (file)
index 9b280eb..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.ic.hardware.presenter;
-
-
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.ServiceConnection;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.RemoteException;
-import android.util.SparseArray;
-
-import androidx.lifecycle.MutableLiveData;
-
-import com.ic.aidl.blood.BloodState;
-import com.ic.aidl.blood.IBloodAidlInterface;
-import com.ic.aidl.blood.IBloodRemoteService;
-import com.ic.hardware.R;
-import com.ic.hardware.util.IcLog;
-import com.ic.hardware.util.ServiceUtil;
-
-public class BloodPresenter {
-
-    private static final String TAG = "BloodPresenter";
-
-    private Context mContext;
-
-    private MutableLiveData<String[]> mObsBloodValue;
-    private MutableLiveData<String[]> mObsTipsInfo;
-    private MutableLiveData<Integer> mObsCheckEnd;
-
-    private IBloodRemoteService mService;
-
-    private SparseArray<String> mTipsSpares;
-
-    private Handler mHandler;
-
-    public BloodPresenter(Context context) {
-        this.mContext = context;
-        mTipsSpares = new SparseArray<String>();
-        mTipsSpares.put(BloodState.BLOOD_NULL_TIPS, "");
-        mTipsSpares.put(BloodState.BLOOD_NOT_DEVICE, context.getString(R.string.tips_not_device));
-        mTipsSpares.put(BloodState.BLOOD_PLEASE_QUIET, context.getString(R.string.tips_quiet_please));
-        mTipsSpares.put(BloodState.BLOOD_START_CHECK, context.getString(R.string.tips_start_check));
-        mTipsSpares.put(BloodState.BLOOD_NOT_WEAR, context.getString(R.string.tips_not_wear));
-        mTipsSpares.put(BloodState.BLOOD_ING_CHECK, context.getString(R.string.tips_ing_check));
-        mTipsSpares.put(BloodState.BLOOD_STOP_CHECK, context.getString(R.string.tips_stop_check));
-        mTipsSpares.put(BloodState.BLOOD_NOT_DATA_CHECK, context.getString(R.string.tips_not_data_check));
-
-        mObsBloodValue = new MutableLiveData<>();
-        mObsTipsInfo = new MutableLiveData<>();
-        mObsCheckEnd = new MutableLiveData<>();
-
-        mHandler = new Handler();
-    }
-
-    public MutableLiveData<String[]> getObsBloodValue() {
-        return mObsBloodValue;
-    }
-
-    public MutableLiveData<String[]> getObsTipsInfo() {
-        return mObsTipsInfo;
-    }
-
-    public MutableLiveData<Integer> getObsCheckEnd() {
-        return mObsCheckEnd;
-    }
-
-    public void registerScreenReceiver() {
-
-        ServiceUtil.bindServiceUtil(mContext, "com.ic.action.WORK_SERVICE", connection, 102);
-
-        IntentFilter intentFilter = new IntentFilter();
-        intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
-        mContext.registerReceiver(screenOnOffReceiver, intentFilter);
-    }
-
-    public void unregisterScreenReceiver() {
-
-        mContext.unregisterReceiver(screenOnOffReceiver);
-
-        try {
-            mService.unregisterCallback(bloodInterface);
-            ServiceUtil.unBindServiceUtil(mContext, connection);
-        } catch (Exception e) {
-            IcLog.e(TAG, e.getMessage());
-        }finally {
-            mService=null;
-            bloodInterface=null;
-        }
-
-        connection = null;
-        mHandler = null;
-    }
-
-    public void startCheckBlood() {
-        if (mService != null) {
-            try {
-                mService.startCheckBlood();
-            } catch (Exception e) {
-                IcLog.e(TAG, e.getMessage());
-            }
-        }
-    }
-
-    public void stopCheckBlood() {
-        if (mService != null) {
-            try {
-                mService.stopCheckBlood();
-            } catch (Exception e) {
-                IcLog.e(TAG, e.getMessage());
-            }
-        }
-    }
-
-
-    private void updateTipsInfo(String t, String b) {
-        if (mObsTipsInfo != null) {
-            mObsTipsInfo.postValue(new String[]{t, b});
-        }
-    }
-
-    private void updateBoolValue(int lv, int hv, int hh) {
-        if (mObsBloodValue != null) {
-            mObsBloodValue.postValue(new String[]{
-                    String.valueOf(hv),
-                    String.valueOf(lv),
-                    String.valueOf(hh)});
-        }
-    }
-
-    private BroadcastReceiver screenOnOffReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
-                IcLog.i(TAG, "灭屏了");
-                mObsCheckEnd.setValue(2);
-            }
-        }
-    };
-
-
-    private ServiceConnection connection = new ServiceConnection() {
-        @Override
-        public void onServiceConnected(ComponentName name, IBinder service) {
-            try {
-                mService = IBloodRemoteService.Stub.asInterface(service);
-                mService.registerCallback(bloodInterface);
-            } catch (Exception e) {
-                IcLog.e(TAG, e.getMessage());
-            }
-        }
-
-        @Override
-        public void onServiceDisconnected(ComponentName name) {
-        }
-    };
-
-    private IBloodAidlInterface.Stub bloodInterface = new IBloodAidlInterface.Stub() {
-        @Override
-        public void updateBloodCheckResult(int high, int low, int heart) throws RemoteException {
-            updateBoolValue(high, low, heart);
-            mHandler.postDelayed(() -> mObsCheckEnd.postValue(1), 10 * 1000);
-        }
-
-        @Override
-        public void updateBloodCheckTips(int top, int bottom) throws RemoteException {
-            updateTipsInfo(mTipsSpares.get(top), mTipsSpares.get(bottom));
-        }
-    };
-
-
-}
index f71180b..810ebe0 100644 (file)
@@ -40,7 +40,7 @@ public class PedometerPresenter {
     }
 
     public void bindService(){
-        ServiceUtil.bindServiceUtil(mContext, "com.ic.action.WORK_SERVICE", connection, 103);
+        ServiceUtil.bindServiceUtil(mContext, "com.ic.action.WORK_SERVICE", connection,mContext.getPackageName(), 103);
     }
 
     public void unbindService(){
diff --git a/app/src/main/java/com/ic/hardware/presenter/WeatherPresenter.java b/app/src/main/java/com/ic/hardware/presenter/WeatherPresenter.java
deleted file mode 100644 (file)
index a99a265..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.ic.hardware.presenter;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.ServiceConnection;
-import android.os.IBinder;
-import android.os.RemoteException;
-
-import androidx.lifecycle.MutableLiveData;
-
-import com.ic.aidl.weather.IWeatherAidlInterface;
-import com.ic.aidl.weather.IWeatherRemoteService;
-import com.ic.aidl.weather.WeatherParcelable;
-import com.ic.hardware.util.IcLog;
-import com.ic.hardware.util.ServiceUtil;
-
-public class WeatherPresenter {
-    private static final String TAG = "WeatherPresenter";
-
-    private Context mContext;
-
-    private MutableLiveData<WeatherParcelable> mObsWeatherInfo;
-    private IWeatherRemoteService mService;
-
-    public WeatherPresenter(Context context) {
-        this.mContext =context;
-
-        mObsWeatherInfo = new MutableLiveData<>();
-    }
-
-    public MutableLiveData<WeatherParcelable> getObsWeatherInfo() {
-        return mObsWeatherInfo;
-    }
-
-    public void bindService(){
-        ServiceUtil.bindServiceUtil(mContext, "com.ic.action.WORK_SERVICE", connection, 101);
-    }
-
-    public void unbindService(){
-        try {
-            mService.unregisterCallback(weatherInterface);
-            ServiceUtil.unBindServiceUtil(mContext,connection);
-        } catch (Exception e) {
-            IcLog.e(TAG, e.getMessage());
-        }finally {
-            mService=null;
-            weatherInterface=null;
-        }
-    }
-
-    private void queryWeatherInfo() {
-        if (mService != null) {
-            try {
-                mService.queryWeatherInfo();
-            } catch (Exception e) {
-                IcLog.e(TAG, e.getMessage());
-            }
-        }
-    }
-
-    private ServiceConnection connection = new ServiceConnection() {
-        @Override
-        public void onServiceConnected(ComponentName name, IBinder service) {
-            try {
-                mService = IWeatherRemoteService.Stub.asInterface(service);
-                mService.registerCallback(weatherInterface);
-                queryWeatherInfo();
-            } catch (Exception e) {
-                IcLog.e(TAG, e.getMessage());
-            }
-        }
-
-        @Override
-        public void onServiceDisconnected(ComponentName name) {
-        }
-    };
-
-    private IWeatherAidlInterface.Stub weatherInterface = new IWeatherAidlInterface.Stub() {
-        @Override
-        public void updateCurrWeather(WeatherParcelable weather) throws RemoteException {
-            mObsWeatherInfo.postValue(weather);
-        }
-    };
-}
diff --git a/app/src/main/java/com/ic/hardware/util/CrashHandler.java b/app/src/main/java/com/ic/hardware/util/CrashHandler.java
new file mode 100644 (file)
index 0000000..3f3822d
--- /dev/null
@@ -0,0 +1,214 @@
+package com.ic.hardware.util;
+
+import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.os.Build;
+import android.os.Environment;
+import android.os.Looper;
+import android.util.Log;
+import android.widget.Toast;
+
+
+import com.ic.hardware.R;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.lang.reflect.Field;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * Created by Administrator on 2017/5/18.
+ */
+
+public class CrashHandler implements Thread.UncaughtExceptionHandler {
+    public static final String TAG = CrashHandler.class.getName();
+
+    // 系统默认的UncaughtException处理类
+    private Thread.UncaughtExceptionHandler mDefaultHandler;
+    // CrashHandler实例
+    private static CrashHandler INSTANCE = new CrashHandler();
+    // 程序的Context对象
+    private Context mContext;
+    // 用来存储设备信息和异常信息
+    private Map<String, String> infos = new HashMap<String, String>();
+    // 用于格式化日期,作为日志文件名的一部分
+    private DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS", Locale.getDefault());
+    private DateFormat dateFormatDate = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
+
+    /**
+     * 保证只有一个CrashHandler实例
+     */
+    private CrashHandler() {
+    }
+
+    /**
+     * 获取CrashHandler实例 ,单例模式
+     */
+    public static CrashHandler getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * 初始化
+     *
+     * @param context
+     */
+    public void init(Context context) {
+        mContext = context;
+        // 获取系统默认的UncaughtException处理器
+        mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
+        // 设置该CrashHandler为程序的默认处理器
+        Thread.setDefaultUncaughtExceptionHandler(this);
+    }
+
+    /**
+     * 当UncaughtException发生时会转入该函数来处理
+     */
+    @Override
+    public void uncaughtException(Thread thread, Throwable ex) {
+        if (!handleException(ex) && mDefaultHandler != null) {
+            // 如果用户没有处理则让系统默认的异常处理器来处理
+            mDefaultHandler.uncaughtException(thread, ex);
+        } else {
+            try {
+                Thread.sleep(3000);
+            } catch (InterruptedException e) {
+//                Log.e(TAG, "error : " + e);
+                e.printStackTrace();
+            }
+        }
+
+        // 退出程序
+        ex.printStackTrace();
+        android.os.Process.killProcess(android.os.Process.myPid());
+        System.exit(1);
+    }
+
+    /**
+     * 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成.
+     *
+     * @param ex
+     * @return true:如果处理了该异常信息;否则返回false.
+     */
+    private boolean handleException(Throwable ex) {
+        if (ex == null) {
+            return false;
+        }
+        // 使用Toast来显示异常信息
+        new Thread() {
+            @Override
+            public void run() {
+                Looper.prepare();
+                if (mContext != null) {
+                    Toast.makeText(mContext, R.string.program_abnormal, Toast.LENGTH_LONG)
+                            .show();
+                    Looper.loop();
+                }
+            }
+        }.start();
+        // 收集设备参数信息
+        collectDeviceInfo(mContext);
+        // 保存日志文件
+        saveCrashInfo2File(ex);
+        return true;
+    }
+
+    /**
+     * 收集设备参数信息
+     *
+     * @param ctx
+     */
+    public void collectDeviceInfo(Context ctx) {
+        infos.clear();
+        infos.put("===", " PackageInfo ===");
+        try {
+            PackageManager pm = ctx.getPackageManager();
+            PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), PackageManager.GET_ACTIVITIES);
+
+            if (pi != null) {
+                String versionName = pi.versionName;
+                String versionCode = pi.versionCode + "";
+                infos.put("versionName", versionName);
+                infos.put("versionCode", versionCode);
+            }
+        } catch (PackageManager.NameNotFoundException e) {
+            Log.e(TAG, "an error occured when collect package info " + e);
+        }
+
+        infos.put("===", " Build ===");
+        Field[] fields = Build.class.getDeclaredFields();
+        for (Field field : fields) {
+            try {
+                field.setAccessible(true);
+                infos.put(field.getName(), field.get(null).toString());
+                Log.d(TAG, field.getName() + ":" + field.get(null));
+            } catch (Exception e) {
+                Log.e(TAG, "an error occured when collect crash info," + e);
+            }
+        }
+    }
+
+    /**
+     * 保存错误信息到文件中
+     *
+     * @param ex
+     * @return 返回文件名称, 便于将文件传送到服务器
+     */
+    private String saveCrashInfo2File(Throwable ex) {
+
+        String time = formatter.format(new Date());
+        StringBuilder sb = new StringBuilder();
+        sb.append("=== ").append(time).append(" ===\n");
+
+        Writer writer = new StringWriter();
+        PrintWriter printWriter = new PrintWriter(writer);
+        ex.printStackTrace(printWriter);
+//        ex.printStackTrace();
+        Throwable cause = ex.getCause();
+        while (cause != null) {
+            cause.printStackTrace(printWriter);
+            cause = cause.getCause();
+//            cause.printStackTrace();
+        }
+        printWriter.close();
+        String result = writer.toString();
+        sb.append(result);
+        sb.append("\n");
+
+        sb.append("--- DEVICE INFO ---\n");
+        for (Map.Entry<String, String> entry : infos.entrySet()) {
+            String key = entry.getKey();
+            String value = entry.getValue();
+            sb.append(key).append("=").append(value).append("\n");
+        }
+        sb.append("\n\n");
+
+        try {
+            String fileName = "IcHardware-" + dateFormatDate.format(new Date()) + ".log";
+            if (Environment.getExternalStorageState().equals(
+                    Environment.MEDIA_MOUNTED)) {
+                File dir = new File(Environment.getExternalStorageDirectory().getPath(), "Android/ic/crash/IcHardware");
+                String path = dir.getPath();
+                if (!dir.exists()) {
+                    dir.mkdirs();
+                }
+                FileOutputStream fos = new FileOutputStream(new File(path, fileName), true);
+                fos.write(sb.toString().getBytes());
+                fos.close();
+            }
+            return fileName;
+        } catch (Exception e) {
+            Log.e(TAG, "an error occured while writing file...," + e);
+        }
+        return null;
+    }
+}
index 5992f07..4caf90a 100644 (file)
@@ -12,7 +12,7 @@ import com.ic.hardware.BuildConfig;
 public class IcLog {
 
     private static final String DOT = ".";
-    private static boolean isDebug = BuildConfig.DEBUG;
+    private static boolean isDebug = true;
     private static String tagHead = "";
 
     public static void v(String tag, String msg) {
index 28bc27d..03a9389 100644 (file)
@@ -19,9 +19,10 @@ public class ServiceUtil {
         }
     }
 
-    public static void bindServiceUtil(Context context , String action, ServiceConnection connection,int type) {
+    public static void bindServiceUtil(Context context , String action, ServiceConnection connection,String pck,int type) {
         Intent in = getExplicitIntent(context, new Intent(action));
         if(in != null){
+            in.setPackage(pck);
             in.putExtra("REQ_TYPE",type);
             context.bindService(in, connection, 0);
         }
diff --git a/app/src/main/res/layout/activity_blood.xml b/app/src/main/res/layout/activity_blood.xml
deleted file mode 100644 (file)
index 1f5824c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout 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:id="@+id/main_content_fl"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".BloodActivity" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_weather.xml b/app/src/main/res/layout/activity_weather.xml
deleted file mode 100644 (file)
index 632aa96..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout 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:id="@+id/weather_content_fl"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".PedometerActivity" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_blood.xml b/app/src/main/res/layout/fragment_blood.xml
deleted file mode 100644 (file)
index 75747d8..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout 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">
-
-    <data>
-        <import type="android.view.View"/>
-
-        <variable
-            name="topTips"
-            type="String" />
-
-        <variable
-            name="bottomTips"
-            type="String" />
-
-        <variable
-            name="isShowTips"
-            type="boolean" />
-
-        <variable
-            name="heartValue"
-            type="String" />
-
-        <variable
-            name="highValue"
-            type="String" />
-
-        <variable
-            name="lowValue"
-            type="String" />
-    </data>
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="#000000">
-
-        <pl.droidsonroids.gif.GifImageView
-            android:id="@+id/ic_heart_gif"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_gravity="center" />
-
-        <TextView
-            android:id="@+id/ic_tips_top"
-            style="@style/bloodTextStyle"
-            android:layout_gravity="center_horizontal"
-            android:layout_marginTop="10dp"
-            android:text="@{topTips}"
-            android:visibility="@{isShowTips ? View.VISIBLE : View.GONE}"/>
-
-        <TextView
-            android:id="@+id/ic_tips_bottom"
-            style="@style/bloodTextStyle"
-            android:layout_gravity="bottom|center_horizontal"
-            android:layout_marginBottom="10dp"
-            android:text="@{bottomTips}"
-            android:visibility="@{isShowTips ? View.VISIBLE : View.GONE}"/>
-
-        <RelativeLayout
-            android:id="@+id/ic_heart_layout"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_horizontal"
-            android:layout_marginTop="20dp"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}">
-
-            <TextView
-                android:id="@+id/ic_heart_name"
-                style="@style/bloodTextStyle"
-                android:layout_marginEnd="10dp"
-                android:text="@string/ic_heart_rate" />
-
-            <TextView
-                style="@style/bloodTextStyle"
-                android:id="@+id/ic_heart_value"
-                android:layout_marginStart="10dp"
-                android:layout_toEndOf="@id/ic_heart_name"
-                android:text="@{heartValue}"/>
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/ic_high_layout"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="bottom"
-            android:layout_marginStart="30dp"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}">
-
-            <TextView
-                android:id="@+id/ic_high_name"
-                style="@style/bloodTextStyle"
-                android:text="@string/ic_high_pressure" />
-
-            <TextView
-                android:id="@+id/ic_high_value"
-                style="@style/bloodTextStyle"
-                android:layout_below="@id/ic_high_name"
-                android:layout_centerHorizontal="true"
-                android:text="@{highValue}"/>
-        </RelativeLayout>
-
-        <RelativeLayout
-            android:id="@+id/ic_low_layout"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="bottom|end"
-            android:layout_marginEnd="30dp"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}">
-
-            <TextView
-                android:id="@+id/ic_low_name"
-                style="@style/bloodTextStyle"
-                android:text="@string/ic_low_pressure" />
-
-            <TextView
-                android:id="@+id/ic_low_value"
-                style="@style/bloodTextStyle"
-                android:layout_below="@id/ic_low_name"
-                android:layout_centerHorizontal="true"
-                android:text="@{lowValue}"/>
-        </RelativeLayout>
-
-    </FrameLayout>
-
-</layout>
diff --git a/app/src/main/res/layout/fragment_weather.xml b/app/src/main/res/layout/fragment_weather.xml
deleted file mode 100644 (file)
index 8121684..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools">
-
-    <data>
-
-        <import type="android.graphics.drawable.Drawable" />
-
-        <import type="android.view.View"/>
-
-        <variable
-            name="weatherIcon"
-            type="Drawable" />
-
-        <variable
-            name="weatherState"
-            type="String" />
-
-        <variable
-            name="weatherTemp"
-            type="String" />
-
-        <variable
-            name="weatherCity"
-            type="String" />
-
-        <variable
-            name="weatherSection"
-            type="String" />
-
-        <variable
-            name="isErrorTips"
-            type="String" />
-
-        <variable
-            name="isShowTips"
-            type="boolean" />
-    </data>
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@color/mainBgColor"
-        tools:context=".fragment.WeatherFragment">
-
-        <ImageView
-            android:id="@+id/weather_icon_iv"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerHorizontal="true"
-            android:layout_marginTop="20dp"
-            android:src="@{weatherIcon}" />
-
-        <TextView
-            android:id="@+id/weather_tips_iv"
-            style="@style/WeatherTextStyle"
-            android:layout_below="@id/weather_icon_iv"
-            android:layout_centerHorizontal="true"
-            android:text="@{isErrorTips}"
-            android:textSize="36sp"
-            android:visibility="@{isShowTips ? View.VISIBLE : View.GONE}"/>
-
-        <TextView
-            android:id="@+id/weather_state_tv"
-            style="@style/WeatherTextStyle"
-            android:layout_below="@id/weather_icon_iv"
-            android:layout_centerHorizontal="true"
-            android:text="@{weatherState}"
-            android:textSize="52sp"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}"/>
-
-        <View
-            android:id="@+id/weather_sp"
-            android:layout_width="1dp"
-            android:layout_height="40dp"
-            android:layout_below="@id/weather_state_tv"
-            android:layout_centerHorizontal="true"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}"/>
-
-        <TextView
-            style="@style/WeatherTextStyle"
-            android:layout_below="@id/weather_state_tv"
-            android:layout_marginEnd="5dp"
-            android:layout_toStartOf="@id/weather_sp"
-            android:text="@{weatherTemp}"
-            android:textColor="#FF9800"
-            android:textSize="62sp"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}"/>
-
-        <TextView
-            android:id="@+id/weather_city_tv"
-            style="@style/WeatherTextStyle"
-            android:layout_below="@id/weather_state_tv"
-            android:layout_marginStart="5dp"
-            android:layout_toEndOf="@id/weather_sp"
-            android:text="@{weatherCity}"
-            android:textSize="30sp"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}"/>
-
-        <TextView
-            style="@style/WeatherTextStyle"
-            android:layout_below="@id/weather_city_tv"
-            android:layout_marginStart="5dp"
-            android:layout_toEndOf="@id/weather_sp"
-            android:text="@{weatherSection}"
-            android:textSize="30sp"
-            android:visibility="@{isShowTips ? View.GONE : View.VISIBLE}"/>
-    </RelativeLayout>
-</layout>
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_baoxue.png b/app/src/main/res/mipmap-mdpi/weather_status_baoxue.png
deleted file mode 100644 (file)
index 4257a7b..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_baoxue.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_baoyu.png b/app/src/main/res/mipmap-mdpi/weather_status_baoyu.png
deleted file mode 100644 (file)
index ad1d7e7..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_baoyu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_bingbao.png b/app/src/main/res/mipmap-mdpi/weather_status_bingbao.png
deleted file mode 100644 (file)
index 91005e2..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_bingbao.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_daxue.png b/app/src/main/res/mipmap-mdpi/weather_status_daxue.png
deleted file mode 100644 (file)
index f9748b8..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_daxue.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_dayu.png b/app/src/main/res/mipmap-mdpi/weather_status_dayu.png
deleted file mode 100644 (file)
index ea95f73..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_dayu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_duoyun.png b/app/src/main/res/mipmap-mdpi/weather_status_duoyun.png
deleted file mode 100644 (file)
index 73c5477..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_duoyun.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_leizhenyu.png b/app/src/main/res/mipmap-mdpi/weather_status_leizhenyu.png
deleted file mode 100644 (file)
index 7a22ef5..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_leizhenyu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_none.png b/app/src/main/res/mipmap-mdpi/weather_status_none.png
deleted file mode 100644 (file)
index e2805a8..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_none.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_qing.png b/app/src/main/res/mipmap-mdpi/weather_status_qing.png
deleted file mode 100644 (file)
index cbc167d..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_qing.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_qingwu.png b/app/src/main/res/mipmap-mdpi/weather_status_qingwu.png
deleted file mode 100644 (file)
index db48257..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_qingwu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_qingyu.png b/app/src/main/res/mipmap-mdpi/weather_status_qingyu.png
deleted file mode 100644 (file)
index 50edb91..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_qingyu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_qingyun.png b/app/src/main/res/mipmap-mdpi/weather_status_qingyun.png
deleted file mode 100644 (file)
index 925d672..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_qingyun.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_shachenbao.png b/app/src/main/res/mipmap-mdpi/weather_status_shachenbao.png
deleted file mode 100644 (file)
index 76dae87..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_shachenbao.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_wu.png b/app/src/main/res/mipmap-mdpi/weather_status_wu.png
deleted file mode 100644 (file)
index 6294853..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_wu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_xiaoxue.png b/app/src/main/res/mipmap-mdpi/weather_status_xiaoxue.png
deleted file mode 100644 (file)
index 2e5f312..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_xiaoxue.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_xiaoyu.png b/app/src/main/res/mipmap-mdpi/weather_status_xiaoyu.png
deleted file mode 100644 (file)
index f0b6e1d..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_xiaoyu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_yangsha.png b/app/src/main/res/mipmap-mdpi/weather_status_yangsha.png
deleted file mode 100644 (file)
index 22c5b41..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_yangsha.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_yin.png b/app/src/main/res/mipmap-mdpi/weather_status_yin.png
deleted file mode 100644 (file)
index 09bbd4d..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_yin.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_yinduoyun.png b/app/src/main/res/mipmap-mdpi/weather_status_yinduoyun.png
deleted file mode 100644 (file)
index 7a97d25..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_yinduoyun.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_yinyu.png b/app/src/main/res/mipmap-mdpi/weather_status_yinyu.png
deleted file mode 100644 (file)
index e90d876..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_yinyu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_zhenyu.png b/app/src/main/res/mipmap-mdpi/weather_status_zhenyu.png
deleted file mode 100644 (file)
index 526af7f..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_zhenyu.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_zhongxue.png b/app/src/main/res/mipmap-mdpi/weather_status_zhongxue.png
deleted file mode 100644 (file)
index 54fd365..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_zhongxue.png and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/weather_status_zhongyu.png b/app/src/main/res/mipmap-mdpi/weather_status_zhongyu.png
deleted file mode 100644 (file)
index d8009a3..0000000
Binary files a/app/src/main/res/mipmap-mdpi/weather_status_zhongyu.png and /dev/null differ
index 0b6bcc9..0f1c94d 100644 (file)
@@ -4,18 +4,6 @@
     <!-- TODO: Remove or change this placeholder text -->
     <string name="hello_blank_fragment">Hello blank fragment</string>
 
-    <string name="ic_high_pressure">高压</string>
-    <string name="ic_low_pressure">低压</string>
-    <string name="ic_heart_rate">心率</string>
-
-    <string name="tips_not_device">未检测到设备</string>
-    <string name="tips_not_wear">未正确佩戴</string>
-
-    <string name="tips_quiet_please">请保持安静</string>
-    <string name="tips_start_check">准备测量</string>
-    <string name="tips_ing_check">正在测量中</string>
-    <string name="tips_stop_check">已停止测量</string>
-    <string name="tips_not_data_check">未测量到数据</string>
 
     <string name="ped_head_name">个人设置</string>
     <string name="ped_height_name">身高</string>
     <string name="tips_calories_unit">大卡</string>
     <string name="tips_distance_unit">公里</string>
 
-    <string name="tips_error_weather_no_data">未获取到天气</string>
 
-    <string name="weather_temp_degree">%1$s℃</string>
-    <string name="weather_temp_space_degree">%1$s~%2$s℃</string>
 
     <string name="ped_main_today">今日</string>
     <string name="ped_main_step">步</string>
+
+    <string name="program_abnormal">很抱歉,程序出现异常,即将退出</string>
 </resources>
index daefc08..333efdb 100644 (file)
@@ -8,13 +8,6 @@
         <item name="colorAccent">@color/colorAccent</item>
     </style>
 
-    <style name="bloodTextStyle">
-        <item name="android:layout_width">wrap_content</item>
-        <item name="android:layout_height">wrap_content</item>
-        <item name="android:textColor">#FFFFFF</item>
-        <item name="android:textSize">42sp</item>
-    </style>
-
     <style name="RecordTextStyle">
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>
         <item name="android:includeFontPadding">false</item>
     </style>
 
-    <style name="WeatherTextStyle">
-        <item name="android:layout_width">wrap_content</item>
-        <item name="android:layout_height">wrap_content</item>
-        <item name="android:textColor">#FFFFFF</item>
-        <item name="android:includeFontPadding">false</item>
-    </style>
 
 </resources>
diff --git a/app/version_code.properties b/app/version_code.properties
new file mode 100644 (file)
index 0000000..ca07aa4
--- /dev/null
@@ -0,0 +1,2 @@
+#Mon Mar 23 18:58:57 CST 2020
+VERSION_CODE=11