diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java index 46e2608542..9a7eed1fd7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java @@ -36,8 +36,11 @@ import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.TreatmentsInterface; +import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData; +import info.nightscout.androidaps.plugins.IobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin; +import info.nightscout.androidaps.plugins.NSClientInternal.data.NSDeviceStatus; import info.nightscout.androidaps.plugins.Overview.OverviewPlugin; import info.nightscout.androidaps.plugins.Wear.ActionStringHandler; import info.nightscout.androidaps.plugins.Wear.WearPlugin; @@ -241,23 +244,21 @@ public class WatchUpdaterService extends WearableListenerService implements } else if (lastBG.value < lowLine) { sgvLevel = -1; } - DataMap dataMap = new DataMap(); - int battery = getBatteryLevel(getApplicationContext()); + DataMap dataMap = new DataMap(); dataMap.putString("sgvString", lastBG.valueToUnitsToString(units)); dataMap.putDouble("timestamp", lastBG.date); if (glucoseStatus == null) { dataMap.putString("slopeArrow", ""); - dataMap.putString("delta", ""); - dataMap.putString("avgDelta", ""); + dataMap.putString("delta", "--"); + dataMap.putString("avgDelta", "--"); } else { dataMap.putString("slopeArrow", slopeArrow(glucoseStatus.delta)); dataMap.putString("delta", deltastring(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units)); dataMap.putString("avgDelta", deltastring(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, units)); } - dataMap.putString("battery", "" + battery); + dataMap.putLong("sgvLevel", sgvLevel); - dataMap.putInt("batteryLevel", (battery >= 30) ? 1 : 0); dataMap.putDouble("sgvDouble", lastBG.value); dataMap.putDouble("high", highLine); dataMap.putDouble("low", lowLine); @@ -272,10 +273,20 @@ public class WatchUpdaterService extends WearableListenerService implements deltastring += "-"; } + + boolean detailed = SP.getBoolean("wear_detailed_delta", false); if (units.equals(Constants.MGDL)) { - deltastring += DecimalFormatter.to1Decimal(Math.abs(deltaMGDL)); + if (detailed) { + deltastring += DecimalFormatter.to1Decimal(Math.abs(deltaMGDL)); + } else { + deltastring += DecimalFormatter.to0Decimal(Math.abs(deltaMGDL)); + } } else { - deltastring += DecimalFormatter.to1Decimal(Math.abs(deltaMMOL)); + if (detailed){ + deltastring += DecimalFormatter.to2Decimal(Math.abs(deltaMMOL)); + } else { + deltastring += DecimalFormatter.to1Decimal(Math.abs(deltaMMOL)); + } } return deltastring; } @@ -514,14 +525,55 @@ public class WatchUpdaterService extends WearableListenerService implements } private void sendStatus() { + if (googleApiClient.isConnected()) { - String status = generateStatusString(); + TreatmentsInterface treatmentsInterface = MainApp.getConfigBuilder(); + treatmentsInterface.updateTotalIOBTreatments(); + IobTotal bolusIob = treatmentsInterface.getLastCalculationTreatments().round(); + treatmentsInterface.updateTotalIOBTempBasals(); + IobTotal basalIob = treatmentsInterface.getLastCalculationTempBasals().round(); + + String iobSum = DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob); + String iobDetail = "(" + DecimalFormatter.to2Decimal(bolusIob.iob) + "|" + DecimalFormatter.to2Decimal(basalIob.basaliob) + ")"; + String cobString = generateCOBString(); + String tempBasal = generateBasalString(treatmentsInterface); + + //bgi + String bgiString = ""; + Profile profile = MainApp.getConfigBuilder().getProfile(); + double bgi = -(bolusIob.activity + basalIob.activity) * 5 * profile.getIsf(); + bgiString = "" + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to1Decimal(bgi); + + String status = generateStatusString(profile, tempBasal,iobSum, iobDetail, bgiString); + + //batteries + int phoneBattery = getBatteryLevel(getApplicationContext()); + String rigBattery = NSDeviceStatus.getInstance().getUploaderStatus().trim(); + + //OpenAPS status + String openApsString = String.valueOf(NSDeviceStatus.getInstance().getOpenApsStatus()); + String openApsStatus = ""; + if(openApsString != null) { + int index = openApsString.indexOf("m"); + if(index > 0) + openApsStatus = openApsString.substring(0, index); + } PutDataMapRequest dataMapRequest = PutDataMapRequest.create(NEW_STATUS_PATH); //unique content - dataMapRequest.getDataMap().putDouble("timestamp", System.currentTimeMillis()); dataMapRequest.getDataMap().putString("externalStatusString", status); + dataMapRequest.getDataMap().putString("iobSum", iobSum); + dataMapRequest.getDataMap().putString("iobDetail", iobDetail); + dataMapRequest.getDataMap().putBoolean("detailedIob", mPrefs.getBoolean("wear_detailediob", false)); + dataMapRequest.getDataMap().putString("cob", cobString); + dataMapRequest.getDataMap().putString("tempBasal", tempBasal); + dataMapRequest.getDataMap().putString("battery", "" + phoneBattery); + dataMapRequest.getDataMap().putString("rigBattery", rigBattery); + dataMapRequest.getDataMap().putString("openApsStatus", openApsStatus); + dataMapRequest.getDataMap().putString("bgi", bgiString); + dataMapRequest.getDataMap().putBoolean("showBgi", mPrefs.getBoolean("wear_showbgi", false)); + dataMapRequest.getDataMap().putInt("batteryLevel", (phoneBattery >= 30) ? 1 : 0); PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest(); Wearable.DataApi.putDataItem(googleApiClient, putDataRequest); } else { @@ -546,10 +598,10 @@ public class WatchUpdaterService extends WearableListenerService implements } @NonNull - private String generateStatusString() { + private String generateStatusString(Profile profile, String tempBasal, String iobSum, String iobDetail, String bgiString) { + String status = ""; - Profile profile = MainApp.getConfigBuilder().getProfile(); if (profile == null) { status = MainApp.sResources.getString(R.string.noprofile); return status; @@ -564,38 +616,45 @@ public class WatchUpdaterService extends WearableListenerService implements lastLoopStatus = true; } - //Temp basal - TreatmentsInterface treatmentsInterface = MainApp.getConfigBuilder(); - - TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis()); - if (activeTemp != null) { - status += activeTemp.toStringShort(); - + String iobString = ""; + if (mPrefs.getBoolean("wear_detailediob", false)) { + iobString = iobSum + " " + iobDetail; + } else { + iobString = iobSum + "U"; } - //IOB - treatmentsInterface.updateTotalIOBTreatments(); - IobTotal bolusIob = treatmentsInterface.getLastCalculationTreatments().round(); - treatmentsInterface.updateTotalIOBTempBasals(); - IobTotal basalIob = treatmentsInterface.getLastCalculationTempBasals().round(); - status += DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob); + status += tempBasal + " " + iobString; - if (mPrefs.getBoolean("wear_detailediob", true)) { - status += "(" - + DecimalFormatter.to2Decimal(bolusIob.iob) + "|" - + DecimalFormatter.to2Decimal(basalIob.basaliob) + ")"; + //add BGI if shown, otherwise return + if (mPrefs.getBoolean("wear_showbgi", false)) { + status += " " + bgiString; } - if (!mPrefs.getBoolean("wear_showbgi", false)) { - return status; - } - - double bgi = -(bolusIob.activity + basalIob.activity) * 5 * profile.getIsf(); - - status += " " + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to2Decimal(bgi); return status; } + @NonNull + private String generateBasalString(TreatmentsInterface treatmentsInterface) { + + String basalStringResult = "-.--U/h"; + TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis()); + if (activeTemp != null) { + basalStringResult = activeTemp.toStringShort(); + } + return basalStringResult; + } + + @NonNull + private String generateCOBString() { + + String cobStringResult = "--"; + AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis()); + if (autosensData != null) { + cobStringResult = (int) autosensData.cob + "g"; + } + return cobStringResult; + } + @Override public void onDestroy() { if (googleApiClient != null && googleApiClient.isConnected()) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1dd663764a..e8918979b3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -782,6 +782,7 @@ dexcomg5_nsupload G5 upload settings Customized APK for download - + Show detailed delta + Show delta with one more decimal place diff --git a/app/src/main/res/xml/pref_wear.xml b/app/src/main/res/xml/pref_wear.xml index bd6c42725a..406e156ab3 100644 --- a/app/src/main/res/xml/pref_wear.xml +++ b/app/src/main/res/xml/pref_wear.xml @@ -4,24 +4,32 @@ android:key="wearplugin" android:title="@string/wear_settings"> - + - + - + + + + + - \ No newline at end of file diff --git a/wear/src/main/AndroidManifest.xml b/wear/src/main/AndroidManifest.xml index 4db69169dd..e6c15d799d 100644 --- a/wear/src/main/AndroidManifest.xml +++ b/wear/src/main/AndroidManifest.xml @@ -34,6 +34,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + bgDataList = new ArrayList<>(); public ArrayList tempWatchDataList = new ArrayList<>(); public ArrayList basalWatchDataList = new ArrayList<>(); public PowerManager.WakeLock wakeLock; // related endTime manual layout public View layoutView; - private final Point displaySize = new Point(); - private int specW, specH; - + public final Point displaySize = new Point(); + public int specW, specH; private LocalBroadcastManager localBroadcastManager; private MessageReceiver messageReceiver; protected SharedPreferences sharedPrefs; - private String batteryString = "--"; - private String sgvString = "--"; - private String externalStatusString = "no status"; - private String avgDelta = ""; - private String delta = ""; + public boolean detailedIOB = false; + public boolean showBGI = false; + public String openApsStatus = "0"; + public String externalStatusString = "no status"; + public String sSgv = "---"; + public String sDirection = "--"; + public String sUploaderBattery = "--"; + public String sRigBattery = "--"; + public String sDelta = "--"; + public String sAvgDelta = "--"; + public String sBasalRate = "-.--U/h"; + public String sIOB1 = "IOB"; + public String sIOB2 = "-.--"; + public String sCOB1 = "Carb"; + public String sCOB2 = "--g"; + public String sBgi = "--"; @Override public void onCreate() { @@ -107,6 +121,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen protected void onLayout(WatchShape shape, Rect screenBounds, WindowInsets screenInsets) { super.onLayout(shape, screenBounds, screenInsets); layoutView.onApplyWindowInsets(screenInsets); + bIsRound = screenInsets.isRound(); } public void performViewSetup() { @@ -121,22 +136,37 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen @Override public void onLayoutInflated(WatchViewStub stub) { mTime = (TextView) stub.findViewById(R.id.watch_time); + mDay = (TextView) stub.findViewById(R.id.day); + mMonth = (TextView) stub.findViewById(R.id.month); + mDate = (LinearLayout) stub.findViewById(R.id.date_time); + mLoop = (TextView) stub.findViewById(R.id.loop); mSgv = (TextView) stub.findViewById(R.id.sgv); mDirection = (TextView) stub.findViewById(R.id.direction); mTimestamp = (TextView) stub.findViewById(R.id.timestamp); + mIOB1 = (TextView) stub.findViewById(R.id.iob_text); + mIOB2 = (TextView) stub.findViewById(R.id.iobView); + mCOB1 = (TextView) stub.findViewById(R.id.cob_text); + mCOB2 = (TextView) stub.findViewById(R.id.cobView); + mBgi = (TextView) stub.findViewById(R.id.bgiView); mStatus = (TextView) stub.findViewById(R.id.externaltstatus); + mBasalRate = (TextView) stub.findViewById(R.id.tmpBasal); mUploaderBattery = (TextView) stub.findViewById(R.id.uploader_battery); + mRigBattery = (TextView) stub.findViewById(R.id.rig_battery); mDelta = (TextView) stub.findViewById(R.id.delta); + mAvgDelta = (TextView) stub.findViewById(R.id.avgdelta); + isAAPSv2 = (TextView) stub.findViewById(R.id.AAPSv2); + mHighLight = (TextView) stub.findViewById(R.id.highLight); + mLowLight = (TextView) stub.findViewById(R.id.lowLight); mRelativeLayout = (RelativeLayout) stub.findViewById(R.id.main_layout); mLinearLayout = (LinearLayout) stub.findViewById(R.id.secondary_layout); + mLinearLayout2 = (LinearLayout) stub.findViewById(R.id.tertiary_layout); chart = (LineChartView) stub.findViewById(R.id.chart); layoutSet = true; - showAgoRawBattStatus(); - mRelativeLayout.measure(specW, specH); - mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), - mRelativeLayout.getMeasuredHeight()); + + setDataFields(); + } } - }); + ); ListenerService.requestData(this); wakeLock.acquire(50); } @@ -164,9 +194,10 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen @Override public void onDestroy() { - if(localBroadcastManager != null && messageReceiver != null){ - localBroadcastManager.unregisterReceiver(messageReceiver);} - if (sharedPrefs != null){ + if (localBroadcastManager != null && messageReceiver != null) { + localBroadcastManager.unregisterReceiver(messageReceiver); + } + if (sharedPrefs != null) { sharedPrefs.unregisterOnSharedPreferenceChangeListener(this); } super.onDestroy(); @@ -181,7 +212,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen @Override protected void onDraw(Canvas canvas) { - if(layoutSet) { + if (layoutSet) { this.mRelativeLayout.draw(canvas); Log.d("onDraw", "draw"); } @@ -191,17 +222,10 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen protected void onTimeChanged(WatchFaceTime oldTime, WatchFaceTime newTime) { if (layoutSet && (newTime.hasHourChanged(oldTime) || newTime.hasMinuteChanged(oldTime))) { wakeLock.acquire(50); - final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this); - mTime.setText(timeFormat.format(System.currentTimeMillis())); - showAgoRawBattStatus(); - - if(ageLevel()<=0) { - mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); - } else { - mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); - } + setDataFields(); missedReadingAlert(); + mRelativeLayout.measure(specW, specH); mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), mRelativeLayout.getMeasuredHeight()); @@ -212,108 +236,261 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen @Override public void onReceive(Context context, Intent intent) { - //data Bundle bundle = intent.getBundleExtra("data"); if (layoutSet && bundle != null) { DataMap dataMap = DataMap.fromBundle(bundle); wakeLock.acquire(50); sgvLevel = dataMap.getLong("sgvLevel"); - batteryLevel = dataMap.getInt("batteryLevel"); datetime = dataMap.getDouble("timestamp"); - sgvString = dataMap.getString("sgvString"); - batteryString = dataMap.getString("battery"); - mSgv.setText(dataMap.getString("sgvString")); - - if(ageLevel()<=0) { - mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); - } else { - mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); - } - - final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this); - mTime.setText(timeFormat.format(System.currentTimeMillis())); - - mDirection.setText(dataMap.getString("slopeArrow")); - avgDelta = dataMap.getString("avgDelta"); - delta = dataMap.getString("delta"); - - - showAgoRawBattStatus(); - - + sSgv = dataMap.getString("sgvString"); + sDirection = dataMap.getString("slopeArrow"); + sDelta = dataMap.getString("delta"); + sAvgDelta = dataMap.getString("avgDelta"); if (chart != null) { addToWatchSet(dataMap); setupCharts(); } - mRelativeLayout.measure(specW, specH); - mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), - mRelativeLayout.getMeasuredHeight()); - invalidate(); - setColor(); } - //status + bundle = intent.getBundleExtra("status"); if (layoutSet && bundle != null) { DataMap dataMap = DataMap.fromBundle(bundle); wakeLock.acquire(50); + sBasalRate = dataMap.getString("tempBasal"); + sUploaderBattery = dataMap.getString("battery"); + sRigBattery = dataMap.getString("rigBattery"); + detailedIOB = dataMap.getBoolean("detailedIob"); + sIOB1 = dataMap.getString("iobSum") + "U"; + sIOB2 = dataMap.getString("iobDetail"); + sCOB1 = "Carb"; + sCOB2 = dataMap.getString("cob"); + sBgi = dataMap.getString("bgi"); + showBGI = dataMap.getBoolean("showBgi"); externalStatusString = dataMap.getString("externalStatusString"); - - showAgoRawBattStatus(); - - mRelativeLayout.measure(specW, specH); - mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), - mRelativeLayout.getMeasuredHeight()); - invalidate(); - setColor(); + openApsStatus = dataMap.getString("openApsStatus"); + batteryLevel = dataMap.getInt("batteryLevel"); } - //basals and temps + + setDataFields(); + bundle = intent.getBundleExtra("basals"); if (layoutSet && bundle != null) { DataMap dataMap = DataMap.fromBundle(bundle); wakeLock.acquire(500); - loadBasalsAndTemps(dataMap); + } - mRelativeLayout.measure(specW, specH); - mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), - mRelativeLayout.getMeasuredHeight()); - invalidate(); - setColor(); + mRelativeLayout.measure(specW, specH); + mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), + mRelativeLayout.getMeasuredHeight()); + invalidate(); + setColor(); + } + } + + public void setDataFields() { + + setDateAndTime(); + + if (mSgv != null) { + if (sharedPrefs.getBoolean("showBG", true)) { + mSgv.setText(sSgv); + mSgv.setVisibility(View.VISIBLE); + } else { + //leave the textview there but invisible, as a height holder for the empty space above the white line + mSgv.setVisibility(View.INVISIBLE); + mSgv.setText(""); + } + } + + strikeThroughSgvIfNeeded(); + + if (mDirection != null) { + if (sharedPrefs.getBoolean("show_direction", true)) { + mDirection.setText(sDirection); + mDirection.setVisibility(View.VISIBLE); + } else { + mDirection.setVisibility(View.GONE); + } + } + + if (mDelta != null) { + if (sharedPrefs.getBoolean("showDelta", true)) { + mDelta.setText(sDelta); + mDelta.setVisibility(View.VISIBLE); + } else { + mDelta.setVisibility(View.GONE); + } + } + + if (mAvgDelta != null) { + if (sharedPrefs.getBoolean("showAvgDelta", true)) { + mAvgDelta.setText(sAvgDelta); + mAvgDelta.setVisibility(View.VISIBLE); + } else { + mAvgDelta.setVisibility(View.GONE); + } + } + + if (mCOB1 != null && mCOB2 != null) { + mCOB2.setText(sCOB2); + if (sharedPrefs.getBoolean("show_cob", true)) { + mCOB1.setVisibility(View.VISIBLE); + mCOB2.setVisibility(View.VISIBLE); + } else { + mCOB1.setVisibility(View.GONE); + mCOB2.setVisibility(View.GONE); + } + //deal with cases where there is only the value shown for COB, and not the label + } else if (mCOB2 != null) { + mCOB2.setText(sCOB2); + if (sharedPrefs.getBoolean("show_cob", true)) { + mCOB2.setVisibility(View.VISIBLE); + } else { + mCOB2.setVisibility(View.GONE); + } + } + + if (mIOB1 != null && mIOB2 != null) { + if (sharedPrefs.getBoolean("show_iob", true)) { + mIOB1.setVisibility(View.VISIBLE); + mIOB2.setVisibility(View.VISIBLE); + if (detailedIOB) { + mIOB1.setText(sIOB1); + mIOB2.setText(sIOB2); + } else { + mIOB1.setText("IOB"); + mIOB2.setText(sIOB1); + } + } else { + mIOB1.setVisibility(View.GONE); + mIOB2.setVisibility(View.GONE); + } + //deal with cases where there is only the value shown for IOB, and not the label + } else if (mIOB2 != null) { + if (sharedPrefs.getBoolean("show_iob", true)) { + mIOB2.setVisibility(View.VISIBLE); + if (detailedIOB) { + mIOB2.setText(sIOB2); + } else { + mIOB2.setText(sIOB1); + } + } else { + mIOB2.setText(""); + } + } + + if (mTimestamp != null) { + if (sharedPrefs.getBoolean("showAgo", true)) { + if (isAAPSv2 != null) { + mTimestamp.setText(readingAge(true)); + } else { + if (sharedPrefs.getBoolean("showExternalStatus", true)) { + mTimestamp.setText(readingAge(true)); + } else { + mTimestamp.setText(readingAge(false)); + } + } + mTimestamp.setVisibility(View.VISIBLE); + } else { + mTimestamp.setVisibility(View.GONE); + } + } + + if (mUploaderBattery != null) { + if (sharedPrefs.getBoolean("show_uploader_battery", true)) { + if (isAAPSv2 != null) { + mUploaderBattery.setText(sUploaderBattery + "%"); + mUploaderBattery.setVisibility(View.VISIBLE); + } else { + if (sharedPrefs.getBoolean("showExternalStatus", true)) { + mUploaderBattery.setText("U: " + sUploaderBattery + "%"); + } else { + mUploaderBattery.setText("Uploader: " + sUploaderBattery + "%"); + } + } + } else { + mUploaderBattery.setVisibility(View.GONE); + } + } + + if (mRigBattery != null) { + if (sharedPrefs.getBoolean("show_rig_battery", false)) { + mRigBattery.setText(sRigBattery); + mRigBattery.setVisibility(View.VISIBLE); + } else { + mRigBattery.setVisibility(View.GONE); + } + } + + if (mBasalRate != null) { + if (sharedPrefs.getBoolean("show_temp_basal", true)) { + mBasalRate.setText(sBasalRate); + mBasalRate.setVisibility(View.VISIBLE); + } else { + mBasalRate.setVisibility(View.GONE); + } + } + + if (mBgi != null) { + if (showBGI) { + mBgi.setText(sBgi); + mBgi.setVisibility(View.VISIBLE); + } else { + mBgi.setVisibility(View.GONE); + } + } + + if (mStatus != null) { + if (sharedPrefs.getBoolean("showExternalStatus", true)) { + mStatus.setText(externalStatusString); + mStatus.setVisibility(View.VISIBLE); + } else { + mStatus.setVisibility(View.GONE); + } + } + + if (mLoop != null) { + if (sharedPrefs.getBoolean("showExternalStatus", true)) { + mLoop.setVisibility(View.VISIBLE); + if (openApsStatus != null && openApsStatus != "") { + mLoop.setText(openApsStatus + "'"); + if (Integer.valueOf(openApsStatus) > 14) { + loopLevel = 0; + //if (getCurrentWatchMode() == WatchMode.INTERACTIVE) { + mLoop.setBackgroundResource(R.drawable.loop_red_25); + //} + } else { + loopLevel = 1; + //if (getCurrentWatchMode() == WatchMode.INTERACTIVE) { + mLoop.setBackgroundResource(R.drawable.loop_green_25); + //} + } + } else { + mLoop.setText("-'"); + } + } else { + mLoop.setVisibility(View.GONE); } } } - private void showAgoRawBattStatus() { + public void setDateAndTime() { + final java.text.DateFormat timeFormat = DateFormat.getTimeFormat(BaseWatchFace.this); + mTime.setText(timeFormat.format(System.currentTimeMillis())); - boolean showAvgDelta = sharedPrefs.getBoolean("showAvgDelta", true); - mDelta.setText(delta); - if(showAvgDelta){ - mDelta.append(" " + avgDelta); - } - - - if( mTimestamp == null || mUploaderBattery == null|| mStatus == null){ - return; - } - - boolean showStatus = sharedPrefs.getBoolean("showExternalStatus", true); - - if(showStatus){ - //use short forms - mTimestamp.setText(readingAge(true)); - mUploaderBattery.setText("U: " + batteryString + "%"); - } else { - mTimestamp.setText(readingAge(false)); - mUploaderBattery.setText("Uploader: " + batteryString + "%"); - } - - - if (showStatus) { - mStatus.setVisibility(View.VISIBLE); - mStatus.setText("S: " + externalStatusString); - } else { - mStatus.setVisibility(View.GONE); + if (mDate != null && mDay != null && mMonth != null) { + if (sharedPrefs.getBoolean("show_date", false)) { + Date today = new Date(); + SimpleDateFormat sdfDay = new SimpleDateFormat("dd"); + SimpleDateFormat sdfMonth = new SimpleDateFormat("MMM"); + mDay.setText(sdfDay.format(today)); + mMonth.setText(sdfMonth.format(today)); + mDate.setVisibility(View.VISIBLE); + } else { + mDate.setVisibility(View.GONE); + } } } @@ -327,6 +504,18 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen } } + public void strikeThroughSgvIfNeeded() { + if (mSgv !=null) { + if (sharedPrefs.getBoolean("showBG", true)) { + if (ageLevel() <= 0) { + mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); + } else { + mSgv.setPaintFlags(mSgv.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); + } + } + } + } + protected void onWatchModeChanged(WatchMode watchMode) { if(lowResMode ^ isLowRes(watchMode)){ //if there was a change in lowResMode @@ -339,25 +528,22 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen } private boolean isLowRes(WatchMode watchMode) { - return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN) || (watchMode == WatchMode.LOW_BIT_BURN_IN); + return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN); // || (watchMode == WatchMode.LOW_BIT_BURN_IN); } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key){ - setColor(); + if(layoutSet){ - showAgoRawBattStatus(); - mRelativeLayout.measure(specW, specH); - mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), - mRelativeLayout.getMeasuredHeight()); + setDataFields(); } invalidate(); } -protected abstract void setColorDark(); + + protected abstract void setColorDark(); protected abstract void setColorBright(); protected abstract void setColorLowRes(); - public void missedReadingAlert() { int minutes_since = (int) Math.floor(timeSince()/(1000*60)); if(minutes_since >= 16 && ((minutes_since - 16) % 5) == 0) { diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java new file mode 100644 index 0000000000..a275752cf9 --- /dev/null +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java @@ -0,0 +1,126 @@ +package info.nightscout.androidaps.watchfaces; + +import android.content.Intent; +import android.support.wearable.watchface.WatchFaceStyle; +import android.view.LayoutInflater; +import android.view.View; + +import info.nightscout.androidaps.R; +import info.nightscout.androidaps.interaction.menus.MainMenuActivity; + +/** + * Created by andrew-warrington on 18/11/2017. + */ + +public class Cockpit extends BaseWatchFace { + + private long sgvTapTime = 0; + + @Override + public void onCreate() { + super.onCreate(); + LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); + layoutView = inflater.inflate(R.layout.activity_cockpit, null); + performViewSetup(); + } + + @Override + protected void onTapCommand(int tapType, int x, int y, long eventTime) { + + if (mSgv != null) { + + int extra = (mSgv.getRight() - mSgv.getLeft()) / 2; + if (tapType == TAP_TYPE_TAP && + x + extra >= mSgv.getLeft() && + x - extra <= mSgv.getRight() && + y >= mSgv.getTop() && + y <= mSgv.getBottom()) { + if (eventTime - sgvTapTime < 800) { + Intent intent = new Intent(this, MainMenuActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + } + sgvTapTime = eventTime; + } + } + } + + @Override + protected WatchFaceStyle getWatchFaceStyle() { + return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); + } + + protected void setColorDark() { + + mRelativeLayout.setBackgroundResource(R.drawable.airplane_cockpit_outside_clouds); + setTextSizes(); + + if (mHighLight != null && mLowLight != null) { + if (sgvLevel == 1) { + mHighLight.setBackgroundResource(R.drawable.airplane_led_yellow_lit); + mLowLight.setBackgroundResource(R.drawable.airplane_led_grey_unlit); + } else if (sgvLevel == 0) { + mHighLight.setBackgroundResource(R.drawable.airplane_led_grey_unlit); + mLowLight.setBackgroundResource(R.drawable.airplane_led_grey_unlit); + } else if (sgvLevel == -1) { + mHighLight.setBackgroundResource(R.drawable.airplane_led_grey_unlit); + mLowLight.setBackgroundResource(R.drawable.airplane_led_red_lit); + } + } + + if (loopLevel == 1) { + mLoop.setBackgroundResource(R.drawable.loop_green_25); + } else { + mLoop.setBackgroundResource(R.drawable.loop_red_25); + } + + invalidate(); + + } + + protected void setColorLowRes() { + mRelativeLayout.setBackgroundResource(R.drawable.airplane_cockpit_outside_clouds_lowres); + + } + + protected void setColorBright() { + setColorDark(); + } + + protected void setTextSizes() { + + if (mIOB2 != null) { + if (detailedIOB) { + if (bIsRound) { + mIOB2.setTextSize(10); + } else { + mIOB2.setTextSize(9); + } + } else { + if (bIsRound) { + mIOB2.setTextSize(13); + } else { + mIOB2.setTextSize(12); + } + } + } + + if ((mUploaderBattery.getVisibility() != View.GONE) && (mRigBattery.getVisibility() != View.GONE)) { + if (bIsRound) { + mUploaderBattery.setTextSize(12); + mRigBattery.setTextSize(12); + } else { + mUploaderBattery.setTextSize(10); + mRigBattery.setTextSize(10); + } + } else { + if (bIsRound) { + mUploaderBattery.setTextSize(13); + mRigBattery.setTextSize(13); + } else { + mUploaderBattery.setTextSize(12); + mRigBattery.setTextSize(12); + } + } + } +} \ No newline at end of file diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java new file mode 100644 index 0000000000..367b93a729 --- /dev/null +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java @@ -0,0 +1,241 @@ +package info.nightscout.androidaps.watchfaces; + +import android.content.Intent; +import android.graphics.Color; +import android.support.v4.content.ContextCompat; +import android.support.wearable.watchface.WatchFaceStyle; +import android.view.LayoutInflater; + +import com.ustwo.clockwise.common.WatchMode; + +import info.nightscout.androidaps.R; +import info.nightscout.androidaps.interaction.menus.MainMenuActivity; + +public class Home2 extends BaseWatchFace { + + private long chartTapTime = 0; + private long sgvTapTime = 0; + + @Override + public void onCreate() { + super.onCreate(); + LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); + layoutView = inflater.inflate(R.layout.activity_home_2, null); + performViewSetup(); + } + + @Override + protected void onTapCommand(int tapType, int x, int y, long eventTime) { + + int extra = mSgv!=null?(mSgv.getRight() - mSgv.getLeft())/2:0; + + if (tapType == TAP_TYPE_TAP&& + x >=chart.getLeft() && + x <= chart.getRight()&& + y >= chart.getTop() && + y <= chart.getBottom()){ + if (eventTime - chartTapTime < 800){ + changeChartTimeframe(); + } + chartTapTime = eventTime; + } else if (tapType == TAP_TYPE_TAP&& + x + extra >=mSgv.getLeft() && + x - extra <= mSgv.getRight()&& + y >= mSgv.getTop() && + y <= mSgv.getBottom()){ + if (eventTime - sgvTapTime < 800){ + Intent intent = new Intent(this, MainMenuActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); + } + sgvTapTime = eventTime; + } + } + + private void changeChartTimeframe() { + int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3")); + timeframe = (timeframe%5) + 1; + sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit(); + } + + @Override + protected WatchFaceStyle getWatchFaceStyle(){ + return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); + } + + protected void setColorDark() { + mLinearLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_statusView)); + mLinearLayout2.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background)); + mRelativeLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background)); + mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mIOB1.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mIOB2.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mCOB1.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mCOB2.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mDay.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mMonth.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mLoop.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + + setTextSizes(); + + if (sgvLevel == 1) { + mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_highColor)); + mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_highColor)); + } else if (sgvLevel == 0) { + mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + } else if (sgvLevel == -1) { + mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_lowColor)); + mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_lowColor)); + } + + if (ageLevel == 1) { + mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + } else { + mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_TimestampOld)); + } + + if (batteryLevel == 1) { + mUploaderBattery.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_uploaderBattery)); + } else { + mUploaderBattery.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_uploaderBatteryEmpty)); + } + mRigBattery.setTextColor(Color.BLACK); + mDelta.setTextColor(Color.BLACK); + mAvgDelta.setTextColor(Color.BLACK); + mBasalRate.setTextColor(Color.BLACK); + mBgi.setTextColor(Color.BLACK); + + if (loopLevel == 1) { + mLoop.setBackgroundResource(R.drawable.loop_green_25); + } else { + mLoop.setBackgroundResource(R.drawable.loop_red_25); + } + + if (chart != null) { + highColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_highColor); + lowColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_lowColor); + midColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor); + gridColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_gridColor); + basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark); + basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light); + pointSize = 2; + setupCharts(); + } + } + + protected void setColorLowRes() { + mLinearLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_statusView)); + mLinearLayout2.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background)); + mRelativeLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background)); + mLoop.setBackgroundResource(R.drawable.loop_grey_25); + mLoop.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_Timestamp)); + mDelta.setTextColor(Color.BLACK); + mAvgDelta.setTextColor(Color.BLACK); + mRigBattery.setTextColor(Color.BLACK); + mUploaderBattery.setTextColor(Color.BLACK); + mBasalRate.setTextColor(Color.BLACK); + mBgi.setTextColor(Color.BLACK); + mIOB1.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mIOB2.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mCOB1.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mCOB2.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mDay.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mMonth.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTime)); + if (chart != null) { + highColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor); + lowColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor); + midColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor); + gridColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_gridColor); + basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark_lowres); + basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light_lowres); + pointSize = 2; + setupCharts(); + } + setTextSizes(); + } + + protected void setColorBright() { + + if (getCurrentWatchMode() == WatchMode.INTERACTIVE) { + mLinearLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.light_stripe_background)); + mLinearLayout2.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.light_background)); + mRelativeLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.light_background)); + mTime.setTextColor(Color.BLACK); + mIOB1.setTextColor(Color.BLACK); + mIOB2.setTextColor(Color.BLACK); + mCOB1.setTextColor(Color.BLACK); + mCOB2.setTextColor(Color.BLACK); + mDay.setTextColor(Color.BLACK); + mMonth.setTextColor(Color.BLACK); + mLoop.setTextColor(Color.BLACK); + + setTextSizes(); + + if (sgvLevel == 1) { + mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.light_highColor)); + mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.light_highColor)); + } else if (sgvLevel == 0) { + mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.light_midColor)); + mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.light_midColor)); + } else if (sgvLevel == -1) { + mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.light_lowColor)); + mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.light_lowColor)); + } + + if (ageLevel == 1) { + mTimestamp.setTextColor(Color.BLACK); + } else { + mTimestamp.setTextColor(Color.RED); + } + + if (batteryLevel == 1) { + mUploaderBattery.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + } else { + mUploaderBattery.setTextColor(Color.RED); + } + mRigBattery.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mDelta.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mAvgDelta.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mBasalRate.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + mBgi.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor)); + + if (loopLevel == 1) { + mLoop.setBackgroundResource(R.drawable.loop_green_25); + } else { + mLoop.setBackgroundResource(R.drawable.loop_red_25); + } + + if (chart != null) { + highColor = ContextCompat.getColor(getApplicationContext(), R.color.light_highColor); + lowColor = ContextCompat.getColor(getApplicationContext(), R.color.light_lowColor); + midColor = ContextCompat.getColor(getApplicationContext(), R.color.light_midColor); + gridColor = ContextCompat.getColor(getApplicationContext(), R.color.light_gridColor); + basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light); + basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark); + pointSize = 2; + setupCharts(); + } + } else { + setColorDark(); + } + } + + protected void setTextSizes() { + + if (mIOB1 != null && mIOB2 != null) { + + if (detailedIOB) { + mIOB1.setTextSize(14); + mIOB2.setTextSize(10); + } else { + mIOB1.setTextSize(10); + mIOB2.setTextSize(14); + } + } + } +} diff --git a/wear/src/main/res/drawable/airplane_cockpit.png b/wear/src/main/res/drawable/airplane_cockpit.png new file mode 100644 index 0000000000..84da13abc7 Binary files /dev/null and b/wear/src/main/res/drawable/airplane_cockpit.png differ diff --git a/wear/src/main/res/drawable/airplane_cockpit_outside_clouds.png b/wear/src/main/res/drawable/airplane_cockpit_outside_clouds.png new file mode 100644 index 0000000000..dca7e49079 Binary files /dev/null and b/wear/src/main/res/drawable/airplane_cockpit_outside_clouds.png differ diff --git a/wear/src/main/res/drawable/airplane_cockpit_outside_clouds_lowres.png b/wear/src/main/res/drawable/airplane_cockpit_outside_clouds_lowres.png new file mode 100644 index 0000000000..e264408816 Binary files /dev/null and b/wear/src/main/res/drawable/airplane_cockpit_outside_clouds_lowres.png differ diff --git a/wear/src/main/res/drawable/airplane_led_grey_unlit.png b/wear/src/main/res/drawable/airplane_led_grey_unlit.png new file mode 100644 index 0000000000..614510d717 Binary files /dev/null and b/wear/src/main/res/drawable/airplane_led_grey_unlit.png differ diff --git a/wear/src/main/res/drawable/airplane_led_red_lit.png b/wear/src/main/res/drawable/airplane_led_red_lit.png new file mode 100644 index 0000000000..9f4d98073d Binary files /dev/null and b/wear/src/main/res/drawable/airplane_led_red_lit.png differ diff --git a/wear/src/main/res/drawable/airplane_led_yellow_lit.png b/wear/src/main/res/drawable/airplane_led_yellow_lit.png new file mode 100644 index 0000000000..cca76f6b2a Binary files /dev/null and b/wear/src/main/res/drawable/airplane_led_yellow_lit.png differ diff --git a/wear/src/main/res/drawable/loop_green_25.png b/wear/src/main/res/drawable/loop_green_25.png new file mode 100644 index 0000000000..37076d5577 Binary files /dev/null and b/wear/src/main/res/drawable/loop_green_25.png differ diff --git a/wear/src/main/res/drawable/loop_grey_25.png b/wear/src/main/res/drawable/loop_grey_25.png new file mode 100644 index 0000000000..781f68d17d Binary files /dev/null and b/wear/src/main/res/drawable/loop_grey_25.png differ diff --git a/wear/src/main/res/drawable/loop_red_25.png b/wear/src/main/res/drawable/loop_red_25.png new file mode 100644 index 0000000000..e9dcdb0da3 Binary files /dev/null and b/wear/src/main/res/drawable/loop_red_25.png differ diff --git a/wear/src/main/res/drawable/watchface_cockpit.png b/wear/src/main/res/drawable/watchface_cockpit.png new file mode 100644 index 0000000000..88f7bb70a3 Binary files /dev/null and b/wear/src/main/res/drawable/watchface_cockpit.png differ diff --git a/wear/src/main/res/drawable/watchface_graph_2.png b/wear/src/main/res/drawable/watchface_graph_2.png new file mode 100644 index 0000000000..de0aab2d42 Binary files /dev/null and b/wear/src/main/res/drawable/watchface_graph_2.png differ diff --git a/wear/src/main/res/layout/activity_cockpit.xml b/wear/src/main/res/layout/activity_cockpit.xml new file mode 100644 index 0000000000..06c1cd036d --- /dev/null +++ b/wear/src/main/res/layout/activity_cockpit.xml @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/wear/src/main/res/layout/activity_home_2.xml b/wear/src/main/res/layout/activity_home_2.xml new file mode 100644 index 0000000000..1b3dd0be51 --- /dev/null +++ b/wear/src/main/res/layout/activity_home_2.xml @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/wear/src/main/res/layout/rect_activity_home_2.xml b/wear/src/main/res/layout/rect_activity_home_2.xml new file mode 100644 index 0000000000..88f55404bc --- /dev/null +++ b/wear/src/main/res/layout/rect_activity_home_2.xml @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wear/src/main/res/layout/rect_cockpit.xml b/wear/src/main/res/layout/rect_cockpit.xml new file mode 100644 index 0000000000..88bda0917c --- /dev/null +++ b/wear/src/main/res/layout/rect_cockpit.xml @@ -0,0 +1,491 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wear/src/main/res/layout/round_activity_home_2.xml b/wear/src/main/res/layout/round_activity_home_2.xml new file mode 100644 index 0000000000..837dc979e3 --- /dev/null +++ b/wear/src/main/res/layout/round_activity_home_2.xml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wear/src/main/res/layout/round_cockpit.xml b/wear/src/main/res/layout/round_cockpit.xml new file mode 100644 index 0000000000..b2892c20db --- /dev/null +++ b/wear/src/main/res/layout/round_cockpit.xml @@ -0,0 +1,491 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wear/src/main/res/values/strings.xml b/wear/src/main/res/values/strings.xml index 0644100b47..a7f34c08b1 100644 --- a/wear/src/main/res/values/strings.xml +++ b/wear/src/main/res/values/strings.xml @@ -20,8 +20,6 @@ 5 - - Default Quick righty @@ -38,6 +36,7 @@ AAPS + AAPSv2 AAPS(Large) AAPS(BigChart) AAPS(NoChart) diff --git a/wear/src/main/res/xml/preferences.xml b/wear/src/main/res/xml/preferences.xml index 2d97a82931..1846ce4939 100644 --- a/wear/src/main/res/xml/preferences.xml +++ b/wear/src/main/res/xml/preferences.xml @@ -18,26 +18,34 @@ app:wear_iconOff="@drawable/settings_off" app:wear_iconOn="@drawable/settings_on" /> - - + + + + @@ -51,19 +59,47 @@ + + + + + + + + - + + + + +