Skip to content

Commit

Permalink
G7 Classic Status page cleanup NightscoutFoundation#3246
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'Navid200/Navid_2023_12_18' into schubi
  • Loading branch information
Der-Schubi committed Feb 8, 2024
2 parents f18c34d + 7d0383c commit ef7f6a2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ public interface MicroStatus {

boolean xmitterBattery();

boolean usingG7(); // True when using G7

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
* Created by jamorham on 29/09/2017.
*/

import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId;

import androidx.databinding.BaseObservable;

import com.eveningoutpost.dexdrip.utilitymodels.Pref;
import com.eveningoutpost.dexdrip.utils.DexCollectionType;

public class MicroStatusImpl extends BaseObservable implements MicroStatus {
Expand All @@ -28,12 +31,21 @@ public String gs(String id) {
}

@Override
public boolean bluetooth() {
return DexCollectionType.hasBluetooth();
public boolean bluetooth() { // Dexcom with Bluetooth except G7
return DexCollectionType.hasBluetooth() && !usingG7();
}

@Override
public boolean xmitterBattery() {
return DexCollectionType.usesClassicTransmitterBattery();
}

@Override
public boolean usingG7() {
try { // True if we are using G7
return DexCollectionType.getDexCollectionType() == DexCollectionType.DexcomG5 && Pref.getBooleanDefaultFalse("using_g6") && shortTxId();
} catch (Exception e) { // If there are any unknowns, show that we are not using G7
return false;
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_system_status.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@

<Button
android:id="@+id/forget_device"
app:showIfTrue="@{!ms.usingG7()}"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down

0 comments on commit ef7f6a2

Please sign in to comment.