Update battery tip main icon into materiel theme design
Update all battery tip icon into materiel theme design based on the UX feedback and clean up legacy icons Bug: 246960554 Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.* Change-Id: I82f5b140700a36b29844c0c3330b2eeeda8e5a55
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
Copyright (C) 2017 The Android Open Source Project
|
Copyright (C) 2023 The Android Open Source Project
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
@@ -13,20 +13,15 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:viewportWidth="24.0"
|
android:viewportWidth="24.0"
|
||||||
android:viewportHeight="24.0"
|
android:viewportHeight="24.0">
|
||||||
android:tint="?android:attr/colorError">
|
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF000000"
|
android:fillColor="?android:attr/colorAccent"
|
||||||
android:pathData="M11,7h2v2h-2z"/>
|
android:pathData="M13,17h-2v-2h2V17zM13,13h-2V8h2V13z"/>
|
||||||
<path
|
<path
|
||||||
android:fillColor="#FF000000"
|
android:fillColor="?android:attr/colorAccent"
|
||||||
android:pathData="M11,11h2v6h-2z"/>
|
android:pathData="M16.2,22.5H7.8c-1.3,0 -2.3,-1 -2.3,-2.3V5.8c0,-1.3 1,-2.3 2.3,-2.3h0.7v-2h7v2h0.7c1.3,0 2.3,1.1 2.3,2.3v14.3C18.5,21.5 17.5,22.5 16.2,22.5zM7.8,5.5c-0.2,0 -0.3,0.2 -0.3,0.3v14.3c0,0.2 0.2,0.3 0.3,0.3h8.3c0.2,0 0.3,-0.1 0.3,-0.3V5.8c0,-0.2 -0.1,-0.3 -0.3,-0.3h-2.7v-2h-3v2H7.8z"/>
|
||||||
<path
|
|
||||||
android:fillColor="#FF000000"
|
|
||||||
android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7z"/>
|
|
||||||
</vector>
|
</vector>
|
27
res/drawable/ic_battery_status_good_theme.xml
Normal file
27
res/drawable/ic_battery_status_good_theme.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2023 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="?android:attr/colorAccent"
|
||||||
|
android:pathData="M16.2,22.5H7.8c-1.3,0 -2.3,-1 -2.3,-2.3V5.8c0,-1.3 1,-2.3 2.3,-2.3h0.7v-2h7v2h0.7c1.3,0 2.3,1.1 2.3,2.3v14.3C18.5,21.5 17.5,22.5 16.2,22.5zM7.8,5.5c-0.2,0 -0.3,0.2 -0.3,0.3v14.3c0,0.2 0.2,0.3 0.3,0.3h8.3c0.2,0 0.3,-0.1 0.3,-0.3V5.8c0,-0.2 -0.1,-0.3 -0.3,-0.3h-2.7v-2h-3v2H7.8z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="?android:attr/colorAccent"
|
||||||
|
android:pathData="M16.1,11.1l-1.4,-1.5l-3.9,3.9l-1.5,-1.4l-1.4,1.4l2.9,2.9z"/>
|
||||||
|
</vector>
|
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Copyright (C) 2018 The Android Open Source Project
|
Copyright (C) 2023 The Android Open Source Project
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@@ -13,19 +13,18 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:viewportWidth="24.0"
|
android:viewportWidth="24.0"
|
||||||
android:viewportHeight="24.0">
|
android:viewportHeight="24.0">
|
||||||
<path
|
<path
|
||||||
android:fillColor="#0F9D58"
|
android:fillColor="?android:attr/colorAccent"
|
||||||
android:pathData="M11,7h2v2h-2z"/>
|
android:pathData="M11,7h2v2h-2z"/>
|
||||||
<path
|
<path
|
||||||
android:fillColor="#0F9D58"
|
android:fillColor="?android:attr/colorAccent"
|
||||||
android:pathData="M11,11h2v6h-2z"/>
|
android:pathData="M11,11h2v6h-2z"/>
|
||||||
<path
|
<path
|
||||||
android:fillColor="#0F9D58"
|
android:fillColor="?android:attr/colorAccent"
|
||||||
android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7z"/>
|
android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7z"/>
|
||||||
</vector>
|
</vector>
|
@@ -55,7 +55,7 @@ public class BatteryDefenderTip extends BatteryTip {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconId() {
|
public int getIconId() {
|
||||||
return R.drawable.ic_battery_status_good_24dp;
|
return R.drawable.ic_battery_status_good_theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -71,7 +71,7 @@ public class HighUsageTip extends BatteryTip {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconId() {
|
public int getIconId() {
|
||||||
return R.drawable.ic_perm_device_information_red_24dp;
|
return R.drawable.ic_perm_device_information_theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -48,7 +48,7 @@ public final class IncompatibleChargerTip extends BatteryTip {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconId() {
|
public int getIconId() {
|
||||||
return R.drawable.ic_battery_alert_24dp;
|
return R.drawable.ic_battery_alert_theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -51,12 +51,7 @@ public class LowBatteryTip extends BatteryTip {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconId() {
|
public int getIconId() {
|
||||||
return mState = R.drawable.ic_battery_status_bad_24dp;
|
return mState = R.drawable.ic_battery_saver_accent_24dp;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getIconTintColorId() {
|
|
||||||
return mState = R.color.battery_bad_color_light;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -93,8 +93,8 @@ public class RestrictAppTip extends BatteryTip {
|
|||||||
@Override
|
@Override
|
||||||
public int getIconId() {
|
public int getIconId() {
|
||||||
return mState == StateType.HANDLED
|
return mState == StateType.HANDLED
|
||||||
? R.drawable.ic_perm_device_information_green_24dp
|
? R.drawable.ic_perm_device_information_theme
|
||||||
: R.drawable.ic_battery_alert_24dp;
|
: R.drawable.ic_battery_alert_theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -48,7 +48,7 @@ public class SmartBatteryTip extends BatteryTip {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconId() {
|
public int getIconId() {
|
||||||
return R.drawable.ic_perm_device_information_red_24dp;
|
return R.drawable.ic_perm_device_information_theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -85,7 +85,7 @@ public class BatteryDefenderTipTest {
|
|||||||
@Test
|
@Test
|
||||||
public void getIcon_showIcon() {
|
public void getIcon_showIcon() {
|
||||||
assertThat(mBatteryDefenderTip.getIconId())
|
assertThat(mBatteryDefenderTip.getIconId())
|
||||||
.isEqualTo(R.drawable.ic_battery_status_good_24dp);
|
.isEqualTo(R.drawable.ic_battery_status_good_theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -85,7 +85,7 @@ public final class IncompatibleChargerTipTest {
|
|||||||
@Test
|
@Test
|
||||||
public void getIcon_showIcon() {
|
public void getIcon_showIcon() {
|
||||||
assertThat(mIncompatibleChargerTip.getIconId())
|
assertThat(mIncompatibleChargerTip.getIconId())
|
||||||
.isEqualTo(R.drawable.ic_battery_alert_24dp);
|
.isEqualTo(R.drawable.ic_battery_alert_theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -70,8 +70,7 @@ public class LowBatteryTipTest {
|
|||||||
mContext.getString(R.string.battery_tip_low_battery_title));
|
mContext.getString(R.string.battery_tip_low_battery_title));
|
||||||
assertThat(mLowBatteryTip.getSummary(mContext)).isEqualTo(
|
assertThat(mLowBatteryTip.getSummary(mContext)).isEqualTo(
|
||||||
mContext.getString(R.string.battery_tip_low_battery_summary));
|
mContext.getString(R.string.battery_tip_low_battery_summary));
|
||||||
assertThat(mLowBatteryTip.getIconId()).isEqualTo(R.drawable.ic_battery_status_bad_24dp);
|
assertThat(mLowBatteryTip.getIconId()).isEqualTo(R.drawable.ic_battery_saver_accent_24dp);
|
||||||
assertThat(mLowBatteryTip.getIconTintColorId()).isEqualTo(R.color.battery_bad_color_light);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Reference in New Issue
Block a user