release V161
authorsnickersun <scy@incartech.cn>
Mon, 12 Oct 2020 12:18:55 +0000 (20:18 +0800)
committersnickersun <scy@incartech.cn>
Mon, 12 Oct 2020 12:18:55 +0000 (20:18 +0800)
1、给S123 Vitrack项目添加 url 二维码支持
2、给S123 Vitrack 主界面添加 体温显示(目前与计步互斥,只能二选一)
3、把网络传输图标去掉,改为显示协议服务器是否连通
4、显示蓝牙,wifi状态,去掉电池百分比
5、添加天气菜单

38 files changed:
app/release/ICL02Launcher_V161_202010122014_release.apk [new file with mode: 0644]
app/release/output.json
app/src/main/AndroidManifest.xml
app/src/main/java/com/ic/launcher/QrCodeActivity.java
app/src/main/java/com/ic/launcher/configure/l02/L02AppInfo.java
app/src/main/java/com/ic/launcher/configure/l02/L02Icon.java
app/src/main/java/com/ic/launcher/fragment/L02MainFragment.java
app/src/main/java/com/ic/launcher/mode/L02MainModel.java
app/src/main/java/com/ic/launcher/presenter/HardwarePresenter.java
app/src/main/java/com/ic/launcher/presenter/PhoneStatePresenter.java
app/src/main/java/com/ic/launcher/presenter/QueryPhoneState.java
app/src/main/java/com/ic/launcher/util/SPUtils.java
app/src/main/java/com/ic/launcher/widget/WidgetBatteryStateView.java
app/src/main/java/com/ic/launcher/widget/WidgetPhoneStateView.java
app/src/main/res/layout/fragment_l02_main.xml
app/src/main/res/layout/widget_phone_state_layout.xml
app/src/main/res/mipmap-mdpi/qs_bluetooth.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_locate_type_gps.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_locate_type_lbs.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_locate_type_wifi.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_phone_type_1x.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_phone_type_3g.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_phone_type_4g.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_phone_type_e.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_phone_type_g.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_phone_type_h.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_phone_type_u.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_server_connected_off.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_server_connected_on.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_volte.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_volte_for_ais.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_wifi_level_0.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_wifi_level_1.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_wifi_level_2.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/qs_wifi_level_3.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/temp_icon.png [new file with mode: 0644]
app/src/main/res/values-ja/strings.xml
app/version_code.properties

diff --git a/app/release/ICL02Launcher_V161_202010122014_release.apk b/app/release/ICL02Launcher_V161_202010122014_release.apk
new file mode 100644 (file)
index 0000000..a467a46
Binary files /dev/null and b/app/release/ICL02Launcher_V161_202010122014_release.apk differ
index 03e9116..ab4c824 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":159,"versionName":"202009291122","enabled":true,"outputFile":"ICL02Launcher_V159_202009291122_release.apk","fullName":"release","baseName":"release"},"path":"ICL02Launcher_V159_202009291122_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":161,"versionName":"202010122014","enabled":true,"outputFile":"ICL02Launcher_V161_202010122014_release.apk","fullName":"release","baseName":"release"},"path":"ICL02Launcher_V161_202010122014_release.apk","properties":{}}]
\ No newline at end of file
index c4ed244..b3e7fc6 100644 (file)
@@ -4,6 +4,7 @@
     package="com.ic.launcher"
     android:sharedUserId="android.uid.system">
 
+    <uses-permission android:name="android.permission.BLUETOOTH" />
     <uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/>
     <uses-permission android:name="android.permission.SHUTDOWN" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
index 2ddb8a2..d259b6e 100644 (file)
@@ -16,6 +16,7 @@ import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Bundle;
+import android.os.FileUriExposedException;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.TypedValue;
@@ -28,10 +29,18 @@ import com.ic.launcher.util.IcLog;
 import com.ic.launcher.util.QRCodeUtil;
 import com.ic.launcher.util.SystemUtils;
 
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
 public class QrCodeActivity extends AppCompatActivity implements
         MainClockGestureDetectorImpl.OnClockGestureFlingListener {
 
     final static String KeyIMEI = "persist.sys.protocol_IMEI";
+    final static String KeyQRURIFILE = "persist.sys.qrUriFile";
     private GestureDetectorCompat gesture;
 
     @Override
@@ -44,11 +53,36 @@ public class QrCodeActivity extends AppCompatActivity implements
         if (TextUtils.isEmpty(imei.trim())) {
             imei = GetIMEI();
         }
+        String qrUri="";
+        String qrfilepath= SystemUtils.getSystemPropertiesString(KeyQRURIFILE, "");
+        if (!TextUtils.isEmpty(qrfilepath.trim()) && new File(qrfilepath).exists() ) {
+            try {
+                FileInputStream fis=new FileInputStream(new File(qrfilepath));
+                byte buf[]=new byte[1024];
+
+                int ret=fis.read(buf);
+                fis.close();
+                if (ret >0) {
+                    char bufc[] = new char[ret];
+                    for(int i=0;i<ret;i++)
+                        bufc[i]=(char)buf[i];
+                        qrUri = String.copyValueOf(bufc, 0, ret);
+                }
+            } catch (FileNotFoundException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+        }
+
+        if (TextUtils.isEmpty(qrUri))
+            qrUri=imei;
         if (TextUtils.isEmpty(imei)) {
             qrCodeBinding.setQrCodeDrawable(ContextCompat.getDrawable(this, R.drawable.ic_qr_code_imei));
             qrCodeBinding.setQrCodeText("未查询到IEMI");
         } else {
-            Bitmap mBitmap = QRCodeUtil.createQRCodeBitmap(imei, (int) dpToPx(200), (int) dpToPx(200));
+            Bitmap mBitmap = QRCodeUtil.createQRCodeBitmap(qrUri, (int) dpToPx(200), (int) dpToPx(200));
             qrCodeBinding.setQrCodeDrawable(new BitmapDrawable(getResources(), mBitmap));
             qrCodeBinding.setQrCodeText(imei);
         }
index a67a0a3..1c0ace6 100644 (file)
@@ -73,6 +73,10 @@ public class L02AppInfo {
             //运动
             add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_pedometer_l02, R.string.app_Sport,
                     "com.ic.hardware", "com.ic.hardware.PedometerActivity"));
+            //            //天气
+            add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_weather_l02, R.string.app_Weather,
+                    "com.ic.weather", "com.ic.weather.WeatherActivity"));
+
             //联系人
             add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_contacts_l02, R.string.app_ContactName,
                     "com.enqualcomm.imessage", "com.enqualcomm.imessage.ui.PhoneDirectoryActivity"));
@@ -87,9 +91,6 @@ public class L02AppInfo {
             //微聊
 //            add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_talk_l02, R.string.app_Chat,
 //                    "com.enqualcomm.imessage", "com.enqualcomm.imessage.ui.MicroChatActivity"));
-//            //天气
-//            add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_weather_l02, R.string.app_Weather,
-//                    "com.ic.weather", "com.ic.weather.WeatherActivity"));
 
 
 
index 404945b..84c93eb 100644 (file)
@@ -18,15 +18,20 @@ public class L02Icon {
 
     //L02 信号图片
     public static int[] l02PhoneTypeResId = new int[]{
-            R.mipmap.l02_phone_type_4g
+//            R.mipmap.l02_phone_type_4g,
+            R.mipmap.qs_phone_type_4g,
+            R.mipmap.qs_phone_type_3g,
+            R.mipmap.qs_phone_type_g
     };
 
     //L02 信号图片
     public static int[] l02TransportResId = new int[]{
-            R.mipmap.l02_data_transport_0,
-            R.mipmap.l02_data_transport_1,
-            R.mipmap.l02_data_transport_2,
-            R.mipmap.l02_data_transport_3
+            R.mipmap.qs_server_connected_off,
+            R.mipmap.qs_server_connected_on
+//            R.mipmap.l02_data_transport_0,
+//            R.mipmap.l02_data_transport_1,
+//            R.mipmap.l02_data_transport_2,
+//            R.mipmap.l02_data_transport_3
     };
 
     //L02 信号图片
index 983e8bb..3145c5a 100644 (file)
@@ -8,16 +8,21 @@ import androidx.annotation.NonNull;
 import androidx.fragment.app.FragmentActivity;
 import androidx.lifecycle.ViewModelProvider;
 
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
 
+import com.ic.launcher.R;
 import com.ic.launcher.configure.l02.L02Icon;
 import com.ic.launcher.databinding.FragmentL02MainBinding;
 import com.ic.launcher.mode.BaseModel;
 import com.ic.launcher.mode.L02MainModel;
 import com.ic.launcher.util.IcLog;
 import com.ic.launcher.util.SPUtils;
+import com.ic.launcher.util.SystemUtils;
 
 
 public class L02MainFragment extends BaseFragment {
@@ -54,10 +59,23 @@ public class L02MainFragment extends BaseFragment {
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
+
+
         mainBinding = FragmentL02MainBinding.inflate(inflater, container, false);
         mainBinding.setHeartValue(String.valueOf(SPUtils.getBloodHeartSP(mContext)));
+        mainBinding.setTempValue(String.format("%.1f",SPUtils.getTempSP(mContext)));
         chargingState=false;
         mainBinding.setStepValue("0");
+        if(SystemUtils.isS123())
+        {
+            Log.i(TAG,"isS123");
+            mainBinding.setShowStep(View.GONE);
+            mainBinding.setShowTemp(View.VISIBLE);
+        }else{
+            Log.i(TAG,"not S123");
+            mainBinding.setShowTemp(View.GONE);
+            mainBinding.setShowStep(View.VISIBLE);
+        }
         //监听事件
         initOnTouchListener(mainBinding.getRoot());
         return mainBinding.getRoot();
@@ -107,6 +125,18 @@ public class L02MainFragment extends BaseFragment {
                 mainBinding.setPhoneTransport(resID);
             }
         });
+
+        model.getObservableBTStatus().observe(this,btStatus ->{
+            if(mainBinding !=null){
+                mainBinding.setBtStatus(btStatus);
+            }
+        });
+
+        model.getObservableWiFiStatus().observe(this, wifiStatus ->{
+            if(mainBinding !=null){
+                mainBinding.setWifiStatus(wifiStatus);
+            }
+        });
     }
 
     private void observeBatteryValue(L02MainModel model) {
@@ -164,6 +194,12 @@ public class L02MainFragment extends BaseFragment {
                 mainBinding.setStepValue(ped);
             }
         });
+        model.getObservableHardwareTemp().observe(this, temp -> {
+            if(mainBinding != null){
+                IcLog.i(TAG,"action get temp "+temp);
+                mainBinding.setTempValue(temp);
+            }
+        });
     }
 
     private void updateTimeValue(int[] value){
index 8570496..98a1d8f 100644 (file)
@@ -115,6 +115,13 @@ public class L02MainModel extends BaseModel {
         }
         return null;
     }
+    public LiveData<String> getObservableHardwareTemp() {
+        PresenterCycle state = getPresenterList(HARDWARE_LIST_INDEX);
+        if(state != null){
+            return ((HardwarePresenter)state).getObsHardwareTemp();
+        }
+        return null;
+    }
 
     public LiveData<String> getObservableWeek() {
         PresenterCycle state = getPresenterList(TIME_LIST_INDEX);
@@ -139,4 +146,21 @@ public class L02MainModel extends BaseModel {
         }
         return null;
     }
+
+    public LiveData<Boolean> getObservableBTStatus() {
+        PresenterCycle state = getPresenterList(PHONE_LIST_INDEX);
+        if(state != null){
+            return ((PhoneStatePresenter)state).getBTStatusObservalbe();
+        }
+        return null;
+    }
+
+    public LiveData<Boolean> getObservableWiFiStatus() {
+        PresenterCycle state = getPresenterList(PHONE_LIST_INDEX);
+        if(state != null){
+            return ((PhoneStatePresenter)state).getWiFiStatusObservable();
+        }
+        return null;
+    }
+
 }
index 148ae14..00bc236 100644 (file)
@@ -10,18 +10,23 @@ import androidx.lifecycle.MediatorLiveData;
 
 import com.ic.launcher.util.IcLog;
 import com.ic.launcher.util.SPUtils;
+import com.ic.launcher.util.SystemUtils;
 
 public class HardwarePresenter extends PresenterCycle {
     private static final String TAG = "HardwarePresenter";
 
     private static final String HEART_ACTION = "com.ic.action.BLOOD_HEART";
     private static final String PED_ACTION = "com.ic.action.PED_COUNT";
+    public static final String ACTION_TEMP_RESULT = "com.ic.action.temp_result";
+    public static final String KEY_TEMP_BODY = "body";  // double 体温
+    public static final String KEY_TEMP_WRIST = "wrist";  //  double 腕温
 
     private static final String GET_PED_ACTION = "com.ic.action.GET_PED_COUNT";
 
     private Context mContext;
     private MediatorLiveData<String> mObsHardwareHeart;
     private MediatorLiveData<String> mObsHardwarePed;
+    private MediatorLiveData<String> mObsHardwareTemp;
 
     @Override
     public void onPresenterCreate() {
@@ -45,6 +50,7 @@ public class HardwarePresenter extends PresenterCycle {
         this.mContext = context;
         mObsHardwareHeart = new MediatorLiveData<>();
         mObsHardwarePed = new MediatorLiveData<>();
+        mObsHardwareTemp = new MediatorLiveData<>();
     }
 
     public MediatorLiveData<String> getObsHardwareHeart() {
@@ -52,9 +58,15 @@ public class HardwarePresenter extends PresenterCycle {
     }
 
     public MediatorLiveData<String> getObsHardwarePed() {
+
         return mObsHardwarePed;
     }
 
+    public MediatorLiveData<String> getObsHardwareTemp() {
+
+        return mObsHardwareTemp;
+    }
+
     private void sendGetPedBroadcast(){
         Intent pedIntent = new Intent();
         pedIntent.setAction(GET_PED_ACTION);
@@ -65,6 +77,7 @@ public class HardwarePresenter extends PresenterCycle {
         IntentFilter filter = new IntentFilter();
         filter.addAction(PED_ACTION);
         filter.addAction(HEART_ACTION);
+        filter.addAction(ACTION_TEMP_RESULT);
         mContext.registerReceiver(mIntentReceiver, filter);
     }
 
@@ -81,6 +94,7 @@ public class HardwarePresenter extends PresenterCycle {
         public void onReceive(Context context, Intent intent) {
             if (intent != null) {
                 String acyion = intent.getAction();
+                IcLog.i(TAG,"receive Action "+acyion);
                 if(TextUtils.isEmpty(acyion)){
                     return;
                 }
@@ -94,6 +108,18 @@ public class HardwarePresenter extends PresenterCycle {
                         mObsHardwareHeart.setValue(String.valueOf(heart));
                         SPUtils.setBloodHeartSP(mContext,heart);
                         break;
+                    case ACTION_TEMP_RESULT:
+                        double bodytemp = intent.getDoubleExtra(KEY_TEMP_BODY,0.0f);
+                        double wristtemp = intent.getDoubleExtra(KEY_TEMP_WRIST,0.0f);
+                        boolean disablewristtemp= SystemUtils.getSystemPropertiesBoolean("persyst.sys.disableWristTemp",false);
+                        IcLog.i(TAG,"action get Temp body "+bodytemp+", wrist "+wristtemp);
+                        if (disablewristtemp) {
+                            mObsHardwareTemp.setValue(String.format("%.1f", wristtemp));
+                        }else{
+                            mObsHardwareTemp.setValue(String.format("%.1f", bodytemp));
+                        }
+                        SPUtils.setTempSP(mContext,(float)bodytemp);
+                        break;
                 }
             }
         }
index 0986942..0876060 100644 (file)
@@ -18,6 +18,8 @@ public class PhoneStatePresenter extends PresenterCycle {
     private MediatorLiveData<Integer> mObsPhoneTransportID;
     private MediatorLiveData<Integer> mObsPhoneTypeID;
     private MediatorLiveData<Integer> mObsPhoneSignalID;
+    private MediatorLiveData<Boolean> mObsBTStatusID;
+    private MediatorLiveData<Boolean> mObsWiFiStatusID;
 
     @Override
     public void onPresenterResume() {
@@ -56,8 +58,9 @@ public class PhoneStatePresenter extends PresenterCycle {
         mObsPhoneTypeID = new MediatorLiveData<>();
         mObsPhoneSignalID = new MediatorLiveData<>();
         mObsPhoneTransportID = new MediatorLiveData<>();
-
-        queryState = new QueryPhoneState(context,mObsPhoneTypeID,mObsPhoneSignalID,mObsPhoneTransportID);
+        mObsBTStatusID = new MediatorLiveData<>();
+        mObsWiFiStatusID = new MediatorLiveData<>();
+        queryState = new QueryPhoneState(context,mObsPhoneTypeID,mObsPhoneSignalID,mObsPhoneTransportID,mObsBTStatusID,mObsWiFiStatusID);
     }
 
     public LiveData<Integer> getPhoneTypeObservable() {
@@ -71,4 +74,14 @@ public class PhoneStatePresenter extends PresenterCycle {
     public LiveData<Integer> getPhoneTransportObservable() {
         return mObsPhoneTransportID;
     }
+
+
+    public LiveData<Boolean> getBTStatusObservalbe() {
+        return mObsBTStatusID;
+    }
+
+    public LiveData<Boolean> getWiFiStatusObservable() {
+        return mObsWiFiStatusID;
+    }
+
 }
index 8e526a5..5d7ab82 100644 (file)
@@ -1,7 +1,9 @@
 package com.ic.launcher.presenter;
 
+import android.bluetooth.BluetoothAdapter;
 import android.content.Context;
 import android.net.TrafficStats;
+import android.net.wifi.WifiManager;
 import android.os.Message;
 import android.telephony.CellIdentityCdma;
 import android.telephony.CellInfo;
@@ -12,10 +14,12 @@ import android.telephony.CellInfoWcdma;
 import android.telephony.CellSignalStrengthGsm;
 import android.telephony.TelephonyManager;
 import android.telephony.gsm.GsmCellLocation;
+import android.util.Log;
 
 import androidx.lifecycle.MediatorLiveData;
 
 import com.ic.launcher.util.IcLog;
+import com.ic.launcher.util.SystemUtils;
 
 import java.util.List;
 
@@ -29,10 +33,15 @@ public class QueryPhoneState extends QueryThread {
 
 
 
-    private TelephonyManager mTelephony;
+    private TelephonyManager mTelephony=null;
+    private BluetoothAdapter mBtAdapter=null;
+    private WifiManager mWiFiManager=null;
+
     private MediatorLiveData<Integer> mObsPhoneTypeID;
     private MediatorLiveData<Integer> mObsPhoneSignalID;
     private MediatorLiveData<Integer> mObsPhoneTransportID;
+    private MediatorLiveData<Boolean> mObsBTStatusID;
+    private MediatorLiveData<Boolean> mObsWiFiStatusID;
 
     private long receivedWork;
     private long sendNetWork;
@@ -43,11 +52,17 @@ public class QueryPhoneState extends QueryThread {
     public QueryPhoneState(Context context,
                            MediatorLiveData<Integer> mObsPhoneTypeID,
                            MediatorLiveData<Integer> mObsPhoneSignalID,
-                           MediatorLiveData<Integer> mObsPhoneTransportID) {
-        mTelephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+                           MediatorLiveData<Integer> mObsPhoneTransportID,
+                           MediatorLiveData<Boolean> mObsBTStatusID,
+                           MediatorLiveData<Boolean> mObsWiFiStatusID) {
+        this.mTelephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+        this.mWiFiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
+        this.mBtAdapter = BluetoothAdapter.getDefaultAdapter();
         this.mObsPhoneTypeID = mObsPhoneTypeID;
         this.mObsPhoneSignalID = mObsPhoneSignalID;
         this.mObsPhoneTransportID = mObsPhoneTransportID;
+        this.mObsBTStatusID = mObsBTStatusID;
+        this.mObsWiFiStatusID = mObsWiFiStatusID;
     }
 
     public void destroyPhoneState() {
@@ -55,36 +70,72 @@ public class QueryPhoneState extends QueryThread {
         mObsPhoneTypeID = null;
         mObsPhoneSignalID = null;
         mObsPhoneTransportID = null;
+        mObsWiFiStatusID = null;
+        mObsBTStatusID = null;
     }
 
     @Override
     void onThreadExecute() {
         if (querySimCardState()) {
+            queryPhoneNetworkTypeResId(mTelephony);
             getSignalStrength();
-            getTrafficPollerValue();
+
         }
+        getTrafficPollerValue();
+        queryBTWiFiStatus();
+
     }
 
     private void getTrafficPollerValue() {
-        long rw = TrafficStats.getMobileRxPackets();
-        long sw = TrafficStats.getMobileTxPackets();
-        int index = 0;
-        if (rw > receivedWork && sw > sendNetWork) {
-            index = 3;
-        } else {
-            if (rw > receivedWork) {
-                index = 1;
+        boolean connected = SystemUtils.getSystemPropertiesBoolean("persist.sys.server_connected",false);
+
+        if (connected){
+            mObsPhoneTransportID.postValue(l02TransportResId[1]);
+        }else{
+            mObsPhoneTransportID.postValue(l02TransportResId[0]);
+        }
+//
+//        long rw = TrafficStats.getMobileRxPackets();
+//        long sw = TrafficStats.getMobileTxPackets();
+//        int index = 0;
+//        if (rw > receivedWork && sw > sendNetWork) {
+//            index = 3;
+//        } else {
+//            if (rw > receivedWork) {
+//                index = 1;
+//            }
+//            if (sw > sendNetWork) {
+//                index = 2;
+//            }
+//        }
+//        IcLog.i(TAG, "receivedWork:" + receivedWork + " sendNetWork:" + sendNetWork);
+//        receivedWork = rw;
+//        sendNetWork = sw;
+//        mObsPhoneTransportID.postValue(l02TransportResId[index%2]);
+    }
+
+    private boolean queryBTWiFiStatus(){
+        if(mBtAdapter!=null)
+        {
+            if(mBtAdapter.isEnabled()){
+                mObsBTStatusID.postValue(true);
+            }else{
+                mObsBTStatusID.postValue(false);
             }
-            if (sw > sendNetWork) {
-                index = 2;
+        }
+
+        if(mWiFiManager!=null)
+        {
+            if(mWiFiManager.isWifiEnabled())
+            {
+                mObsWiFiStatusID.postValue(true);
+            }else{
+                mObsWiFiStatusID.postValue(false);
             }
         }
-        IcLog.i(TAG, "receivedWork:" + receivedWork + "sendNetWork:" + sendNetWork);
-        receivedWork = rw;
-        sendNetWork = sw;
-        mObsPhoneTransportID.postValue(l02TransportResId[index]);
-    }
 
+        return true;
+    }
     private boolean querySimCardState() {
 
         if (mTelephony == null) {
@@ -103,7 +154,6 @@ public class QueryPhoneState extends QueryThread {
 
         switch (simState) {
             case TelephonyManager.SIM_STATE_READY:
-                mObsPhoneTypeID.postValue(l02PhoneTypeResId[0]);
                 mObsPhoneSignalID.postValue(l02SignalResId[6]);
                 flag = true;
                 break;
@@ -120,6 +170,7 @@ public class QueryPhoneState extends QueryThread {
         return flag;
     }
 
+
     public void getSignalStrength() {
         if (mTelephony == null) {
             return;
@@ -150,10 +201,36 @@ public class QueryPhoneState extends QueryThread {
         }
     }
 
-    private int queryPhoneNetworkTypeResId(TelephonyManager tm) {
-        if (tm.getNetworkType() == TelephonyManager.NETWORK_TYPE_LTE) {
-            return l02PhoneTypeResId[0];
+    private void queryPhoneNetworkTypeResId(TelephonyManager tm) {
+        int networkType = tm.getNetworkType();
+        int index=2;
+        switch (networkType) {
+            case TelephonyManager.NETWORK_TYPE_GPRS:
+            case TelephonyManager.NETWORK_TYPE_EDGE:
+            case TelephonyManager.NETWORK_TYPE_CDMA:
+            case TelephonyManager.NETWORK_TYPE_1xRTT:
+            case TelephonyManager.NETWORK_TYPE_IDEN:
+                index=2;
+                break;
+            case TelephonyManager.NETWORK_TYPE_UMTS:
+            case TelephonyManager.NETWORK_TYPE_EVDO_0:
+            case TelephonyManager.NETWORK_TYPE_EVDO_A:
+            case TelephonyManager.NETWORK_TYPE_HSDPA:
+            case TelephonyManager.NETWORK_TYPE_HSUPA:
+            case TelephonyManager.NETWORK_TYPE_HSPA:
+            case TelephonyManager.NETWORK_TYPE_EVDO_B:
+            case TelephonyManager.NETWORK_TYPE_EHRPD:
+            case TelephonyManager.NETWORK_TYPE_HSPAP:
+                index=1;
+                break;
+            case TelephonyManager.NETWORK_TYPE_LTE:
+                index=0;
+                break;
+            default:
+                break;
         }
-        return -1;
+        Log.i(TAG,"networkType="+  networkType+" ,PhoneTypeResid="+index);
+        mObsPhoneTypeID.postValue(l02PhoneTypeResId[index]);
+
     }
 }
index 22b92f7..a42e127 100644 (file)
@@ -6,6 +6,7 @@ import android.content.SharedPreferences;
 public class SPUtils {
 
     private static final String Blood_Heart = "Blood_Heart";
+    private static final String BODY_TEMP = "Body_temp";
 
     private static SharedPreferences getSP(Context context) {
         return context.getSharedPreferences("IcBloodSet", Context.MODE_PRIVATE);
@@ -24,6 +25,16 @@ public class SPUtils {
         }
     }
 
+    public static float getTempSP(Context context) {
+        return getSP(context).getFloat(BODY_TEMP, 0.0f);
+    }
+    public static void setTempSP(Context context,float body_temp) {
+        SharedPreferences.Editor editor = getSP(context).edit();
+        if (editor != null) {
+            editor.putFloat(BODY_TEMP, body_temp);
+            editor.apply();
+        }
+    }
     private static final String Clock_Main= "Clock_Main";
 
     private static SharedPreferences getClockSP(Context context) {
index 9d44498..2ac5b15 100644 (file)
@@ -39,8 +39,8 @@ public class WidgetBatteryStateView extends LinearLayout {
     }
 
     public void updateBatteryValue(String bv) {
+        batteryTv.setVisibility(GONE);
         batteryTv.setText(bv);
-
     }
 
     public void updateBatteryDrawable(int netType) {
index c9d56b7..8223dee 100644 (file)
@@ -19,6 +19,8 @@ public class WidgetPhoneStateView extends LinearLayout {
     private ImageView signalIv;
     private ImageView netTypeIv;
     private ImageView transportIv;
+    private ImageView BTIV;
+    private ImageView WiFiIv;
 
     public WidgetPhoneStateView(Context context) {
         this(context, null);
@@ -28,6 +30,8 @@ public class WidgetPhoneStateView extends LinearLayout {
         this(context, attrs, 0);
     }
 
+
+
     public WidgetPhoneStateView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
 
@@ -36,6 +40,8 @@ public class WidgetPhoneStateView extends LinearLayout {
         signalIv = view.findViewById(R.id.signal_iv);
         netTypeIv = view.findViewById(R.id.net_type_iv);
         transportIv = view.findViewById(R.id.transport_iv);
+        BTIV = view.findViewById(R.id.status_bt);
+        WiFiIv = view.findViewById(R.id.status_wifi);
     }
 
     public void updateSinalDrawable(int signal) {
@@ -50,6 +56,24 @@ public class WidgetPhoneStateView extends LinearLayout {
         transportIv.setImageResource(transport);
     }
 
+    public void updateServerConnectionDrawable(int connected){
+        transportIv.setImageResource(connected);
+    }
+
+    public void updateBTDrawable(boolean visable){
+        BTIV.setImageResource(R.mipmap.qs_bluetooth);
+        if (visable)
+            BTIV.setVisibility(VISIBLE);
+        else
+            BTIV.setVisibility(GONE);
+    }
+    public void updateWiFiDrawable(boolean visable){
+        WiFiIv.setImageResource(R.mipmap.qs_wifi_level_3);
+        if(visable)
+            WiFiIv.setVisibility(VISIBLE);
+        else
+            WiFiIv.setVisibility(GONE);
+    }
     public void updatePhoneVisibility (boolean state){
         if(state){
             netTypeIv.setVisibility(VISIBLE);
@@ -61,13 +85,16 @@ public class WidgetPhoneStateView extends LinearLayout {
 
     }
 
-    @BindingAdapter(value = {"signalDrawable", "netTypeDrawable", "transportDrawable", "phoneShow"}, requireAll = false)
-    public static void updatePhoneState(WidgetPhoneStateView view, int signal, int netType, int transport,boolean isShow) {
+    @BindingAdapter(value = {"signalDrawable", "netTypeDrawable", "transportDrawable", "phoneShow","btenabled","wifienabled"}, requireAll = false)
+    public static void updatePhoneState(WidgetPhoneStateView view, int signal, int netType, int transport,boolean isShow,boolean btenabled,boolean wifienabled) {
         if (view != null) {
             view.updateSinalDrawable(signal);
             view.updateNetTypeDrawable(netType);
             view.updateTransportDrawable(transport);
+            view.updateServerConnectionDrawable(transport);
             view.updatePhoneVisibility(isShow);
+            view.updateBTDrawable(btenabled);
+            view.updateWiFiDrawable(wifienabled);
         }
     }
 }
index 0793555..5a31933 100644 (file)
         <variable
             name="stepValue"
             type="String" />
+        <variable
+            name="TempValue"
+            type="String" />
+        <variable
+            name="btStatus"
+            type="boolean" />
+        <variable
+            name="wifiStatus"
+            type="boolean" />
+        <variable
+            name="showTemp"
+            type="int" />
+        <variable
+            name="showStep"
+            type="int" />
+
     </data>
 
     <RelativeLayout
@@ -83,7 +99,9 @@
                 app:netTypeDrawable="@{phoneNetType}"
                 app:signalDrawable="@{phoneSignal}"
                 app:transportDrawable="@{phoneTransport}"
-                app:phoneShow="@{phoneShow}"/>
+                app:phoneShow="@{phoneShow}"
+                app:btenabled="@{btStatus}"
+                app:wifienabled="@{wifiStatus}"/>
 
             <com.ic.launcher.widget.WidgetBatteryStateView
                 android:layout_width="wrap_content"
             android:id="@+id/l02_pedometer_img"
             style="@style/watchDateIconStyle"
             android:layout_toEndOf="@id/l02_time_sp"
+            android:visibility="@{showStep}"
             android:src="@mipmap/clockl02_pedometer" />
 
         <TextView
             style="@style/watchDateIconTextStyle"
             android:layout_marginStart="2dp"
             android:layout_toEndOf="@id/l02_pedometer_img"
+            android:visibility="@{showStep}"
             android:text="@{stepValue}" />
 
+        <ImageView
+            android:id="@+id/s123_temp_img"
+            style="@style/watchDateIconStyle"
+            android:layout_width="44dp"
+            android:layout_height="47dp"
+            android:layout_toEndOf="@id/l02_pedometer_value"
+            android:visibility="@{showTemp}"
+            android:src="@mipmap/temp_icon" />
+
+        <TextView
+            android:id="@+id/l02_temp_value"
+            style="@style/watchDateIconTextStyle"
+            android:layout_marginStart="2dp"
+            android:visibility="@{showTemp}"
+            android:layout_toEndOf="@id/s123_temp_img"
+            android:text="@{TempValue}" />
+
     </RelativeLayout>
 
 </layout>
\ No newline at end of file
index d72721d..4393cff 100644 (file)
         android:id="@+id/net_type_iv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginTop="5dp"
         android:layout_marginStart="5dp"/>
 
     <ImageView
         android:id="@+id/transport_iv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginTop="5dp"
+        android:layout_marginStart="2dp"/>
+    <ImageView
+        android:id="@+id/status_wifi"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="5dp"
+        android:layout_marginStart="2dp"/>
+    <ImageView
+        android:id="@+id/status_bt"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="5dp"
         android:layout_marginStart="2dp"/>
-
 </LinearLayout>
diff --git a/app/src/main/res/mipmap-mdpi/qs_bluetooth.png b/app/src/main/res/mipmap-mdpi/qs_bluetooth.png
new file mode 100644 (file)
index 0000000..a62e3ea
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_bluetooth.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_locate_type_gps.png b/app/src/main/res/mipmap-mdpi/qs_locate_type_gps.png
new file mode 100644 (file)
index 0000000..6960d9a
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_locate_type_gps.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_locate_type_lbs.png b/app/src/main/res/mipmap-mdpi/qs_locate_type_lbs.png
new file mode 100644 (file)
index 0000000..2040c96
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_locate_type_lbs.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_locate_type_wifi.png b/app/src/main/res/mipmap-mdpi/qs_locate_type_wifi.png
new file mode 100644 (file)
index 0000000..efad03b
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_locate_type_wifi.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_phone_type_1x.png b/app/src/main/res/mipmap-mdpi/qs_phone_type_1x.png
new file mode 100644 (file)
index 0000000..7d484e6
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_phone_type_1x.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_phone_type_3g.png b/app/src/main/res/mipmap-mdpi/qs_phone_type_3g.png
new file mode 100644 (file)
index 0000000..93b8448
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_phone_type_3g.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_phone_type_4g.png b/app/src/main/res/mipmap-mdpi/qs_phone_type_4g.png
new file mode 100644 (file)
index 0000000..73ad1e8
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_phone_type_4g.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_phone_type_e.png b/app/src/main/res/mipmap-mdpi/qs_phone_type_e.png
new file mode 100644 (file)
index 0000000..69e1ee7
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_phone_type_e.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_phone_type_g.png b/app/src/main/res/mipmap-mdpi/qs_phone_type_g.png
new file mode 100644 (file)
index 0000000..d80c2e9
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_phone_type_g.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_phone_type_h.png b/app/src/main/res/mipmap-mdpi/qs_phone_type_h.png
new file mode 100644 (file)
index 0000000..6bcac1d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_phone_type_h.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_phone_type_u.png b/app/src/main/res/mipmap-mdpi/qs_phone_type_u.png
new file mode 100644 (file)
index 0000000..785f877
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_phone_type_u.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_server_connected_off.png b/app/src/main/res/mipmap-mdpi/qs_server_connected_off.png
new file mode 100644 (file)
index 0000000..04331e4
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_server_connected_off.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_server_connected_on.png b/app/src/main/res/mipmap-mdpi/qs_server_connected_on.png
new file mode 100644 (file)
index 0000000..f0319ac
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_server_connected_on.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_volte.png b/app/src/main/res/mipmap-mdpi/qs_volte.png
new file mode 100644 (file)
index 0000000..45debb3
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_volte.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_volte_for_ais.png b/app/src/main/res/mipmap-mdpi/qs_volte_for_ais.png
new file mode 100644 (file)
index 0000000..55dbe9c
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_volte_for_ais.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_wifi_level_0.png b/app/src/main/res/mipmap-mdpi/qs_wifi_level_0.png
new file mode 100644 (file)
index 0000000..0d8c6dd
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_wifi_level_0.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_wifi_level_1.png b/app/src/main/res/mipmap-mdpi/qs_wifi_level_1.png
new file mode 100644 (file)
index 0000000..beef74d
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_wifi_level_1.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_wifi_level_2.png b/app/src/main/res/mipmap-mdpi/qs_wifi_level_2.png
new file mode 100644 (file)
index 0000000..db76d72
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_wifi_level_2.png differ
diff --git a/app/src/main/res/mipmap-mdpi/qs_wifi_level_3.png b/app/src/main/res/mipmap-mdpi/qs_wifi_level_3.png
new file mode 100644 (file)
index 0000000..c19292a
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/qs_wifi_level_3.png differ
diff --git a/app/src/main/res/mipmap-mdpi/temp_icon.png b/app/src/main/res/mipmap-mdpi/temp_icon.png
new file mode 100644 (file)
index 0000000..f96ec10
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/temp_icon.png differ
index 30fe746..30df3c7 100644 (file)
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <resources>
-       <string name="app_name_heart">Health</string>
+       <string name="app_name_heart">健康</string>
        <string name="error_start_activity">failed to run Application !</string>
        <string name="app_name">時計</string>
        <!-- 主菜单文本 -->
-       <string name="main_manu_settings">設置</string>
+       <string name="main_manu_settings">設定</string>
        <string name="main_manu_family">私の家族</string>
        <string name="main_manu_friend">私の友達</string>
        <string name="weather_network_not_available">今は連接できるネットがありません</string>
     -->
        <string name="select_clock_theme">時計テーマ</string>
        <string name="select_main_menu_background">主題</string>
-       <string name="app_dialer">Dialer</string>
+       <string name="app_dialer">電話</string>
        <string name="app_ContactName">連絡先</string>
        <string name="app_TelePhone">電話</string>
        <string name="app_VoLTE">ハイレゾリューションの通話</string>
-       <string name="app_Sms">メール</string>
+       <string name="app_Sms">SMS</string>
        <string name="app_VideoCall">ビデオチャット</string>
        <string name="app_Wechat">ウエイチャット</string>
        <string name="app_Chat">ウエイチャットでの対話</string>
-       <string name="app_Camera">写真</string>
+       <string name="app_Camera">カメラ</string>
        <string name="app_Album">アルバム</string>
        <string name="app_Guiding">ガイド</string>
-       <string name="app_MakeFriends">交å\8f\8b</string>
+       <string name="app_MakeFriends">å\8f\8bé\81\94ã\82\92ä½\9cã\82\8b</string>
        <string name="app_GrindingEars">?</string>
        <string name="app_AnsweredQuestions">質問があれば答える</string>
        <string name="app_AiKnowledge">知識を愛する</string>
@@ -74,7 +74,7 @@
        <string name="app_Weather">天気</string>
        <string name="app_VoiceAssistant">音声の助手</string>
        <string name="app_Tool">ツール</string>
-       <string name="app_Settings">設置</string>
+       <string name="app_Settings">設定</string>
        <string name="app_English">英語を聞きます</string>
        <string name="app_Story">ストーリー</string>
        <string name="app_Recorder">リコーダー</string>
        <string name="app_Calculator">カルキュレーター</string>
        <string name="app_Calendar">カレンダー</string>
        <string name="app_clearRam">メモリーを整理する</string>
-       <string name="app_Sport">スポーツ</string>
+       <string name="app_Sport">運動</string>
+    <string name="app_practise">無料運動</string>
+    <string name="app_practising">無料運動</string>
+    <string name="app_practise_stoped">運動が止まった</string>
        <string name="app_xu_yuan_xing">祈る星</string>
        <string name="app_qr_code">二次元コード</string>
        <string name="app_HeartRate">ハートレート</string>
+    <string name="app_custom_Chat">聊天</string>
+    <string name="app_AliPay">支付宝</string>
        <string name="app_BloodPressure">血圧</string>
        <string name="app_drama">ドラマ</string>
     <string name="app_down_remote_app">remote app</string>
        <string name="system_upgrade">システムをアップグレードする</string>
        <string name="is_upgrade_version">新バージョンが見つかるのでバージョンをアップしませんか?</string>
        <string name="system_upgrade_tips">新バージョンが見つかるのでアップグレードしませんか?</string>
-       <string name="yes">確定</string>
-       <string name="no">取り消し</string>
+       <string name="yes">決定する</string>
+       <string name="no">キャンセル</string>
        <string name="question_mark">?</string>
        <!--系统升级提示 end-->
        <string name="sim_blocked">このSIMカードはサポートしていません</string>
-    <string name="select_main_menu_style">Select main menu style</string>
-    <string name="main_menu_style_multi_icon">Multi icon</string>
-    <string name="main_menu_style_single_icon">Single icon</string>
-    <string name="program_abnormal">Sorry, the program is abnormal and will quit!</string>
-       <string name="please_wait">Please wait...</string>
-       <string name="monday">Mon</string>
-       <string name="tuesday">Tue</string>
-       <string name="wednesday">Wed</string>
-       <string name="thursday">Thu</string>
-       <string name="friday">Fri</string>
-       <string name="saturday">Sat</string>
-       <string name="sunday">Sun</string>
+    <string name="select_main_menu_style">メインメニュースタイル</string>
+    <string name="main_menu_style_multi_icon">複数のアイコン</string>
+    <string name="main_menu_style_single_icon">単一のアイコン</string>
+    <string name="program_abnormal">申し訳ありませんが、プログラムは異常であり、すぐに終了します!</string>
+       <string name="please_wait">お待ちください...</string>
+       <string name="monday">月曜日</string>
+       <string name="tuesday">火曜日</string>
+       <string name="wednesday">水曜日</string>
+       <string name="thursday">木曜日</string>
+       <string name="friday">金曜日</string>
+       <string name="saturday">土曜日</string>
+       <string name="sunday">日曜日</string>
+    <string name="all_group">すべて</string>
+
+    <!--IC ADD-->
+    <string name="ic_high_pressure">高压</string>
+    <string name="ic_low_pressure">低压</string>
+
+    <string name="activity_temp_str">体温</string>
+    <string name="activity_temp_wrist_str">手首の温度</string>
+    <string name="activity_temp_tips_check">測定中</string>
+    <string name="activity_temp_tips_end">測定完了</string>
 </resources>
index accf834..6b507e5 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Sep 29 11:22:40 CST 2020\r
-VERSION_CODE=159\r
+#Mon Oct 12 20:14:23 CST 2020\r
+VERSION_CODE=161\r