use of com.eveningoutpost.dexdrip.databinding.ActivitySystemStatusBinding in project xDrip-plus by jamorham.
the class SystemStatusFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
// Injectors.getMicroStatusComponent().inject(this);
requestWearCollectorStatus();
serviceDataReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context ctx, Intent intent) {
final String action = intent.getAction();
// final String msg = intent.getStringExtra("data");
Bundle bundle = intent.getBundleExtra("data");
if (bundle != null) {
DataMap dataMap = DataMap.fromBundle(bundle);
String lastState = dataMap.getString("lastState", "");
long last_timestamp = dataMap.getLong("timestamp", 0);
UserError.Log.d(TAG, "serviceDataReceiver onReceive:" + action + " :: " + lastState + " last_timestamp :: " + last_timestamp);
switch(action) {
case WatchUpdaterService.ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE:
switch(DexCollectionType.getDexCollectionType()) {
case DexcomG5:
// msg, last_timestamp
G5CollectionService.setWatchStatus(dataMap);
break;
case DexcomShare:
if (lastState != null && !lastState.isEmpty()) {
// TODO getLastState() in non-G5 Services
setConnectionStatus(lastState);
}
break;
default:
// msg, last_timestamp
DexCollectionService.setWatchStatus(dataMap);
if (lastState != null && !lastState.isEmpty()) {
setConnectionStatus(lastState);
}
break;
}
break;
}
}
}
};
final ActivitySystemStatusBinding binding = DataBindingUtil.inflate(inflater, R.layout.activity_system_status, container, false);
microStatus = new MicroStatusImpl();
binding.setMs(microStatus);
return binding.getRoot();
}
use of com.eveningoutpost.dexdrip.databinding.ActivitySystemStatusBinding in project xDrip by NightscoutFoundation.
the class SystemStatusFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
// Injectors.getMicroStatusComponent().inject(this);
requestWearCollectorStatus();
serviceDataReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context ctx, Intent intent) {
final String action = intent.getAction();
// final String msg = intent.getStringExtra("data");
Bundle bundle = intent.getBundleExtra("data");
if (bundle != null) {
DataMap dataMap = DataMap.fromBundle(bundle);
String lastState = dataMap.getString("lastState", "");
long last_timestamp = dataMap.getLong("timestamp", 0);
UserError.Log.d(TAG, "serviceDataReceiver onReceive:" + action + " :: " + lastState + " last_timestamp :: " + last_timestamp);
switch(action) {
case WatchUpdaterService.ACTION_BLUETOOTH_COLLECTION_SERVICE_UPDATE:
switch(DexCollectionType.getDexCollectionType()) {
case DexcomG5:
// msg, last_timestamp
G5CollectionService.setWatchStatus(dataMap);
break;
case DexcomShare:
if (lastState != null && !lastState.isEmpty()) {
// TODO getLastState() in non-G5 Services
setConnectionStatus(lastState);
}
break;
default:
// msg, last_timestamp
DexCollectionService.setWatchStatus(dataMap);
if (lastState != null && !lastState.isEmpty()) {
setConnectionStatus(lastState);
}
break;
}
break;
}
}
}
};
final ActivitySystemStatusBinding binding = DataBindingUtil.inflate(inflater, R.layout.activity_system_status, container, false);
microStatus = new MicroStatusImpl();
binding.setMs(microStatus);
return binding.getRoot();
}
Aggregations