wear low bit mode
This commit is contained in:
parent
299e235f4b
commit
736c87a9cc
6 changed files with 97 additions and 50 deletions
|
@ -31,7 +31,6 @@ import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.google.android.gms.wearable.DataMap;
|
import com.google.android.gms.wearable.DataMap;
|
||||||
import com.ustwo.clockwise.common.util.Logr;
|
|
||||||
import com.ustwo.clockwise.wearable.WatchFace;
|
import com.ustwo.clockwise.wearable.WatchFace;
|
||||||
import com.ustwo.clockwise.common.WatchFaceTime;
|
import com.ustwo.clockwise.common.WatchFaceTime;
|
||||||
import com.ustwo.clockwise.common.WatchMode;
|
import com.ustwo.clockwise.common.WatchMode;
|
||||||
|
@ -59,7 +58,7 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
public int basalBackgroundColor = Color.BLUE;
|
public int basalBackgroundColor = Color.BLUE;
|
||||||
public int basalCenterColor = Color.BLUE;
|
public int basalCenterColor = Color.BLUE;
|
||||||
public int pointSize = 2;
|
public int pointSize = 2;
|
||||||
public boolean singleLine = false;
|
public boolean lowResMode = false;
|
||||||
public boolean layoutSet = false;
|
public boolean layoutSet = false;
|
||||||
public BgGraphBuilder bgGraphBuilder;
|
public BgGraphBuilder bgGraphBuilder;
|
||||||
public LineChartView chart;
|
public LineChartView chart;
|
||||||
|
@ -163,13 +162,18 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onWatchModeChanged(WatchMode watchMode) {
|
protected void onWatchModeChanged(WatchMode watchMode) {
|
||||||
if (! sharedPrefs.getBoolean("dark", true)){
|
|
||||||
|
if(lowResMode ^ isLowRes(watchMode)){ //if there was a change in lowResMode
|
||||||
|
lowResMode = isLowRes(watchMode);
|
||||||
|
setColor();
|
||||||
|
} else if (! sharedPrefs.getBoolean("dark", true)){
|
||||||
//in bright mode: different colours if active:
|
//in bright mode: different colours if active:
|
||||||
setColor();
|
setColor();
|
||||||
} else {
|
|
||||||
//TODO: Handle low bit ambient
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isLowRes(WatchMode watchMode) {
|
||||||
|
return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN) || (watchMode == WatchMode.LOW_BIT_BURN_IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -306,7 +310,7 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
|
|
||||||
//start animation?
|
//start animation?
|
||||||
// dataMap.getDataMapArrayList("entries") == null -> not on "resend data".
|
// dataMap.getDataMapArrayList("entries") == null -> not on "resend data".
|
||||||
if (sharedPrefs.getBoolean("animation", false) && dataMap.getDataMapArrayList("entries") == null && (sgvString.equals("100") || sgvString.equals("5.5") || sgvString.equals("5,5"))) {
|
if (!lowResMode && (sharedPrefs.getBoolean("animation", false) && dataMap.getDataMapArrayList("entries") == null && (sgvString.equals("100") || sgvString.equals("5.5") || sgvString.equals("5,5")))) {
|
||||||
startAnimation();
|
startAnimation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -393,7 +397,9 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setColor() {
|
public void setColor() {
|
||||||
if (sharedPrefs.getBoolean("dark", true)) {
|
if(lowResMode){
|
||||||
|
setColorLowRes();
|
||||||
|
} else if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
setColorDark();
|
setColorDark();
|
||||||
} else {
|
} else {
|
||||||
setColorBright();
|
setColorBright();
|
||||||
|
@ -465,8 +471,26 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
animator.start();
|
animator.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
//without theme
|
protected void setColorLowRes() {
|
||||||
|
mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTime));
|
||||||
|
statusView.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_statusView));
|
||||||
|
mRelativeLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background));
|
||||||
|
mSgv.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));
|
||||||
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_Timestamp));
|
||||||
|
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);
|
||||||
|
gridColour = 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected void setColorDark() {
|
protected void setColorDark() {
|
||||||
mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTime));
|
mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTime));
|
||||||
|
@ -487,9 +511,9 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ageLevel == 1) {
|
if (ageLevel == 1) {
|
||||||
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp1));
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_Timestamp));
|
||||||
} else {
|
} else {
|
||||||
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp));
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_TimestampOld));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chart != null) {
|
if (chart != null) {
|
||||||
|
@ -499,7 +523,6 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
gridColour = ContextCompat.getColor(getApplicationContext(), R.color.dark_gridColor);
|
gridColour = ContextCompat.getColor(getApplicationContext(), R.color.dark_gridColor);
|
||||||
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
||||||
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
||||||
singleLine = false;
|
|
||||||
pointSize = 2;
|
pointSize = 2;
|
||||||
setupCharts();
|
setupCharts();
|
||||||
}
|
}
|
||||||
|
@ -540,7 +563,6 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
gridColour = ContextCompat.getColor(getApplicationContext(), R.color.light_gridColor);
|
gridColour = ContextCompat.getColor(getApplicationContext(), R.color.light_gridColor);
|
||||||
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
||||||
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
||||||
singleLine = false;
|
|
||||||
pointSize = 2;
|
pointSize = 2;
|
||||||
setupCharts();
|
setupCharts();
|
||||||
}
|
}
|
||||||
|
@ -560,18 +582,12 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
|
|
||||||
ArrayList<DataMap> entries = dataMap.getDataMapArrayList("entries");
|
ArrayList<DataMap> entries = dataMap.getDataMapArrayList("entries");
|
||||||
if (entries != null) {
|
if (entries != null) {
|
||||||
|
bgDataList = new ArrayList<BgWatchData>();
|
||||||
for (DataMap entry : entries) {
|
for (DataMap entry : entries) {
|
||||||
double sgv = entry.getDouble("sgvDouble");
|
double sgv = entry.getDouble("sgvDouble");
|
||||||
double high = entry.getDouble("high");
|
double high = entry.getDouble("high");
|
||||||
double low = entry.getDouble("low");
|
double low = entry.getDouble("low");
|
||||||
double timestamp = entry.getDouble("timestamp");
|
double timestamp = entry.getDouble("timestamp");
|
||||||
|
|
||||||
final int size = bgDataList.size();
|
|
||||||
if (size > 0) {
|
|
||||||
if (bgDataList.get(size - 1).timestamp == timestamp)
|
|
||||||
continue; // Ignore duplicates.
|
|
||||||
}
|
|
||||||
|
|
||||||
bgDataList.add(new BgWatchData(sgv, high, low, timestamp));
|
bgDataList.add(new BgWatchData(sgv, high, low, timestamp));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -600,7 +616,7 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre
|
||||||
public void setupCharts() {
|
public void setupCharts() {
|
||||||
if(bgDataList.size() > 0) { //Dont crash things just because we dont have values, people dont like crashy things
|
if(bgDataList.size() > 0) { //Dont crash things just because we dont have values, people dont like crashy things
|
||||||
int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3"));
|
int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3"));
|
||||||
if (singleLine) {
|
if (lowResMode) {
|
||||||
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, midColor, gridColour, basalBackgroundColor, basalCenterColor, timeframe);
|
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, midColor, gridColour, basalBackgroundColor, basalCenterColor, timeframe);
|
||||||
} else {
|
} else {
|
||||||
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, highColor, lowColor, midColor, gridColour, basalBackgroundColor, basalCenterColor, timeframe);
|
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, highColor, lowColor, midColor, gridColour, basalBackgroundColor, basalCenterColor, timeframe);
|
||||||
|
|
|
@ -26,6 +26,7 @@ import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.google.android.gms.wearable.DataMap;
|
import com.google.android.gms.wearable.DataMap;
|
||||||
|
import com.ustwo.clockwise.common.WatchMode;
|
||||||
import com.ustwo.clockwise.wearable.WatchFace;
|
import com.ustwo.clockwise.wearable.WatchFace;
|
||||||
import com.ustwo.clockwise.common.WatchFaceTime;
|
import com.ustwo.clockwise.common.WatchFaceTime;
|
||||||
import com.ustwo.clockwise.common.WatchShape;
|
import com.ustwo.clockwise.common.WatchShape;
|
||||||
|
@ -53,8 +54,8 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
||||||
public int gridColor = Color.WHITE;
|
public int gridColor = Color.WHITE;
|
||||||
public int basalBackgroundColor = Color.BLUE;
|
public int basalBackgroundColor = Color.BLUE;
|
||||||
public int basalCenterColor = Color.BLUE;
|
public int basalCenterColor = Color.BLUE;
|
||||||
|
public boolean lowResMode = false;
|
||||||
public int pointSize = 2;
|
public int pointSize = 2;
|
||||||
public boolean singleLine = false;
|
|
||||||
public boolean layoutSet = false;
|
public boolean layoutSet = false;
|
||||||
public int missed_readings_alert_id = 818;
|
public int missed_readings_alert_id = 818;
|
||||||
public BgGraphBuilder bgGraphBuilder;
|
public BgGraphBuilder bgGraphBuilder;
|
||||||
|
@ -312,15 +313,29 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setColor() {
|
public void setColor() {
|
||||||
if (sharedPrefs.getBoolean("dark", true)) {
|
if(lowResMode){
|
||||||
|
setColorLowRes();
|
||||||
|
} else if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
setColorDark();
|
setColorDark();
|
||||||
} else {
|
} else {
|
||||||
setColorBright();
|
setColorBright();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void onWatchModeChanged(WatchMode watchMode) {
|
||||||
|
|
||||||
|
if(lowResMode ^ isLowRes(watchMode)){ //if there was a change in lowResMode
|
||||||
|
lowResMode = isLowRes(watchMode);
|
||||||
|
setColor();
|
||||||
|
} else if (! sharedPrefs.getBoolean("dark", true)){
|
||||||
|
//in bright mode: different colours if active:
|
||||||
|
setColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isLowRes(WatchMode watchMode) {
|
||||||
|
return (watchMode == WatchMode.LOW_BIT) || (watchMode == WatchMode.LOW_BIT_BURN_IN) || (watchMode == WatchMode.LOW_BIT_BURN_IN);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key){
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key){
|
||||||
|
@ -335,6 +350,7 @@ public abstract class BaseWatchFace extends WatchFace implements SharedPreferen
|
||||||
}
|
}
|
||||||
protected abstract void setColorDark();
|
protected abstract void setColorDark();
|
||||||
protected abstract void setColorBright();
|
protected abstract void setColorBright();
|
||||||
|
protected abstract void setColorLowRes();
|
||||||
|
|
||||||
|
|
||||||
public void missedReadingAlert() {
|
public void missedReadingAlert() {
|
||||||
|
@ -348,18 +364,12 @@ protected abstract void setColorDark();
|
||||||
|
|
||||||
ArrayList<DataMap> entries = dataMap.getDataMapArrayList("entries");
|
ArrayList<DataMap> entries = dataMap.getDataMapArrayList("entries");
|
||||||
if (entries != null) {
|
if (entries != null) {
|
||||||
|
bgDataList = new ArrayList<BgWatchData>();
|
||||||
for (DataMap entry : entries) {
|
for (DataMap entry : entries) {
|
||||||
double sgv = entry.getDouble("sgvDouble");
|
double sgv = entry.getDouble("sgvDouble");
|
||||||
double high = entry.getDouble("high");
|
double high = entry.getDouble("high");
|
||||||
double low = entry.getDouble("low");
|
double low = entry.getDouble("low");
|
||||||
double timestamp = entry.getDouble("timestamp");
|
double timestamp = entry.getDouble("timestamp");
|
||||||
|
|
||||||
final int size = bgDataList.size();
|
|
||||||
if (size > 0) {
|
|
||||||
if (bgDataList.get(size - 1).timestamp == timestamp)
|
|
||||||
continue; // Ignore duplicates.
|
|
||||||
}
|
|
||||||
|
|
||||||
bgDataList.add(new BgWatchData(sgv, high, low, timestamp));
|
bgDataList.add(new BgWatchData(sgv, high, low, timestamp));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -388,7 +398,7 @@ protected abstract void setColorDark();
|
||||||
public void setupCharts() {
|
public void setupCharts() {
|
||||||
if(bgDataList.size() > 0) { //Dont crash things just because we dont have values, people dont like crashy things
|
if(bgDataList.size() > 0) { //Dont crash things just because we dont have values, people dont like crashy things
|
||||||
int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3"));
|
int timeframe = Integer.parseInt(sharedPrefs.getString("chart_timeframe", "3"));
|
||||||
if (singleLine) {
|
if (lowResMode) {
|
||||||
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, midColor, gridColor, basalBackgroundColor, basalCenterColor, timeframe);
|
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, midColor, gridColor, basalBackgroundColor, basalCenterColor, timeframe);
|
||||||
} else {
|
} else {
|
||||||
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, highColor, lowColor, midColor, gridColor, basalBackgroundColor, basalCenterColor, timeframe);
|
bgGraphBuilder = new BgGraphBuilder(getApplicationContext(), bgDataList, tempWatchDataList, basalWatchDataList, pointSize, highColor, lowColor, midColor, gridColor, basalBackgroundColor, basalCenterColor, timeframe);
|
||||||
|
|
|
@ -52,6 +52,7 @@ public class BgGraphBuilder {
|
||||||
public Viewport viewport;
|
public Viewport viewport;
|
||||||
|
|
||||||
|
|
||||||
|
//used for low resolution screen.
|
||||||
public BgGraphBuilder(Context context, List<BgWatchData> aBgList, List<TempWatchData> tempWatchDataList, ArrayList<BasalWatchData> basalWatchDataList, int aPointSize, int aMidColor, int gridColour, int basalBackgroundColor, int basalCenterColor, int timespan) {
|
public BgGraphBuilder(Context context, List<BgWatchData> aBgList, List<TempWatchData> tempWatchDataList, ArrayList<BasalWatchData> basalWatchDataList, int aPointSize, int aMidColor, int gridColour, int basalBackgroundColor, int basalCenterColor, int timespan) {
|
||||||
end_time = new Date().getTime() + (1000 * 60 * 6 * timespan); //Now plus 30 minutes padding (for 5 hours. Less if less.)
|
end_time = new Date().getTime() + (1000 * 60 * 6 * timespan); //Now plus 30 minutes padding (for 5 hours. Less if less.)
|
||||||
start_time = new Date().getTime() - (1000 * 60 * 60 * timespan); //timespan hours ago
|
start_time = new Date().getTime() - (1000 * 60 * 60 * timespan); //timespan hours ago
|
||||||
|
@ -72,7 +73,6 @@ public class BgGraphBuilder {
|
||||||
this.basalBackgroundColor = basalBackgroundColor;
|
this.basalBackgroundColor = basalBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use for ambient mode!
|
|
||||||
public BgGraphBuilder(Context context, List<BgWatchData> aBgList, List<TempWatchData> tempWatchDataList, ArrayList<BasalWatchData> basalWatchDataList, int aPointSize, int aHighColor, int aLowColor, int aMidColor, int gridColour, int basalBackgroundColor, int basalCenterColor, int timespan) {
|
public BgGraphBuilder(Context context, List<BgWatchData> aBgList, List<TempWatchData> tempWatchDataList, ArrayList<BasalWatchData> basalWatchDataList, int aPointSize, int aHighColor, int aLowColor, int aMidColor, int gridColour, int basalBackgroundColor, int basalCenterColor, int timespan) {
|
||||||
end_time = new Date().getTime() + (1000 * 60 * 6 * timespan); //Now plus 30 minutes padding (for 5 hours. Less if less.)
|
end_time = new Date().getTime() + (1000 * 60 * 6 * timespan); //Now plus 30 minutes padding (for 5 hours. Less if less.)
|
||||||
start_time = new Date().getTime() - (1000 * 60 * 60 * timespan); //timespan hours ago
|
start_time = new Date().getTime() - (1000 * 60 * 60 * timespan); //timespan hours ago
|
||||||
|
|
|
@ -40,16 +40,6 @@ public class Home extends BaseWatchFace {
|
||||||
sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit();
|
sharedPrefs.edit().putString("chart_timeframe", "" + timeframe).commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onWatchModeChanged(WatchMode watchMode) {
|
|
||||||
if (! sharedPrefs.getBoolean("dark", true)){
|
|
||||||
//in bright mode: different colours if active:
|
|
||||||
setColor();
|
|
||||||
} else {
|
|
||||||
//TODO: Handle low bit ambient
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle(){
|
protected WatchFaceStyle getWatchFaceStyle(){
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||||
|
@ -77,7 +67,7 @@ public class Home extends BaseWatchFace {
|
||||||
if (ageLevel == 1) {
|
if (ageLevel == 1) {
|
||||||
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp1_home));
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp1_home));
|
||||||
} else {
|
} else {
|
||||||
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp));
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_TimestampOld));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (batteryLevel == 1) {
|
if (batteryLevel == 1) {
|
||||||
|
@ -95,12 +85,30 @@ public class Home extends BaseWatchFace {
|
||||||
gridColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_gridColor);
|
gridColor = ContextCompat.getColor(getApplicationContext(), R.color.dark_gridColor);
|
||||||
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
||||||
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
||||||
singleLine = false;
|
|
||||||
pointSize = 2;
|
pointSize = 2;
|
||||||
setupCharts();
|
setupCharts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setColorLowRes() {
|
||||||
|
mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTime));
|
||||||
|
mRelativeLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background));
|
||||||
|
mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor));
|
||||||
|
mDelta.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor));
|
||||||
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_Timestamp));
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void setColorBright() {
|
protected void setColorBright() {
|
||||||
|
|
||||||
|
@ -142,7 +150,6 @@ public class Home extends BaseWatchFace {
|
||||||
gridColor = ContextCompat.getColor(getApplicationContext(), R.color.light_gridColor);
|
gridColor = ContextCompat.getColor(getApplicationContext(), R.color.light_gridColor);
|
||||||
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_light);
|
||||||
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
||||||
singleLine = false;
|
|
||||||
pointSize = 2;
|
pointSize = 2;
|
||||||
setupCharts();
|
setupCharts();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class LargeHome extends BaseWatchFace {
|
||||||
performViewSetup();
|
performViewSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setColorDark(){
|
protected void setColorDark(){
|
||||||
mLinearLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mLinearLayout));
|
mLinearLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mLinearLayout));
|
||||||
|
@ -39,7 +38,7 @@ public class LargeHome extends BaseWatchFace {
|
||||||
if (ageLevel == 1) {
|
if (ageLevel == 1) {
|
||||||
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp1_home));
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp1_home));
|
||||||
} else {
|
} else {
|
||||||
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTimestamp));
|
mTimestamp.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_TimestampOld));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (batteryLevel == 1) {
|
if (batteryLevel == 1) {
|
||||||
|
@ -106,4 +105,17 @@ public class LargeHome extends BaseWatchFace {
|
||||||
mTime.setTextColor(Color.WHITE);
|
mTime.setTextColor(Color.WHITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setColorLowRes() {
|
||||||
|
mLinearLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mLinearLayout));
|
||||||
|
mTime.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mTime));
|
||||||
|
mRelativeLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_background));
|
||||||
|
mSgv.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_midColor));
|
||||||
|
mDelta.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_mTimestamp1_home));
|
||||||
|
mUploaderBattery.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_uploaderBattery));
|
||||||
|
mStatus.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mStatus_home));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
<color name="dark_statusView">@color/grey_50</color>
|
<color name="dark_statusView">@color/grey_50</color>
|
||||||
<color name="dark_background">@color/black</color>
|
<color name="dark_background">@color/black</color>
|
||||||
<color name="dark_mLinearLayout">@color/grey_50</color>
|
<color name="dark_mLinearLayout">@color/grey_50</color>
|
||||||
<color name="dark_mTimestamp1">@color/grey_50</color>
|
<color name="dark_Timestamp">@color/grey_50</color>
|
||||||
<color name="dark_mTimestamp1_home">@color/black</color>
|
<color name="dark_mTimestamp1_home">@color/black</color>
|
||||||
<color name="dark_mTimestamp">@color/red_600</color>
|
<color name="dark_TimestampOld">@color/red_600</color>
|
||||||
<color name="dark_uploaderBattery">@color/black</color>
|
<color name="dark_uploaderBattery">@color/black</color>
|
||||||
<color name="dark_uploaderBatteryEmpty">@color/red_600</color>
|
<color name="dark_uploaderBatteryEmpty">@color/red_600</color>
|
||||||
<color name="dark_mStatus_home">@color/black</color>
|
<color name="dark_mStatus_home">@color/black</color>
|
||||||
|
@ -46,6 +46,8 @@
|
||||||
<!-- basal colors -->
|
<!-- basal colors -->
|
||||||
<color name="basal_light">@color/blue_300</color>
|
<color name="basal_light">@color/blue_300</color>
|
||||||
<color name="basal_dark">@color/BLUE</color>
|
<color name="basal_dark">@color/BLUE</color>
|
||||||
|
<color name="basal_light_lowres">@color/grey_300</color>
|
||||||
|
<color name="basal_dark_lowres">@color/grey_500</color>
|
||||||
|
|
||||||
|
|
||||||
<!-- Material Design - Color Palette -->
|
<!-- Material Design - Color Palette -->
|
||||||
|
|
Loading…
Reference in a new issue