Inclusion of the new watch face "AAPSv2" which: 1) has larger text, 2) shows COB, 3) allows to choose between showing phone battery level (AAPS) or rig battery level (OpenAPS) via watch Settings menu.
Most changes are either minor or are completely new files. The largest changes were to the WatchUpdaterService.java, which required several new blocks of code in order to expose COB, IOB, and current temp basal independently of the main status string.
This commit is contained in:
parent
d70860bd97
commit
45a26da8b3
11 changed files with 306 additions and 141 deletions
|
@ -246,37 +246,6 @@ public class WatchUpdaterService extends WearableListenerService implements
|
|||
sgvLevel = -1;
|
||||
}
|
||||
|
||||
//IOB
|
||||
MainApp.getConfigBuilder().updateTotalIOBTreatments();
|
||||
MainApp.getConfigBuilder().updateTotalIOBTempBasals();
|
||||
final IobTotal bolusIob = MainApp.getConfigBuilder().getLastCalculationTreatments().round();
|
||||
final IobTotal basalIob = MainApp.getConfigBuilder().getLastCalculationTempBasals().round();
|
||||
String iobText = DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U";
|
||||
|
||||
if (mPrefs.getBoolean("wear_detailediob", true)) {
|
||||
iobText = DecimalFormatter.to2Decimal(bolusIob.iob) + "|"
|
||||
+ DecimalFormatter.to2Decimal(basalIob.basaliob);
|
||||
}
|
||||
|
||||
//COB
|
||||
String cobText = "0g";
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
|
||||
if (autosensData != null) {
|
||||
cobText = (int) autosensData.cob + "g";
|
||||
}
|
||||
|
||||
//battery
|
||||
int phoneBattery = getBatteryLevel(getApplicationContext());
|
||||
String rigBattery = NSDeviceStatus.getInstance().getUploaderStatus().trim();
|
||||
|
||||
//Temp basal
|
||||
String temp_basal = "-.--U/h";
|
||||
TreatmentsInterface treatmentsInterface = MainApp.getConfigBuilder();
|
||||
TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis());
|
||||
if (activeTemp != null) {
|
||||
temp_basal= activeTemp.toStringShort();
|
||||
}
|
||||
|
||||
DataMap dataMap = new DataMap();
|
||||
dataMap.putString("sgvString", lastBG.valueToUnitsToString(units));
|
||||
dataMap.putDouble("timestamp", lastBG.date);
|
||||
|
@ -289,16 +258,11 @@ public class WatchUpdaterService extends WearableListenerService implements
|
|||
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.putLong("sgvLevel", sgvLevel);
|
||||
dataMap.putString("battery", "" + phoneBattery);
|
||||
dataMap.putString("rigBattery", rigBattery);
|
||||
dataMap.putInt("batteryLevel", (phoneBattery >= 30) ? 1 : 0);
|
||||
dataMap.putDouble("sgvDouble", lastBG.value);
|
||||
dataMap.putDouble("high", highLine);
|
||||
dataMap.putDouble("low", lowLine);
|
||||
dataMap.putString("cob", "" + cobText);
|
||||
dataMap.putString("iob", "" + iobText);
|
||||
dataMap.putString("tempBasal", "" + temp_basal);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
@ -552,14 +516,54 @@ 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 iobTotal = DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob);
|
||||
String iobDetail = "(" + DecimalFormatter.to2Decimal(bolusIob.iob) + "|" + DecimalFormatter.to2Decimal(basalIob.basaliob) + ")";
|
||||
String iobString = iobTotal + " " + iobDetail; //for generateStatusString()
|
||||
String cobString = generateCOBString();
|
||||
String tempBasal = generateBasalString(treatmentsInterface);
|
||||
String status = generateStatusString(iobString,tempBasal,bolusIob,basalIob);
|
||||
|
||||
//batteries
|
||||
int phoneBattery = getBatteryLevel(getApplicationContext());
|
||||
String rigBattery = NSDeviceStatus.getInstance().getUploaderStatus().trim();
|
||||
|
||||
//OpenAPS status
|
||||
String openApsString = String.valueOf(NSDeviceStatus.getInstance().getOpenApsStatus());
|
||||
String openApsStatus = openApsString.substring(0,openApsString.indexOf("m"));
|
||||
|
||||
PutDataMapRequest dataMapRequest = PutDataMapRequest.create(NEW_STATUS_PATH);
|
||||
//unique content
|
||||
dataMapRequest.getDataMap().putDouble("timestamp", System.currentTimeMillis());
|
||||
//Log.e("SendStatus", "timestamp is " + System.currentTimeMillis());
|
||||
dataMapRequest.getDataMap().putString("externalStatusString", status);
|
||||
//Log.e("SendStatus", "externalStatusString is " + status);
|
||||
dataMapRequest.getDataMap().putString("iobTotal", iobTotal);
|
||||
//Log.e("SendStatus", "iobTotal is " + iobTotal);
|
||||
dataMapRequest.getDataMap().putString("iobDetail", iobDetail);
|
||||
//Log.e("SendStatus", "iobDetail is " + iobDetail);
|
||||
dataMapRequest.getDataMap().putBoolean("detailedIob", mPrefs.getBoolean("wear_detailediob", false));
|
||||
//Log.e("SendStatus", "cob is " + cobString);
|
||||
dataMapRequest.getDataMap().putString("cob", cobString);
|
||||
//Log.e("SendStatus", "cob is " + cobString);
|
||||
dataMapRequest.getDataMap().putString("tempBasal", tempBasal);
|
||||
//Log.e("SendStatus", "tempBasal is " + tempBasal);
|
||||
dataMapRequest.getDataMap().putString("battery", "" + phoneBattery);
|
||||
//Log.e("SendStatus", "battery is " + phoneBattery);
|
||||
dataMapRequest.getDataMap().putString("rigBattery", rigBattery);
|
||||
//Log.e("SendStatus", "rigBattery is " + rigBattery);
|
||||
dataMapRequest.getDataMap().putString("openApsStatus", openApsStatus);
|
||||
//Log.e("SendStatus", "openApsStatus is " + openApsStatus);
|
||||
dataMapRequest.getDataMap().putInt("batteryLevel", (phoneBattery >= 30) ? 1 : 0);
|
||||
//Log.e("SendStatus", "batteryLevel is " + ((phoneBattery >= 30) ? 1 : 0));
|
||||
PutDataRequest putDataRequest = dataMapRequest.asPutDataRequest();
|
||||
Wearable.DataApi.putDataItem(googleApiClient, putDataRequest);
|
||||
} else {
|
||||
|
@ -584,7 +588,8 @@ public class WatchUpdaterService extends WearableListenerService implements
|
|||
}
|
||||
|
||||
@NonNull
|
||||
private String generateStatusString() {
|
||||
private String generateStatusString(String iobString, String tempBasal, IobTotal bolusIob, IobTotal basalIob) {
|
||||
|
||||
String status = "";
|
||||
|
||||
Profile profile = MainApp.getConfigBuilder().getProfile();
|
||||
|
@ -602,38 +607,40 @@ public class WatchUpdaterService extends WearableListenerService implements
|
|||
lastLoopStatus = true;
|
||||
}
|
||||
|
||||
//Temp basal
|
||||
TreatmentsInterface treatmentsInterface = MainApp.getConfigBuilder();
|
||||
status += tempBasal + " " + iobString;
|
||||
|
||||
TemporaryBasal activeTemp = treatmentsInterface.getTempBasalFromHistory(System.currentTimeMillis());
|
||||
if (activeTemp != null) {
|
||||
status += activeTemp.toStringShort();
|
||||
|
||||
}
|
||||
|
||||
//IOB
|
||||
treatmentsInterface.updateTotalIOBTreatments();
|
||||
IobTotal bolusIob = treatmentsInterface.getLastCalculationTreatments().round();
|
||||
treatmentsInterface.updateTotalIOBTempBasals();
|
||||
IobTotal basalIob = treatmentsInterface.getLastCalculationTempBasals().round();
|
||||
status += DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob);
|
||||
|
||||
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)) {
|
||||
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()) {
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.ustwo.clockwise.wearable.WatchFace;
|
|||
import com.ustwo.clockwise.common.WatchFaceTime;
|
||||
import com.ustwo.clockwise.common.WatchShape;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -48,12 +49,13 @@ import lecho.lib.hellocharts.view.LineChartView;
|
|||
public abstract class BaseWatchFace2 extends WatchFace implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
public final static IntentFilter INTENT_FILTER;
|
||||
public static final long[] vibratePattern = {0,400,300,400,300,400};
|
||||
public TextView mTime, mSgv, mDirection, mTimestamp, mUploaderBattery, mDelta, mStatus, mIOB, mCOB;
|
||||
public TextView mTime, mSgv, mDirection, mTimestamp, mUploaderBattery, mRigBattery, mDelta, mStatus, mIOB1, mIOB2, mCOB, mLoop, mDay, mMonth;
|
||||
public RelativeLayout mRelativeLayout;
|
||||
public LinearLayout mLinearLayout, mLinearLayout2;
|
||||
public LinearLayout mLinearLayout, mLinearLayout2, mDate;
|
||||
public long sgvLevel = 0;
|
||||
public int batteryLevel = 1;
|
||||
public int ageLevel = 1;
|
||||
public int loopLevel = 1;
|
||||
public int highColor = Color.YELLOW;
|
||||
public int lowColor = Color.RED;
|
||||
public int midColor = Color.WHITE;
|
||||
|
@ -80,13 +82,7 @@ public abstract class BaseWatchFace2 extends WatchFace implements SharedPrefere
|
|||
private MessageReceiver messageReceiver;
|
||||
|
||||
protected SharedPreferences sharedPrefs;
|
||||
private String avgDelta = "";
|
||||
private String delta = "";
|
||||
private String sgvString = "--";
|
||||
//private String batteryString = "--%"; --- replaced with local variable
|
||||
//private String IOB = "--U"; --- not used
|
||||
//private String COB = "--g"; --- not used
|
||||
|
||||
private String openApsStatus = "--";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
|
@ -123,17 +119,23 @@ public abstract class BaseWatchFace2 extends WatchFace implements SharedPrefere
|
|||
@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);
|
||||
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);
|
||||
mIOB = (TextView) stub.findViewById(R.id.iobView);
|
||||
mIOB1 = (TextView) stub.findViewById(R.id.iob_text);
|
||||
mIOB2 = (TextView) stub.findViewById(R.id.iobView);
|
||||
mCOB = (TextView) stub.findViewById(R.id.cobView);
|
||||
mStatus = (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);
|
||||
mRelativeLayout = (RelativeLayout) stub.findViewById(R.id.main_layout);
|
||||
mLinearLayout = (LinearLayout) stub.findViewById(R.id.secondary_layout);
|
||||
mLinearLayout2 = (LinearLayout) stub.findViewById(R.id.tertiary_layout);
|
||||
mDate = (LinearLayout) stub.findViewById(R.id.date_time);
|
||||
chart = (LineChartView) stub.findViewById(R.id.chart);
|
||||
layoutSet = true;
|
||||
mRelativeLayout.measure(specW, specH);
|
||||
|
@ -158,12 +160,12 @@ public abstract class BaseWatchFace2 extends WatchFace implements SharedPrefere
|
|||
}
|
||||
|
||||
public String readingAge(boolean shortString) {
|
||||
if (datetime == 0) { return "--' ago"; }
|
||||
if (datetime == 0) { return shortString?"--'":"-- Minute ago"; }
|
||||
int minutesAgo = (int) Math.floor(timeSince()/(1000*60));
|
||||
//if (minutesAgo == 1) {
|
||||
// return minutesAgo + "' ago";
|
||||
//}
|
||||
return minutesAgo + "' ago";
|
||||
if (minutesAgo == 1) {
|
||||
return minutesAgo + (shortString?"'":" Minute ago");
|
||||
}
|
||||
return minutesAgo + (shortString?"'":" Minutes ago");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -199,6 +201,19 @@ public abstract class BaseWatchFace2 extends WatchFace implements SharedPrefere
|
|||
mTime.setText(timeFormat.format(System.currentTimeMillis()));
|
||||
mTimestamp.setText(readingAge(true));
|
||||
|
||||
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 {
|
||||
//mDay.setText("");
|
||||
//mMonth.setText("");
|
||||
mDate.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(ageLevel()<=0) {
|
||||
mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
} else {
|
||||
|
@ -222,20 +237,8 @@ public abstract class BaseWatchFace2 extends WatchFace implements SharedPrefere
|
|||
DataMap dataMap = DataMap.fromBundle(bundle);
|
||||
wakeLock.acquire(50);
|
||||
sgvLevel = dataMap.getLong("sgvLevel");
|
||||
batteryLevel = dataMap.getInt("batteryLevel");
|
||||
datetime = dataMap.getDouble("timestamp");
|
||||
sgvString = dataMap.getString("sgvString");
|
||||
mSgv.setText(dataMap.getString("sgvString"));
|
||||
mIOB.setText(dataMap.getString("iob"));
|
||||
mCOB.setText(dataMap.getString("cob"));
|
||||
|
||||
String batteryString;
|
||||
if (Boolean.valueOf(sharedPrefs.getString("battery_choice","true"))) {
|
||||
batteryString = dataMap.getString("battery") + "%";
|
||||
} else {
|
||||
batteryString = dataMap.getString("rigBattery");
|
||||
}
|
||||
mUploaderBattery.setText("" + batteryString);
|
||||
|
||||
if(ageLevel()<=0) {
|
||||
mSgv.setPaintFlags(mSgv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
|
||||
|
@ -247,21 +250,21 @@ public abstract class BaseWatchFace2 extends WatchFace implements SharedPrefere
|
|||
mTime.setText(timeFormat.format(System.currentTimeMillis()));
|
||||
|
||||
mDirection.setText(dataMap.getString("slopeArrow"));
|
||||
avgDelta = dataMap.getString("avgDelta");
|
||||
delta = dataMap.getString("delta");
|
||||
String avgDelta = dataMap.getString("avgDelta");
|
||||
String delta = dataMap.getString("delta");
|
||||
|
||||
if (sharedPrefs.getBoolean("showDelta", true)) {
|
||||
mDelta.setText(delta);
|
||||
mDelta.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mDelta.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
mDelta.setText(delta);
|
||||
boolean showAvgDelta = sharedPrefs.getBoolean("showAvgDelta", true);
|
||||
if(showAvgDelta){
|
||||
mDelta.append(" " + avgDelta);
|
||||
}
|
||||
|
||||
if (mTimestamp != null && mStatus != null) {
|
||||
mTimestamp.setText(readingAge(true));
|
||||
mStatus.setVisibility(View.VISIBLE);
|
||||
mStatus.setText("" + dataMap.getString("tempBasal"));
|
||||
}
|
||||
|
||||
if (chart != null) {
|
||||
addToWatchSet(dataMap);
|
||||
setupCharts();
|
||||
|
@ -273,6 +276,89 @@ public abstract class BaseWatchFace2 extends WatchFace implements SharedPrefere
|
|||
setColor();
|
||||
}
|
||||
|
||||
//status
|
||||
bundle = intent.getBundleExtra("status");
|
||||
if (layoutSet && bundle != null) {
|
||||
DataMap dataMap = DataMap.fromBundle(bundle);
|
||||
wakeLock.acquire(50);
|
||||
///externalStatusString = dataMap.getString("externalStatusString");
|
||||
batteryLevel = dataMap.getInt("batteryLevel");
|
||||
openApsStatus = dataMap.getString("openApsStatus");
|
||||
mCOB.setText(dataMap.getString("cob"));
|
||||
|
||||
if (dataMap.getBoolean("detailedIob")) {
|
||||
mIOB1.setTextSize(14);
|
||||
mIOB2.setTextSize(10);
|
||||
mIOB1.setText("IOB " + dataMap.getString("iobTotal"));
|
||||
mIOB2.setText(dataMap.getString("iobDetail"));
|
||||
} else {
|
||||
mIOB1.setTextSize(10);
|
||||
mIOB2.setTextSize(14);
|
||||
mIOB1.setText("IOB");
|
||||
mIOB2.setText(dataMap.getString("iobTotal"));
|
||||
}
|
||||
|
||||
|
||||
//use Config.APS to determine mode?
|
||||
if (sharedPrefs.getBoolean("show_uploader_battery", true)) {
|
||||
mUploaderBattery.setText(dataMap.getString("battery") + "%");
|
||||
mUploaderBattery.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mUploaderBattery.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (sharedPrefs.getBoolean("show_rig_battery", false)) {
|
||||
mRigBattery.setText(dataMap.getString("rigBattery"));
|
||||
mRigBattery.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mRigBattery.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (mTimestamp != null) {
|
||||
if (sharedPrefs.getBoolean("showAgo", true)) {
|
||||
mTimestamp.setText(readingAge(true));
|
||||
mTimestamp.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mTimestamp.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (mStatus != null) {
|
||||
mStatus.setVisibility(View.VISIBLE);
|
||||
mStatus.setText("" + dataMap.getString("tempBasal"));
|
||||
}
|
||||
|
||||
if (mLoop != null) {
|
||||
if (sharedPrefs.getBoolean("showExternalStatus", true)) {
|
||||
mLoop.setVisibility(View.VISIBLE);
|
||||
String loopTime = dataMap.getString("openApsStatus");
|
||||
if (loopTime != null && loopTime != "") {
|
||||
mLoop.setText(loopTime + "'");
|
||||
if (Integer.valueOf(loopTime) > 14) {
|
||||
loopLevel = 0;
|
||||
mLoop.setBackgroundResource(R.drawable.loop_red_25);
|
||||
} else {
|
||||
loopLevel = 1;
|
||||
mLoop.setBackgroundResource(R.drawable.loop_green_25);
|
||||
}
|
||||
} else {
|
||||
mLoop.setText("-'");
|
||||
}
|
||||
} else {
|
||||
//mLoop.setText("");
|
||||
//mLoop.setBackgroundResource(R.drawable.empty);
|
||||
mLoop.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
mRelativeLayout.measure(specW, specH);
|
||||
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
|
||||
mRelativeLayout.getMeasuredHeight());
|
||||
invalidate();
|
||||
setColor();
|
||||
}
|
||||
|
||||
|
||||
//basals and temps
|
||||
bundle = intent.getBundleExtra("basals");
|
||||
if (layoutSet && bundle != null) {
|
||||
|
|
|
@ -94,6 +94,12 @@ public class Home2 extends BaseWatchFace2 {
|
|||
mUploaderBattery.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_uploaderBatteryEmpty));
|
||||
}
|
||||
|
||||
if (loopLevel == 1) {
|
||||
mLoop.setBackgroundResource(R.drawable.loop_green_25);
|
||||
} else {
|
||||
mLoop.setBackgroundResource(R.drawable.loop_red_25);
|
||||
}
|
||||
|
||||
mStatus.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mStatus_home));
|
||||
|
||||
if (chart != null) {
|
||||
|
@ -110,6 +116,7 @@ public class Home2 extends BaseWatchFace2 {
|
|||
|
||||
protected void setColorLowRes() {
|
||||
mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTime));
|
||||
mLoop.setBackgroundResource(R.drawable.loop_grey_25);
|
||||
mRelativeLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background));
|
||||
mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor));
|
||||
mDirection.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor));
|
||||
|
|
BIN
wear/src/main/res/drawable/empty.png
Normal file
BIN
wear/src/main/res/drawable/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
wear/src/main/res/drawable/loop_green_25.png
Normal file
BIN
wear/src/main/res/drawable/loop_green_25.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
wear/src/main/res/drawable/loop_grey_25.png
Normal file
BIN
wear/src/main/res/drawable/loop_grey_25.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
wear/src/main/res/drawable/loop_red_25.png
Normal file
BIN
wear/src/main/res/drawable/loop_red_25.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 475 KiB |
|
@ -23,40 +23,56 @@
|
|||
android:gravity="center_horizontal"
|
||||
android:layout_marginTop="-5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:background="@drawable/loop_grey_25"
|
||||
android:gravity="center|right"
|
||||
android:paddingRight="7dp"
|
||||
android:paddingTop="-2dp"
|
||||
android:text="--'"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sgv"
|
||||
android:textSize="41sp"
|
||||
android:textSize="38sp"
|
||||
android:text="---"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFF"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:gravity="bottom|right"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_marginBottom="-2dp"
|
||||
android:paddingTop="-2dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:weightSum="1"
|
||||
android:textAlignment="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:baselineAligned="false"
|
||||
android:layout_gravity="center_horizontal">
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:textAlignment="center"
|
||||
android:weightSum="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/direction"
|
||||
android:textSize="30sp"
|
||||
android:text="--"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textAlignment="center"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="-5dp"
|
||||
android:layout_marginTop="-2dp"
|
||||
android:text="--"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
|
@ -64,8 +80,11 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:text="--' ago"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingStart="6dp"
|
||||
android:text="--'"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
@ -110,6 +129,17 @@
|
|||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rig_battery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10sp"
|
||||
android:text="--%"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#000000"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tmpBasal"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -182,6 +212,38 @@
|
|||
android:textColor="#FFFFFF"
|
||||
android:textSize="30sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/date_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="2sp"
|
||||
android:textAlignment="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/day"
|
||||
android:layout_width="23dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="day"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/month"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="mth"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -20,16 +20,6 @@
|
|||
<item>5</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="battery_choice">
|
||||
<item>Phone</item>
|
||||
<item>Rig</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="battery_choice_values">
|
||||
<item>true</item>
|
||||
<item>false</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="input_design">
|
||||
<item>Default</item>
|
||||
<item>Quick righty</item>
|
||||
|
|
|
@ -26,13 +26,26 @@
|
|||
android:summary="Input Design"
|
||||
android:title="Input Design" />
|
||||
|
||||
<ListPreference
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:entries="@array/battery_choice"
|
||||
android:entryValues="@array/battery_choice_values"
|
||||
android:key="battery_choice"
|
||||
android:summary="Battery Display"
|
||||
android:title="Battery Display" />
|
||||
android:key="show_uploader_battery"
|
||||
android:title="Show Phone Battery"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="show_rig_battery"
|
||||
android:title="Show Rig Battery"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="show_date"
|
||||
android:title="Show Date"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
|
@ -49,6 +62,14 @@
|
|||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="showDelta"
|
||||
android:summary="Show delta. (Circle WF)"
|
||||
android:title="Show Delta"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="showAvgDelta"
|
||||
|
@ -57,6 +78,14 @@
|
|||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="showAgo"
|
||||
android:summary="Minutes since last reading. (Circle WF)"
|
||||
android:title="Show Ago"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="dark"
|
||||
|
@ -73,22 +102,6 @@
|
|||
android:summary="Chart Timeframe"
|
||||
android:title="Chart Timeframe" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="showAgo"
|
||||
android:summary="Minutes since last reading. (Circle WF)"
|
||||
android:title="Show Ago"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="showDelta"
|
||||
android:summary="Show delta. (Circle WF)"
|
||||
android:title="Show Delta"
|
||||
app:wear_iconOff="@drawable/settings_off"
|
||||
app:wear_iconOn="@drawable/settings_on"/>
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="showBG"
|
||||
|
|
Loading…
Reference in a new issue