wear circle watchface fix
This commit is contained in:
parent
b8588b2c3c
commit
8d6760081e
3 changed files with 20 additions and 7 deletions
|
@ -17,6 +17,7 @@ import android.os.Bundle;
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
|
import android.support.wearable.watchface.WatchFaceStyle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
|
@ -346,7 +347,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getInRangeColor() {
|
public int getInRangeColor() {
|
||||||
if (sharedPrefs.getBoolean("dark", false)) {
|
if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
return Color.argb(255, 120, 255, 120);
|
return Color.argb(255, 120, 255, 120);
|
||||||
} else {
|
} else {
|
||||||
return Color.argb(255, 0, 240, 0);
|
return Color.argb(255, 0, 240, 0);
|
||||||
|
@ -355,7 +356,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHighColor() {
|
public int getHighColor() {
|
||||||
if (sharedPrefs.getBoolean("dark", false)) {
|
if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
return Color.argb(255, 255, 255, 120);
|
return Color.argb(255, 255, 255, 120);
|
||||||
} else {
|
} else {
|
||||||
return Color.argb(255, 255, 200, 0);
|
return Color.argb(255, 255, 200, 0);
|
||||||
|
@ -364,7 +365,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBackgroundColor() {
|
public int getBackgroundColor() {
|
||||||
if (sharedPrefs.getBoolean("dark", false)) {
|
if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
return Color.BLACK;
|
return Color.BLACK;
|
||||||
} else {
|
} else {
|
||||||
return Color.WHITE;
|
return Color.WHITE;
|
||||||
|
@ -373,7 +374,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTextColor() {
|
public int getTextColor() {
|
||||||
if (sharedPrefs.getBoolean("dark", false)) {
|
if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
return Color.WHITE;
|
return Color.WHITE;
|
||||||
} else {
|
} else {
|
||||||
return Color.BLACK;
|
return Color.BLACK;
|
||||||
|
@ -666,7 +667,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
|
||||||
Log.d("CircleWatchface", "addReadingSoft");
|
Log.d("CircleWatchface", "addReadingSoft");
|
||||||
double size;
|
double size;
|
||||||
int color = Color.LTGRAY;
|
int color = Color.LTGRAY;
|
||||||
if (sharedPrefs.getBoolean("dark", false)) {
|
if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
color = Color.DKGRAY;
|
color = Color.DKGRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,7 +685,7 @@ public class CircleWatchface extends WatchFace implements SharedPreferences.OnSh
|
||||||
double size;
|
double size;
|
||||||
int color = Color.LTGRAY;
|
int color = Color.LTGRAY;
|
||||||
int indicatorColor = Color.DKGRAY;
|
int indicatorColor = Color.DKGRAY;
|
||||||
if (sharedPrefs.getBoolean("dark", false)) {
|
if (sharedPrefs.getBoolean("dark", true)) {
|
||||||
color = Color.DKGRAY;
|
color = Color.DKGRAY;
|
||||||
indicatorColor = Color.LTGRAY;
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,6 +3,7 @@ package info.nightscout.androidaps;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.wearable.watchface.WatchFaceStyle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
||||||
import com.ustwo.clockwise.common.WatchMode;
|
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
|
@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));
|
||||||
|
|
|
@ -20,7 +20,7 @@ final class ActionsDefinitions {
|
||||||
"Fillpreset 1",
|
"Fillpreset 1",
|
||||||
"Fillpreset 2",
|
"Fillpreset 2",
|
||||||
"Fillpreset 3",
|
"Fillpreset 3",
|
||||||
"003"};
|
"004"};
|
||||||
|
|
||||||
|
|
||||||
public static void doAction(int position, Context ctx) {
|
public static void doAction(int position, Context ctx) {
|
||||||
|
|
Loading…
Reference in a new issue