From: snickersun Date: Tue, 8 Sep 2020 08:21:18 +0000 (+0800) Subject: release ICL02Launcher V146 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.js?a=commitdiff_plain;h=a13580fc51313a124e03cff57cfb68c5e00fbf9b;p=launcher4.git release ICL02Launcher V146 把Launcher4 (心率血压体温版)的L02 中英文版及H88中英文版合并为一个应用,通过persist.sys.launcherName来进行区分 添加IC68体温的显示支持,通过persyst.sys.disableWristTemp来决定是否显示腕温。 --- diff --git a/app/build.gradle b/app/build.gradle index a39fe38..e2e1ff6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.application' static def getL02ApkBaseName() { - return "ICH88Launcher" + return "ICL02Launcher" } android { def currentVersionCode = getVersionCode() def currentVersionName = releaseTime() - def buildVersionType = 2 + def buildVersionType = 0 compileSdkVersion 29 buildToolsVersion "29.0.2" @@ -81,9 +81,9 @@ android { android.applicationVariants.all { variant -> variant.outputs.all { if (variant.buildType.name == "release") { - outputFileName = "${getL02ApkBaseName()}_V${buildVersionType}_${currentVersionCode}_${currentVersionName}_release.apk" + outputFileName = "${getL02ApkBaseName()}_V${currentVersionCode}_${currentVersionName}_release.apk" } else { - outputFileName = "${getL02ApkBaseName()}_V${buildVersionType}_${currentVersionCode}_${currentVersionName}_debug.apk" + outputFileName = "${getL02ApkBaseName()}_V${currentVersionCode}_${currentVersionName}_debug.apk" } } } diff --git a/app/release/ICL02Launcher_V146_202009081137_release.apk b/app/release/ICL02Launcher_V146_202009081137_release.apk new file mode 100644 index 0000000..59ed07a Binary files /dev/null and b/app/release/ICL02Launcher_V146_202009081137_release.apk differ diff --git a/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java b/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java index 451fbc6..f0a69cf 100644 --- a/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java +++ b/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java @@ -19,15 +19,20 @@ import android.os.Message; import android.os.PowerManager; import android.os.RemoteException; import android.text.TextUtils; +import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; +import android.view.View; +import android.view.WindowManager; import android.widget.TextView; import com.ic.aidl.temp.ITempAidlInterface; import com.ic.aidl.temp.ITempRemoteService; import com.ic.launcher.databinding.ActivityAnimalHeatBinding; import com.ic.launcher.listener.MainClockGestureDetectorImpl; +import com.ic.launcher.util.IcLog; import com.ic.launcher.util.ServiceUtil; +import com.ic.launcher.util.SystemUtils; import java.lang.ref.WeakReference; import java.text.DecimalFormat; @@ -48,7 +53,7 @@ public class AnimalHeatActivity extends AppCompatActivity implements private ITempRemoteService mService; private HeatHandler mHandler; - private PowerManager.WakeLock mWakeLock = null; +// private PowerManager.WakeLock mWakeLock = null; private ActivityAnimalHeatBinding heatBinding; @@ -61,20 +66,37 @@ public class AnimalHeatActivity extends AppCompatActivity implements gesture = new GestureDetectorCompat(this, new MainClockGestureDetectorImpl(this)); registerBroadcast(); bindWorkService(this); - initWakeLock(this); +// initWakeLock(this); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); heatBinding.setBodyTemp("--"); heatBinding.setWristTemp("--"); + boolean disablewristtemp=SystemUtils.getSystemPropertiesBoolean("persyst.sys.disableWristTemp",false); + heatBinding.setDisableWristTemp(disablewristtemp); + } + @Override + protected void onPause() { + super.onPause(); +// IcLog.i("Temperature","Temperature Activity onPause"); +// try { +// mService.onStopQueryTemp(); +// } catch (Exception e) { +// IcLog.i("Temperature", e.getMessage()); +// } + } + @Override protected void onDestroy() { super.onDestroy(); + IcLog.i("Temperature","Temperature Activity onDestroy"); try { mService.onStopQueryTemp(); } catch (Exception e) { + IcLog.i("Temperature", e.getMessage()); } - releaseWakeLock(); +// releaseWakeLock(); unbindWorkService(this); unregisterReceiver(mIntentReceiver); } @@ -112,8 +134,12 @@ public class AnimalHeatActivity extends AppCompatActivity implements DecimalFormat df = new DecimalFormat("#.0"); switch (type){ case 0: - heatBinding.setBodyTemp(df.format(animal)); - heatBinding.setWristTemp(df.format(temp)); + if (heatBinding.getDisableWristTemp()){ + heatBinding.setBodyTemp(df.format(temp)); + }else { + heatBinding.setBodyTemp(df.format(animal)); + heatBinding.setWristTemp(df.format(temp)); + } break; case 1: heatBinding.setShowLoading(false); @@ -233,19 +259,19 @@ public class AnimalHeatActivity extends AppCompatActivity implements } } - @SuppressLint("InvalidWakeLockTag") - private void initWakeLock(Context context) { - PowerManager powerManager = (PowerManager) context.getSystemService(POWER_SERVICE); - if (powerManager != null) { - mWakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "TmepWakeLock"); - mWakeLock.acquire(); - } - } - - private void releaseWakeLock() { - if (mWakeLock != null) { - mWakeLock.release(); - } - mWakeLock = null; - } +// @SuppressLint("InvalidWakeLockTag") +// private void initWakeLock(Context context) { +// PowerManager powerManager = (PowerManager) context.getSystemService(POWER_SERVICE); +// if (powerManager != null) { +// mWakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "TmepWakeLock"); +// mWakeLock.acquire(); +// } +// } +// +// private void releaseWakeLock() { +// if (mWakeLock != null) { +// mWakeLock.release(); +// } +// mWakeLock = null; +// } } \ No newline at end of file diff --git a/app/src/main/java/com/ic/launcher/configure/l02/L02AppInfo.java b/app/src/main/java/com/ic/launcher/configure/l02/L02AppInfo.java index 8926603..539dfad 100644 --- a/app/src/main/java/com/ic/launcher/configure/l02/L02AppInfo.java +++ b/app/src/main/java/com/ic/launcher/configure/l02/L02AppInfo.java @@ -1,29 +1,33 @@ package com.ic.launcher.configure.l02; +import android.content.Context; import android.graphics.Color; import com.ic.launcher.BuildConfig; import com.ic.launcher.R; import com.ic.launcher.entity.AppInfoEntity; import com.ic.launcher.fragment.LowPowerModeFragment; +import com.ic.launcher.util.SystemUtils; import java.util.ArrayList; import java.util.List; +import java.util.Locale; public class L02AppInfo { private static final int BACK_COLOUR = Color.parseColor("#000000"); - public static List getAppList(){ - switch (BuildConfig.V_TYPE){ - case 0: + public static List getAppList(Context context){ + Locale locale = context.getResources().getConfiguration().locale; + String language = locale.getLanguage(); + if (SystemUtils.isH88()) { + return mH88AppList; + }else{ + if (language.contains("zh")) { return mL02DefaultAppList; - case 1: + } else { return mL02EnAppList; - case 2: - return mH88AppList; - default: - return mL02DefaultAppList; + } } } @@ -45,12 +49,15 @@ 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")); +// //天气 +// 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_heartrate_l02, R.string.app_name_heart, "com.ic.blood", "com.ic.blood.BloodActivity")); + + add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_temperature_h88, R.string.app_h88_temperature, + "com.ic.launcher", "com.ic.launcher.AnimalHeatActivity")); //支付包 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_alipay_l02, R.string.app_AliPay, "com.eg.android.AlipayGphone", "com.alipay.watch.ui.MainActivity")); @@ -63,6 +70,9 @@ public class L02AppInfo { //短信 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_sms_l02, R.string.app_Sms, "com.zmapp.sms", "com.zmapp.sms.MainActivity")); + + add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_language_h88, R.string.app_h88_language, + "com.eqc.eqcguide", "com.eqc.eqcguide.MainActivity")); //设置 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_settings_l02, R.string.main_manu_settings, "com.eqc.settings", "com.eqc.settings.MainActivity")); @@ -83,6 +93,9 @@ public class L02AppInfo { //心率 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_heartrate_l02, R.string.app_name_heart, "com.ic.blood", "com.ic.blood.BloodActivity")); + + add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_temperature_h88, R.string.app_h88_temperature, + "com.ic.launcher", "com.ic.launcher.AnimalHeatActivity")); //相机 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_camera_l02, R.string.app_Camera, "com.eqc.camera", "com.eqc.camera.TakePictureActivity")); @@ -92,6 +105,9 @@ public class L02AppInfo { //短信 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_sms_l02, R.string.app_Sms, "com.zmapp.sms", "com.zmapp.sms.MainActivity")); + + add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_language_h88, R.string.app_h88_language, + "com.eqc.eqcguide", "com.eqc.eqcguide.MainActivity")); //设置 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_settings_l02, R.string.main_manu_settings, "com.eqc.settings", "com.eqc.settings.MainActivity")); @@ -122,11 +138,19 @@ public class L02AppInfo { add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_sms_l02, R.string.app_Sms, "com.zmapp.sms", "com.zmapp.sms.MainActivity")); + add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_camera_l02,R.string.app_Camera, + "com.ic.camera", "com.ic.camera.MainActivity")); + + add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_albumn_l02,R.string.app_Album, + "com.ic.album", "com.ic.album.MainActivity")); + add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_language_h88, R.string.app_h88_language, "com.eqc.eqcguide", "com.eqc.eqcguide.MainActivity")); //设置 add(new AppInfoEntity(BACK_COLOUR, R.mipmap.icon_settings_l02, R.string.main_manu_settings, - "com.eqc.settings", "com.eqc.settings.MainActivity")); + "com.ic.setting", "com.ic.setting.MainActivity")); + + } }; } diff --git a/app/src/main/java/com/ic/launcher/fragment/LowPowerModeFragment.java b/app/src/main/java/com/ic/launcher/fragment/LowPowerModeFragment.java index fd75b91..b0e49eb 100644 --- a/app/src/main/java/com/ic/launcher/fragment/LowPowerModeFragment.java +++ b/app/src/main/java/com/ic/launcher/fragment/LowPowerModeFragment.java @@ -22,6 +22,7 @@ import com.ic.launcher.databinding.FragmentLowPowerModeBinding; import com.ic.launcher.entity.AppInfoEntity; import com.ic.launcher.listener.ILowPowerCallPhoneListener; import com.ic.launcher.util.IcLog; +import com.ic.launcher.util.SystemUtils; /** * A simple {@link Fragment} subclass. @@ -81,11 +82,11 @@ public class LowPowerModeFragment extends Fragment { } private ILowPowerCallPhoneListener callListener = () -> { - int value=1; - if(BuildConfig.V_TYPE == 2){ - value = 4; + int value=1; //l02 通讯录index + if(SystemUtils.isH88()){ + value = 4; //h88 通讯录index } - AppInfoEntity entity = L02AppInfo.getAppList().get(value); + AppInfoEntity entity = L02AppInfo.getAppList(mContext).get(value); if (entity != null) { try { Intent intent = new Intent(Intent.ACTION_MAIN); diff --git a/app/src/main/java/com/ic/launcher/presenter/AppListPresenter.java b/app/src/main/java/com/ic/launcher/presenter/AppListPresenter.java index a5f3aa8..e8313a5 100644 --- a/app/src/main/java/com/ic/launcher/presenter/AppListPresenter.java +++ b/app/src/main/java/com/ic/launcher/presenter/AppListPresenter.java @@ -47,12 +47,12 @@ public class AppListPresenter{ } public void updateLanguageSystemApp(){ - mObsAppInfoList.setValue(L02AppInfo.getAppList()); + mObsAppInfoList.setValue(L02AppInfo.getAppList(context)); } public void updateSystemApp() { - mObsAppInfoList.setValue(L02AppInfo.getAppList()); - boolean[] state = new boolean[L02AppInfo.getAppList().size()]; + mObsAppInfoList.setValue(L02AppInfo.getAppList(context)); + boolean[] state = new boolean[L02AppInfo.getAppList(context).size()]; for (int i = 0; i < state.length; i++) { state[i] = false; } @@ -61,12 +61,12 @@ public class AppListPresenter{ } public void startAppActivity(int index) { - if (index < 0 || index > L02AppInfo.getAppList().size()) { + if (index < 0 || index > L02AppInfo.getAppList(context).size()) { mObsActivityError.setValue(mErrorInfo); return; } - AppInfoEntity entity = L02AppInfo.getAppList().get(index); + AppInfoEntity entity = L02AppInfo.getAppList(context).get(index); String pck = entity.getPackageName(); String activity = entity.getActivityName(); diff --git a/app/src/main/java/com/ic/launcher/util/SystemUtils.java b/app/src/main/java/com/ic/launcher/util/SystemUtils.java index 6985afa..7336eb2 100644 --- a/app/src/main/java/com/ic/launcher/util/SystemUtils.java +++ b/app/src/main/java/com/ic/launcher/util/SystemUtils.java @@ -35,6 +35,51 @@ public class SystemUtils { return cid; } + public static boolean isL02() + { + String launcher=getLauncherName(); + if (launcher.equals("l02")){ + return true; + } + return false; + } + public static boolean isH88() + { + String launcher=getLauncherName(); + if (launcher.equals("h88")){ + return true; + } + return false; + } + + public static String getLauncherName(){ + String launchername=getSystemPropertiesString("persist.sys.launcherName","l02"); + return launchername; + } + + + public static String getSystemPropertiesString(String prop,String defaultvlaue){ + String ret=defaultvlaue; + String temp=getSystemProperties(prop); + if (!temp.trim().isEmpty()){ + ret = temp; + } + return ret; + } + public static boolean getSystemPropertiesBoolean(String prop,boolean defaultvlaue){ + + boolean ret=defaultvlaue; + String temp=getSystemProperties(prop); + if (!temp.trim().isEmpty()){ + if( temp.trim().equals("true")) { + ret = true; + }else if (temp.trim().equals("false")) { + ret = false; + } + } + + return ret; + } public static String getSystemProperties(String prop) { String str = ""; diff --git a/app/src/main/res/layout/activity_animal_heat.xml b/app/src/main/res/layout/activity_animal_heat.xml index 599d406..7d0ec6b 100644 --- a/app/src/main/res/layout/activity_animal_heat.xml +++ b/app/src/main/res/layout/activity_animal_heat.xml @@ -22,6 +22,10 @@ + + @@ -90,6 +95,7 @@ android:text="@string/activity_temp_wrist_str" android:textColor="#00ACC1" android:textSize="32sp" + android:visibility="@{disableWristTemp ? View.GONE : View.VISIBLE}" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.18" @@ -104,6 +110,7 @@ android:text="@{wristTemp}" android:textColor="#FFFFFF" android:textSize="62sp" + android:visibility="@{disableWristTemp ? View.GONE : View.VISIBLE}" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.62" @@ -118,6 +125,7 @@ android:text="@string/activity_temp_unit" android:textColor="#FFFFFF" android:textSize="32sp" + android:visibility="@{disableWristTemp ? View.GONE : View.VISIBLE}" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.899" diff --git a/app/version_code.properties b/app/version_code.properties index 2bc03ed..5d9b58f 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Wed Jul 29 21:08:37 CST 2020 -VERSION_CODE=136 +#Tue Sep 08 11:37:47 CST 2020 +VERSION_CODE=146