wear circle watchface fix

This commit is contained in:
AdrianLxM 2017-02-09 00:15:14 +01:00
parent b8588b2c3c
commit 8d6760081e
3 changed files with 20 additions and 7 deletions

View file

@ -17,6 +17,7 @@ import android.os.Bundle;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.support.v4.content.LocalBroadcastManager;
import android.support.wearable.watchface.WatchFaceStyle;
import android.util.Log;
import android.util.TypedValue;
import android.view.Display;
@ -346,7 +347,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
}
public int getInRangeColor() {
if (sharedPrefs.getBoolean("dark", false)) {
if (sharedPrefs.getBoolean("dark", true)) {
return Color.argb(255, 120, 255, 120);
} else {
return Color.argb(255, 0, 240, 0);
@ -355,7 +356,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
}
public int getHighColor() {
if (sharedPrefs.getBoolean("dark", false)) {
if (sharedPrefs.getBoolean("dark", true)) {
return Color.argb(255, 255, 255, 120);
} else {
return Color.argb(255, 255, 200, 0);
@ -364,7 +365,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
}
public int getBackgroundColor() {
if (sharedPrefs.getBoolean("dark", false)) {
if (sharedPrefs.getBoolean("dark", true)) {
return Color.BLACK;
} else {
return Color.WHITE;
@ -373,7 +374,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
}
public int getTextColor() {
if (sharedPrefs.getBoolean("dark", false)) {
if (sharedPrefs.getBoolean("dark", true)) {
return Color.WHITE;
} else {
return Color.BLACK;
@ -666,7 +667,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
Log.d("CircleWatchface", "addReadingSoft");
double size;
int color = Color.LTGRAY;
if (sharedPrefs.getBoolean("dark", false)) {
if (sharedPrefs.getBoolean("dark", true)) {
color = Color.DKGRAY;
}
@ -684,7 +685,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
double size;
int color = Color.LTGRAY;
int indicatorColor = Color.DKGRAY;
if (sharedPrefs.getBoolean("dark", false)) {
if (sharedPrefs.getBoolean("dark", true)) {
color = Color.DKGRAY;
indicatorColor = Color.LTGRAY;
}
@ -724,4 +725,10 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
}
}
@Override
protected WatchFaceStyle getWatchFaceStyle(){
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
}
}

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps;
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;
@ -40,6 +41,11 @@ public class LargeHome extends BaseWatchFace {
}
}
@Override
protected WatchFaceStyle getWatchFaceStyle(){
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
}
@Override
protected void setColorDark(){
mLinearLayout.setBackgroundColor(ContextCompat.getColor(getApplicationContext(), R.color.dark_mLinearLayout));

View file

@ -20,7 +20,7 @@ final class ActionsDefinitions {
"Fillpreset 1",
"Fillpreset 2",
"Fillpreset 3",
"003"};
"004"};
public static void doAction(int position, Context ctx) {