diff --git a/app/src/main/assets/tws_bud.svg b/app/src/main/assets/tws_bud.svg
new file mode 100644
index 000000000..1cd983e8a
--- /dev/null
+++ b/app/src/main/assets/tws_bud.svg
@@ -0,0 +1,76 @@
+
+
+
+
diff --git a/app/src/main/assets/tws_bud_l.svg b/app/src/main/assets/tws_bud_l.svg
new file mode 100644
index 000000000..03d29a0a8
--- /dev/null
+++ b/app/src/main/assets/tws_bud_l.svg
@@ -0,0 +1,72 @@
+
+
+
+
diff --git a/app/src/main/assets/tws_bud_r.svg b/app/src/main/assets/tws_bud_r.svg
new file mode 100644
index 000000000..3cd3739a8
--- /dev/null
+++ b/app/src/main/assets/tws_bud_r.svg
@@ -0,0 +1,72 @@
+
+
+
+
diff --git a/app/src/main/assets/tws_case.svg b/app/src/main/assets/tws_case.svg
new file mode 100644
index 000000000..2fdfd94fb
--- /dev/null
+++ b/app/src/main/assets/tws_case.svg
@@ -0,0 +1,59 @@
+
+
+
+
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/BatteryInfoActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/BatteryInfoActivity.java
index 3ea97fab6..44dc3f69b 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/BatteryInfoActivity.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/BatteryInfoActivity.java
@@ -19,8 +19,11 @@ import java.util.Date;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
+import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
+import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
+import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
public class
BatteryInfoActivity extends AbstractGBActivity {
@@ -62,6 +65,7 @@ BatteryInfoActivity extends AbstractGBActivity {
TextView battery_status_device_name_text = (TextView) findViewById(R.id.battery_status_device_name);
TextView battery_status_battery_voltage = (TextView) findViewById(R.id.battery_status_battery_voltage);
+ TextView battery_status_extra_name = (TextView) findViewById(R.id.battery_status_extra_name);
final TextView battery_status_date_from_text = (TextView) findViewById(R.id.battery_status_date_from_text);
final TextView battery_status_date_to_text = (TextView) findViewById(R.id.battery_status_date_to_text);
final SeekBar battery_status_time_span_seekbar = (SeekBar) findViewById(R.id.battery_status_time_span_seekbar);
@@ -164,6 +168,17 @@ BatteryInfoActivity extends AbstractGBActivity {
battery_status_device_name_text.setText(gbDevice.getName());
battery_status_battery_level_text.setText(level);
battery_status_battery_voltage.setText(voltage);
+
+ DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(gbDevice);
+ for (BatteryConfig batteryConfig : coordinator.getBatteryConfig()) {
+ if (batteryConfig.getBatteryIndex() == batteryIndex) {
+ battery_status_extra_name.setText(batteryConfig.getBatteryLabel());
+ battery_status_device_icon.setImageResource(batteryConfig.getBatteryIcon());
+ if (gbDevice.isInitialized()) {
+ battery_status_device_icon.setColorFilter(this.getResources().getColor(R.color.accent));
+ }
+ }
+ }
}
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java
index 6a7ec6fae..7d2a791c4 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapterv2.java
@@ -161,9 +161,8 @@ public class GBDeviceAdapterv2 extends RecyclerView.Adapter. */
+
package nodomain.freeyourgadget.gadgetbridge.model;
public class BatteryConfig {
private final int batteryIndex;
- private final int icon;
- private final int label;
+ private final int batteryIcon;
+ private final int batteryLabel;
- public BatteryConfig(int batteryIndex, int icon, int label) {
+ public BatteryConfig(int batteryIndex, int batteryIcon, int batteryLabel) {
this.batteryIndex = batteryIndex;
- this.icon = icon;
- this.label = label;
+ this.batteryIcon = batteryIcon;
+ this.batteryLabel = batteryLabel;
}
public int getBatteryIndex() {
return batteryIndex;
}
- public int icon() {
- return icon;
+ public int getBatteryIcon() {
+ return batteryIcon;
}
- public int label() {
- return label;
+ public int getBatteryLabel() {
+ return batteryLabel;
}
}
diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java
index 1bc6eb8e4..b15d80c07 100644
--- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java
+++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/DeviceHelper.java
@@ -343,8 +343,8 @@ public class DeviceHelper {
GBDevice gbDevice = new GBDevice(dbDevice.getIdentifier(), dbDevice.getName(), dbDevice.getAlias(), deviceType);
DeviceCoordinator coordinator = getCoordinator(gbDevice);
for (BatteryConfig batteryConfig : coordinator.getBatteryConfig()) {
- gbDevice.setBatteryIcon(batteryConfig.icon(), batteryConfig.getBatteryIndex());
- gbDevice.setBatteryLabel(batteryConfig.label(), batteryConfig.getBatteryIndex());
+ gbDevice.setBatteryIcon(batteryConfig.getBatteryIcon(), batteryConfig.getBatteryIndex());
+ gbDevice.setBatteryLabel(batteryConfig.getBatteryLabel(), batteryConfig.getBatteryIndex());
}
List deviceAttributesList = dbDevice.getDeviceAttributesList();
diff --git a/app/src/main/res/drawable/ic_tws_bud_l.xml b/app/src/main/res/drawable/ic_tws_bud_l.xml
new file mode 100644
index 000000000..5a4bb241e
--- /dev/null
+++ b/app/src/main/res/drawable/ic_tws_bud_l.xml
@@ -0,0 +1,12 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_tws_bud_r.xml b/app/src/main/res/drawable/ic_tws_bud_r.xml
new file mode 100644
index 000000000..4af389ae5
--- /dev/null
+++ b/app/src/main/res/drawable/ic_tws_bud_r.xml
@@ -0,0 +1,12 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_tws_case.xml b/app/src/main/res/drawable/ic_tws_case.xml
new file mode 100644
index 000000000..1ac498673
--- /dev/null
+++ b/app/src/main/res/drawable/ic_tws_case.xml
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/app/src/main/res/layout/activity_battery_info.xml b/app/src/main/res/layout/activity_battery_info.xml
index 5f38221cb..4ec3d57eb 100644
--- a/app/src/main/res/layout/activity_battery_info.xml
+++ b/app/src/main/res/layout/activity_battery_info.xml
@@ -61,6 +61,11 @@
android:layout_weight="1"
android:orientation="horizontal">
+
+
Other
Left
Right
- Case
Horizontal
Vertical
No valid user data given, using dummy user data for now.
@@ -1310,4 +1309,7 @@
Left
Right
Touch Options
+ Battery case
+ Left earbud
+ Right earbud