From: kfl_614 Date: Fri, 27 Nov 2020 10:31:53 +0000 (+0800) Subject: update charge images. X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=ae6928286a2e6eb8d8b68025630d6a65b3295e82;p=launcher4.git update charge images. --- diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index e04498a..6e45dfc 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -15,6 +15,7 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index cecba62..362821b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,11 +1,17 @@ + + - + + + \ No newline at end of file diff --git a/.idea/qaplug_profiles.xml b/.idea/qaplug_profiles.xml new file mode 100644 index 0000000..3dfd21f --- /dev/null +++ b/.idea/qaplug_profiles.xml @@ -0,0 +1,465 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java b/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java index af07eef..99889a4 100644 --- a/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java +++ b/app/src/main/java/com/ic/launcher/AnimalHeatActivity.java @@ -40,6 +40,22 @@ import java.text.DecimalFormat; import butterknife.BindString; import butterknife.ButterKnife; +/** + * 这个是健康的界面,如果没有佩戴的话,不做检查。 + * + * 获取当前是否佩戴的状态key为:persist.sys.ic_antioff + * + * 这个是主动获取的。 + * + * 被动通知可以通过广播的方式监听佩戴状态的变化。 + * + * 广播相关的内容: + * + * public static String ACTION_ANTI_OFF0 = "com.ic.ACTION_ANTIOFF"; + * //integer eventID =1 脱落, eventID =0 佩戴 + * public static String KEY_ANTI_EVENT="eventID"; + * + */ public class AnimalHeatActivity extends AppCompatActivity implements MainClockGestureDetectorImpl.OnClockGestureFlingListener { diff --git a/app/src/main/java/com/ic/launcher/configure/l02/L02Icon.java b/app/src/main/java/com/ic/launcher/configure/l02/L02Icon.java index 84c93eb..15fe4db 100644 --- a/app/src/main/java/com/ic/launcher/configure/l02/L02Icon.java +++ b/app/src/main/java/com/ic/launcher/configure/l02/L02Icon.java @@ -36,12 +36,12 @@ public class L02Icon { //L02 信号图片 public static int[] l02BatteryResId = new int[]{ - R.mipmap.l02_battery_0, - R.mipmap.l02_battery_1, - R.mipmap.l02_battery_2, - R.mipmap.l02_battery_3, - R.mipmap.l02_battery_4, - R.mipmap.l02_battery_5 + R.mipmap.l02_battery_nocharge_0, + R.mipmap.l02_battery_nocharge_1, + R.mipmap.l02_battery_nocharge_2, + R.mipmap.l02_battery_nocharge_3, + R.mipmap.l02_battery_nocharge_4, + R.mipmap.l02_battery_nocharge_5 }; public static int[] l02TimeHourImage = new int[]{ @@ -75,8 +75,8 @@ public class L02Icon { public static final int CLOCK_INDEX_12 = 1703; public static ClockDialEntity[] l02ClockDial = new ClockDialEntity[]{ - new ClockDialEntity("clock16",CLOCK_INDEX_6,R.mipmap.clock6_dial_preview), - new ClockDialEntity("clockl02",CLOCK_INDEX_L02,R.mipmap.clockl02_dial_preview), - new ClockDialEntity("clock12",CLOCK_INDEX_12,R.mipmap.clock12_dial_preview), + new ClockDialEntity("clock16", CLOCK_INDEX_6, R.mipmap.clock6_dial_preview), + new ClockDialEntity("clockl02", CLOCK_INDEX_L02, R.mipmap.clockl02_dial_preview), + new ClockDialEntity("clock12", CLOCK_INDEX_12, R.mipmap.clock12_dial_preview), }; } diff --git a/app/src/main/java/com/ic/launcher/presenter/BatteryPresenter.java b/app/src/main/java/com/ic/launcher/presenter/BatteryPresenter.java index 4c6b3e4..c6df81f 100644 --- a/app/src/main/java/com/ic/launcher/presenter/BatteryPresenter.java +++ b/app/src/main/java/com/ic/launcher/presenter/BatteryPresenter.java @@ -29,15 +29,18 @@ public class BatteryPresenter extends PresenterCycle { private static int SHUT_DOWN_LEVEL = 5; static { - String lowlevel=SystemUtils.getSystemPropertiesString("persist.sys.icLowpowerLevel","15"); - try{ - LOW_LEVEL=Integer.parseInt(lowlevel); - }catch (Exception e){} - String shutlevel=SystemUtils.getSystemPropertiesString("persist.sys.icShutdownLevel","5"); - try{ - SHUT_DOWN_LEVEL=Integer.parseInt(shutlevel); - }catch (Exception e){} + String lowlevel = SystemUtils.getSystemPropertiesString("persist.sys.icLowpowerLevel", "15"); + try { + LOW_LEVEL = Integer.parseInt(lowlevel); + } catch (Exception e) { + } + String shutlevel = SystemUtils.getSystemPropertiesString("persist.sys.icShutdownLevel", "5"); + try { + SHUT_DOWN_LEVEL = Integer.parseInt(shutlevel); + } catch (Exception e) { + } } + private Context mContext; private SoundPlayUtils playUtils; @@ -47,6 +50,10 @@ public class BatteryPresenter extends PresenterCycle { private MediatorLiveData mObsBatteryValue; private MediatorLiveData mObsBatteryCharging; + //comment by TrillGates: + //从代码上看,这个是用于更新点亮图标的,如果插电了 + //那么会显示动画 + //如果没有插电,就会显示这个内容了。 private MediatorLiveData mObsBatteryResID; private MediatorLiveData mObsLowPower; private MediatorLiveData mObsLowPowerValue; @@ -202,17 +209,17 @@ public class BatteryPresenter extends PresenterCycle { } private int getBatteryLevel(int level) { - int index = 0; - if (level > 85) { - index = 5; - } else if (level > 65) { + int index = 5; + if (level > 85 && level < 100) { index = 4; - } else if (level > 40) { + } else if (level > 65) { index = 3; - } else if (level > 15) { + } else if (level > 40) { index = 2; - } else if (level > 7) { + } else if (level > 15) { index = 1; + } else if (level > 7) { + index = 0; } return index; @@ -270,7 +277,7 @@ public class BatteryPresenter extends PresenterCycle { return arrayList.contains((((ActivityManager) paramContext.getSystemService(Context.ACTIVITY_SERVICE)).getRunningTasks(1).get(0)).topActivity.getPackageName()); } - public void playSoundIndex(int index){ + public void playSoundIndex(int index) { playUtils.playKeyboardSound(mContext, index); } } diff --git a/app/src/main/java/com/ic/launcher/widget/WidgetBatteryStateView.java b/app/src/main/java/com/ic/launcher/widget/WidgetBatteryStateView.java index 7be24ba..89222ca 100644 --- a/app/src/main/java/com/ic/launcher/widget/WidgetBatteryStateView.java +++ b/app/src/main/java/com/ic/launcher/widget/WidgetBatteryStateView.java @@ -39,7 +39,7 @@ public class WidgetBatteryStateView extends LinearLayout { } public void updateBatteryValue(String bv) { -// batteryTv.setVisibility(GONE); + //batteryTv.setVisibility(GONE); batteryTv.setText(bv); } @@ -47,8 +47,14 @@ public class WidgetBatteryStateView extends LinearLayout { batteryIv.setImageResource(netType); } + /** + * 更新充电状态 + * + * @param charge + */ public void updateBatteryChargeState(boolean charge) { if (charge) { + //充电状态 if (animationDrawable == null) { batteryIv.setImageResource(R.drawable.l02_battery_charging_anim); animationDrawable = (AnimationDrawable) batteryIv.getDrawable(); @@ -60,6 +66,7 @@ public class WidgetBatteryStateView extends LinearLayout { ); } } else { + //示充电状态 if (animationDrawable != null) { animationDrawable.stop(); animationDrawable = null; diff --git a/app/src/main/res/layout/activity_animal_heat.xml b/app/src/main/res/layout/activity_animal_heat.xml index 66a0e73..d885a8b 100644 --- a/app/src/main/res/layout/activity_animal_heat.xml +++ b/app/src/main/res/layout/activity_animal_heat.xml @@ -73,16 +73,19 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/transparent" + android:gravity="right" android:text="@{bodyTemp}" android:textColor="#FFFFFF" android:textSize="50sp" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.62" + app:layout_constraintEnd_toStartOf="@+id/textView3" + app:layout_constraintHorizontal_bias="0.884" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.145" /> + app:layout_constraintVertical_bias="0.183" /> + + @@ -127,18 +132,19 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/transparent" + android:gravity="right" android:text="@{wristTemp}" android:textColor="#FFFFFF" android:textSize="50sp" android:visibility="@{disableWristTemp ? View.GONE : View.VISIBLE}" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.62" + app:layout_constraintEnd_toStartOf="@+id/textView2" + app:layout_constraintHorizontal_bias="0.884" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintVertical_bias="0.5" /> + app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - - - - - + + + + + + + + + + + + + + app:layout_constraintVertical_bias="0.81" /> + + + android:layout_height="30dp" /> \ No newline at end of file diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_0.png b/app/src/main/res/mipmap-ldpi/l02_battery_0.png index 4f0c40e..3ff3f99 100644 Binary files a/app/src/main/res/mipmap-ldpi/l02_battery_0.png and b/app/src/main/res/mipmap-ldpi/l02_battery_0.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_1.png b/app/src/main/res/mipmap-ldpi/l02_battery_1.png index 2ba5cc0..f89a096 100644 Binary files a/app/src/main/res/mipmap-ldpi/l02_battery_1.png and b/app/src/main/res/mipmap-ldpi/l02_battery_1.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_2.png b/app/src/main/res/mipmap-ldpi/l02_battery_2.png index fdf6d6f..03d2637 100644 Binary files a/app/src/main/res/mipmap-ldpi/l02_battery_2.png and b/app/src/main/res/mipmap-ldpi/l02_battery_2.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_3.png b/app/src/main/res/mipmap-ldpi/l02_battery_3.png index 19c7c0c..71a35b9 100644 Binary files a/app/src/main/res/mipmap-ldpi/l02_battery_3.png and b/app/src/main/res/mipmap-ldpi/l02_battery_3.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_4.png b/app/src/main/res/mipmap-ldpi/l02_battery_4.png index a1d396d..3f9cfbf 100644 Binary files a/app/src/main/res/mipmap-ldpi/l02_battery_4.png and b/app/src/main/res/mipmap-ldpi/l02_battery_4.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_5.png b/app/src/main/res/mipmap-ldpi/l02_battery_5.png index 348ef53..fb41918 100644 Binary files a/app/src/main/res/mipmap-ldpi/l02_battery_5.png and b/app/src/main/res/mipmap-ldpi/l02_battery_5.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_0.png b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_0.png new file mode 100644 index 0000000..6f9a14f Binary files /dev/null and b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_0.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_1.png b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_1.png new file mode 100644 index 0000000..38d1b84 Binary files /dev/null and b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_1.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_2.png b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_2.png new file mode 100644 index 0000000..4ad4a42 Binary files /dev/null and b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_2.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_3.png b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_3.png new file mode 100644 index 0000000..cbe779b Binary files /dev/null and b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_3.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_4.png b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_4.png new file mode 100644 index 0000000..4d00a82 Binary files /dev/null and b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_4.png differ diff --git a/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_5.png b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_5.png new file mode 100644 index 0000000..ff18d68 Binary files /dev/null and b/app/src/main/res/mipmap-ldpi/l02_battery_nocharge_5.png differ