Remove battery level from RL stats

This commit is contained in:
Bart Sopers 2020-12-19 16:24:33 +01:00
parent 9415f094ad
commit c8ea37a979
3 changed files with 23 additions and 61 deletions

View file

@ -48,11 +48,9 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re
TextView lastUsedFrequency; TextView lastUsedFrequency;
TextView lastDeviceContact; TextView lastDeviceContact;
TextView firmwareVersion; TextView firmwareVersion;
TextView batteryLevel;
boolean first = false; boolean first = false;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.rileylink_status_general, container, false); View rootView = inflater.inflate(R.layout.rileylink_status_general, container, false);
@ -76,14 +74,12 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re
this.lastUsedFrequency = getActivity().findViewById(R.id.rls_t1_last_used_frequency); this.lastUsedFrequency = getActivity().findViewById(R.id.rls_t1_last_used_frequency);
this.lastDeviceContact = getActivity().findViewById(R.id.rls_t1_last_device_contact); this.lastDeviceContact = getActivity().findViewById(R.id.rls_t1_last_device_contact);
this.firmwareVersion = getActivity().findViewById(R.id.rls_t1_firmware_version); this.firmwareVersion = getActivity().findViewById(R.id.rls_t1_firmware_version);
this.batteryLevel = getActivity().findViewById(R.id.rls_t1_battery_level);
if (!first) { if (!first) {
// 7-14 // 7-14
int[] ids = {R.id.rls_t1_tv02, R.id.rls_t1_tv03, R.id.rls_t1_tv04, R.id.rls_t1_tv05, R.id.rls_t1_tv07, // int[] ids = {R.id.rls_t1_tv02, R.id.rls_t1_tv03, R.id.rls_t1_tv04, R.id.rls_t1_tv05, R.id.rls_t1_tv07, //
R.id.rls_t1_tv08, R.id.rls_t1_tv09, R.id.rls_t1_tv10, R.id.rls_t1_tv11, R.id.rls_t1_tv12, R.id.rls_t1_tv13, R.id.rls_t1_tv08, R.id.rls_t1_tv09, R.id.rls_t1_tv10, R.id.rls_t1_tv11, R.id.rls_t1_tv12, R.id.rls_t1_tv13};
R.id.rls_t1_tv14};
for (int id : ids) { for (int id : ids) {
@ -116,13 +112,6 @@ public class RileyLinkStatusGeneralFragment extends DaggerFragment implements Re
this.firmwareVersion.setText("BLE113: " + rileyLinkServiceData.versionBLE113 + this.firmwareVersion.setText("BLE113: " + rileyLinkServiceData.versionBLE113 +
"\nCC110: " + rileyLinkServiceData.versionCC110); "\nCC110: " + rileyLinkServiceData.versionCC110);
} }
Integer batteryLevel = rileyLinkServiceData.batteryLevel;
if (batteryLevel == null) {
this.batteryLevel.setText("???");
} else {
this.batteryLevel.setText(batteryLevel + "%");
}
} }
RileyLinkPumpDevice pumpPlugin = (RileyLinkPumpDevice) activePlugin.getActivePump(); RileyLinkPumpDevice pumpPlugin = (RileyLinkPumpDevice) activePlugin.getActivePump();

View file

@ -49,9 +49,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -75,9 +75,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
@ -102,9 +102,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
@ -129,35 +129,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
</LinearLayout> android:textAlignment="center" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="16pt"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/rls_t1_tv14"
android:layout_width="58dp"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:layout_weight="35"
android:gravity="center_vertical"
android:text="@string/rileylink_battery_level" />
<TextView
android:id="@+id/rls_t1_battery_level"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical"
android:text=" " />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -181,9 +155,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
<!-- Group - Device --> <!-- Group - Device -->
@ -222,9 +196,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
@ -249,9 +223,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
@ -276,9 +250,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
@ -303,9 +277,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -329,9 +303,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
@ -356,9 +330,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_weight="65" android:layout_weight="65"
android:textAlignment="center"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text=" " /> android:text=" "
android:textAlignment="center" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -30,7 +30,6 @@
<string name="rileylink_last_used_frequency">Last used frequency</string> <string name="rileylink_last_used_frequency">Last used frequency</string>
<string name="rileylink_last_device_contact">Last device contact</string> <string name="rileylink_last_device_contact">Last device contact</string>
<string name="rileylink_firmware_version">Firmware</string> <string name="rileylink_firmware_version">Firmware</string>
<string name="rileylink_battery_level">Battery level</string>
<!-- RL State --> <!-- RL State -->