SteampunkWatchface -> kt, eliminate WatchViewStub
This commit is contained in:
parent
0dd72922d2
commit
68c7b130fb
55 changed files with 568 additions and 735 deletions
|
@ -84,14 +84,15 @@ class ActionsFragment : DaggerFragment() {
|
||||||
// This property is only valid between onCreateView and onDestroyView.
|
// This property is only valid between onCreateView and onDestroyView.
|
||||||
private val binding get() = _binding!!
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||||
//check screen width
|
//check screen width
|
||||||
dm = DisplayMetrics()
|
dm = DisplayMetrics()
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
activity?.display?.getRealMetrics(dm)
|
activity?.display?.getRealMetrics(dm)
|
||||||
} else {
|
} else {
|
||||||
@Suppress("DEPRECATION") activity?.windowManager?.defaultDisplay?.getMetrics(dm)
|
@Suppress("DEPRECATION")
|
||||||
|
activity?.windowManager?.defaultDisplay?.getMetrics(dm)
|
||||||
}
|
}
|
||||||
_binding = ActionsFragmentBinding.inflate(inflater, container, false)
|
_binding = ActionsFragmentBinding.inflate(inflater, container, false)
|
||||||
return binding.root
|
return binding.root
|
||||||
|
|
|
@ -146,7 +146,7 @@
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".watchfaces.Steampunk"
|
android:name=".watchfaces.SteampunkWatchface"
|
||||||
android:allowEmbedded="true"
|
android:allowEmbedded="true"
|
||||||
android:label="@string/label_xdrip_steampunk"
|
android:label="@string/label_xdrip_steampunk"
|
||||||
android:permission="android.permission.BIND_WALLPAPER"
|
android:permission="android.permission.BIND_WALLPAPER"
|
||||||
|
|
|
@ -31,7 +31,7 @@ abstract class WearServicesModule {
|
||||||
@ContributesAndroidInjector abstract fun contributesHome(): Home
|
@ContributesAndroidInjector abstract fun contributesHome(): Home
|
||||||
@ContributesAndroidInjector abstract fun contributesHome2(): Home2
|
@ContributesAndroidInjector abstract fun contributesHome2(): Home2
|
||||||
@ContributesAndroidInjector abstract fun contributesLargeHome(): LargeHome
|
@ContributesAndroidInjector abstract fun contributesLargeHome(): LargeHome
|
||||||
@ContributesAndroidInjector abstract fun contributesSteampunk(): Steampunk
|
@ContributesAndroidInjector abstract fun contributesSteampunk(): SteampunkWatchface
|
||||||
@ContributesAndroidInjector abstract fun contributesDigitalStyle(): DigitalStyle
|
@ContributesAndroidInjector abstract fun contributesDigitalStyle(): DigitalStyle
|
||||||
@ContributesAndroidInjector abstract fun contributesCockpit(): Cockpit
|
@ContributesAndroidInjector abstract fun contributesCockpit(): Cockpit
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ class AcceptActivity : ViewSelectorActivity() {
|
||||||
}
|
}
|
||||||
scrollView.requestFocus()
|
scrollView.requestFocus()
|
||||||
} else {
|
} else {
|
||||||
view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
val returnCommand = deserialize(actionKey)
|
val returnCommand = deserialize(actionKey)
|
||||||
|
|
|
@ -44,7 +44,7 @@ class BolusActivity : ViewSelectorActivity() {
|
||||||
container.addView(view)
|
container.addView(view)
|
||||||
view.requestFocus()
|
view.requestFocus()
|
||||||
} else {
|
} else {
|
||||||
view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
rxBus.send(EventWearToMobile(ActionBolusPreCheck(SafeParse.stringToDouble(editInsulin?.editText?.text.toString()), 0)))
|
rxBus.send(EventWearToMobile(ActionBolusPreCheck(SafeParse.stringToDouble(editInsulin?.editText?.text.toString()), 0)))
|
||||||
|
|
|
@ -47,7 +47,7 @@ class CarbActivity : ViewSelectorActivity() {
|
||||||
container.addView(view)
|
container.addView(view)
|
||||||
view.requestFocus()
|
view.requestFocus()
|
||||||
} else {
|
} else {
|
||||||
view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
// With start time 0 and duration 0
|
// With start time 0 and duration 0
|
||||||
|
|
|
@ -70,7 +70,7 @@ class ECarbActivity : ViewSelectorActivity() {
|
||||||
container.addView(view)
|
container.addView(view)
|
||||||
view
|
view
|
||||||
} else {
|
} else {
|
||||||
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class FillActivity : ViewSelectorActivity() {
|
||||||
view.requestFocus()
|
view.requestFocus()
|
||||||
view
|
view
|
||||||
} else {
|
} else {
|
||||||
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
//check if it can happen that the fragment is never created that hold data?
|
//check if it can happen that the fragment is never created that hold data?
|
||||||
|
|
|
@ -66,7 +66,7 @@ class ProfileSwitchActivity : ViewSelectorActivity() {
|
||||||
container.addView(view)
|
container.addView(view)
|
||||||
view
|
view
|
||||||
} else {
|
} else {
|
||||||
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
//check if it can happen that the fragment is never created that hold data?
|
//check if it can happen that the fragment is never created that hold data?
|
||||||
|
|
|
@ -88,7 +88,7 @@ class TempTargetActivity : ViewSelectorActivity() {
|
||||||
container.addView(view)
|
container.addView(view)
|
||||||
view
|
view
|
||||||
} else {
|
} else {
|
||||||
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
//check if it can happen that the fragment is never created that hold data?
|
//check if it can happen that the fragment is never created that hold data?
|
||||||
|
|
|
@ -56,7 +56,7 @@ class TreatmentActivity : ViewSelectorActivity() {
|
||||||
container.addView(view)
|
container.addView(view)
|
||||||
view
|
view
|
||||||
} else {
|
} else {
|
||||||
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
//check if it can happen that the fragment is never created that hold data?
|
//check if it can happen that the fragment is never created that hold data?
|
||||||
|
|
|
@ -63,7 +63,7 @@ class WizardActivity : ViewSelectorActivity() {
|
||||||
container.addView(view)
|
container.addView(view)
|
||||||
view
|
view
|
||||||
} else {
|
} else {
|
||||||
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_send_item, container, false)
|
val view = LayoutInflater.from(applicationContext).inflate(R.layout.action_confirm_ok, container, false)
|
||||||
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
val confirmButton = view.findViewById<ImageView>(R.id.confirmbutton)
|
||||||
confirmButton.setOnClickListener {
|
confirmButton.setOnClickListener {
|
||||||
val action = ActionWizardPreCheck(
|
val action = ActionWizardPreCheck(
|
||||||
|
|
|
@ -180,23 +180,18 @@ public class BIGChart extends WatchFace {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performViewSetup() {
|
public void performViewSetup() {
|
||||||
final WatchViewStub stub = layoutView.findViewById(R.id.watch_view_stub);
|
mTime = layoutView.findViewById(R.id.watch_time);
|
||||||
|
mSgv = layoutView.findViewById(R.id.sgv);
|
||||||
stub.setOnLayoutInflatedListener(stub1 -> {
|
mTimestamp = layoutView.findViewById(R.id.timestamp);
|
||||||
mTime = stub1.findViewById(R.id.watch_time);
|
mDelta = layoutView.findViewById(R.id.delta);
|
||||||
mSgv = stub1.findViewById(R.id.sgv);
|
mAvgDelta = layoutView.findViewById(R.id.avgdelta);
|
||||||
mTimestamp = stub1.findViewById(R.id.timestamp);
|
mRelativeLayout = layoutView.findViewById(R.id.main_layout);
|
||||||
mDelta = stub1.findViewById(R.id.delta);
|
chart = layoutView.findViewById(R.id.chart);
|
||||||
mAvgDelta = stub1.findViewById(R.id.avgdelta);
|
statusView = layoutView.findViewById(R.id.aps_status);
|
||||||
mRelativeLayout = stub1.findViewById(R.id.main_layout);
|
layoutSet = true;
|
||||||
chart = stub1.findViewById(R.id.chart);
|
showAgeAndStatus();
|
||||||
statusView = stub1.findViewById(R.id.aps_status);
|
mRelativeLayout.measure(specW, specH);
|
||||||
layoutSet = true;
|
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), mRelativeLayout.getMeasuredHeight());
|
||||||
showAgeAndStatus();
|
|
||||||
mRelativeLayout.measure(specW, specH);
|
|
||||||
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
|
|
||||||
mRelativeLayout.getMeasuredHeight());
|
|
||||||
});
|
|
||||||
rxBus.send(new EventWearToMobile(new EventData.ActionResendData("BIGChart:performViewSetup")));
|
rxBus.send(new EventWearToMobile(new EventData.ActionResendData("BIGChart:performViewSetup")));
|
||||||
wakeLock.acquire(50);
|
wakeLock.acquire(50);
|
||||||
}
|
}
|
||||||
|
@ -251,6 +246,7 @@ public class BIGChart extends WatchFace {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle() {
|
protected WatchFaceStyle getWatchFaceStyle() {
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||||
|
|
|
@ -71,15 +71,9 @@ public abstract class BaseWatchFace extends WatchFace {
|
||||||
|
|
||||||
CompositeDisposable disposable = new CompositeDisposable();
|
CompositeDisposable disposable = new CompositeDisposable();
|
||||||
|
|
||||||
protected EventData.SingleBg singleBg = new EventData.SingleBg(0, "---", "-", "--", "--", "--"
|
protected EventData.SingleBg singleBg = new EventData.SingleBg(0, "---", "-", "--", "--", "--", 0, 0.0, 0.0, 0.0, 0);
|
||||||
, 0, 0.0, 0.0, 0.0, 0);
|
|
||||||
protected EventData.Status status = new EventData.Status("no status", "IOB", "-.--", false, "--g", "-.--U/h", "--", "--", -1, "--", false, 1);
|
protected EventData.Status status = new EventData.Status("no status", "IOB", "-.--", false, "--g", "-.--U/h", "--", "--", -1, "--", false, 1);
|
||||||
protected EventData.TreatmentData treatmentData = new EventData.TreatmentData(
|
protected EventData.TreatmentData treatmentData = new EventData.TreatmentData(new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>());
|
||||||
new ArrayList<>(),
|
|
||||||
new ArrayList<>(),
|
|
||||||
new ArrayList<>(),
|
|
||||||
new ArrayList<>()
|
|
||||||
);
|
|
||||||
protected EventData.GraphData graphData = new EventData.GraphData(new ArrayList<>());
|
protected EventData.GraphData graphData = new EventData.GraphData(new ArrayList<>());
|
||||||
|
|
||||||
static IntentFilter iFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
|
static IntentFilter iFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
|
||||||
|
@ -174,15 +168,11 @@ public abstract class BaseWatchFace extends WatchFace {
|
||||||
.subscribe(event -> {
|
.subscribe(event -> {
|
||||||
status = event;
|
status = event;
|
||||||
// this event is received as last batch of data
|
// this event is received as last batch of data
|
||||||
if (isSimpleUi()) {
|
if (!isSimpleUi() || !needUpdate()) {
|
||||||
if (needUpdate()) {
|
|
||||||
invalidate();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setupCharts();
|
setupCharts();
|
||||||
setDataFields();
|
setDataFields();
|
||||||
invalidate();
|
|
||||||
}
|
}
|
||||||
|
invalidate();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -260,50 +250,47 @@ public abstract class BaseWatchFace extends WatchFace {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performViewSetup() {
|
public void performViewSetup() {
|
||||||
final WatchViewStub layoutStub = layoutView.findViewById(R.id.watch_view_stub);
|
mTime = layoutView.findViewById(R.id.watch_time);
|
||||||
|
mHour = layoutView.findViewById(R.id.hour);
|
||||||
layoutStub.setOnLayoutInflatedListener((WatchViewStub stub) -> {
|
mMinute = layoutView.findViewById(R.id.minute);
|
||||||
mTime = stub.findViewById(R.id.watch_time);
|
mTimePeriod = layoutView.findViewById(R.id.timePeriod);
|
||||||
mHour = stub.findViewById(R.id.hour);
|
mDay = layoutView.findViewById(R.id.day);
|
||||||
mMinute = stub.findViewById(R.id.minute);
|
mDayName = layoutView.findViewById(R.id.dayname);
|
||||||
mTimePeriod = stub.findViewById(R.id.timePeriod);
|
mMonth = layoutView.findViewById(R.id.month);
|
||||||
mDay = stub.findViewById(R.id.day);
|
mDate = layoutView.findViewById(R.id.date_time);
|
||||||
mDayName = stub.findViewById(R.id.dayname);
|
mLoop = layoutView.findViewById(R.id.loop);
|
||||||
mMonth = stub.findViewById(R.id.month);
|
mSgv = layoutView.findViewById(R.id.sgv);
|
||||||
mDate = stub.findViewById(R.id.date_time);
|
mDirection = layoutView.findViewById(R.id.direction);
|
||||||
mLoop = stub.findViewById(R.id.loop);
|
mTimestamp = layoutView.findViewById(R.id.timestamp);
|
||||||
mSgv = stub.findViewById(R.id.sgv);
|
mIOB1 = layoutView.findViewById(R.id.iob_text);
|
||||||
mDirection = stub.findViewById(R.id.direction);
|
mIOB2 = layoutView.findViewById(R.id.iobView);
|
||||||
mTimestamp = stub.findViewById(R.id.timestamp);
|
mCOB1 = layoutView.findViewById(R.id.cob_text);
|
||||||
mIOB1 = stub.findViewById(R.id.iob_text);
|
mCOB2 = layoutView.findViewById(R.id.cobView);
|
||||||
mIOB2 = stub.findViewById(R.id.iobView);
|
mBgi = layoutView.findViewById(R.id.bgiView);
|
||||||
mCOB1 = stub.findViewById(R.id.cob_text);
|
mStatus = layoutView.findViewById(R.id.externaltstatus);
|
||||||
mCOB2 = stub.findViewById(R.id.cobView);
|
mBasalRate = layoutView.findViewById(R.id.tmpBasal);
|
||||||
mBgi = stub.findViewById(R.id.bgiView);
|
mUploaderBattery = layoutView.findViewById(R.id.uploader_battery);
|
||||||
mStatus = stub.findViewById(R.id.externaltstatus);
|
mRigBattery = layoutView.findViewById(R.id.rig_battery);
|
||||||
mBasalRate = stub.findViewById(R.id.tmpBasal);
|
mDelta = layoutView.findViewById(R.id.delta);
|
||||||
mUploaderBattery = stub.findViewById(R.id.uploader_battery);
|
mAvgDelta = layoutView.findViewById(R.id.avgdelta);
|
||||||
mRigBattery = stub.findViewById(R.id.rig_battery);
|
isAAPSv2 = layoutView.findViewById(R.id.AAPSv2);
|
||||||
mDelta = stub.findViewById(R.id.delta);
|
mHighLight = layoutView.findViewById(R.id.highLight);
|
||||||
mAvgDelta = stub.findViewById(R.id.avgdelta);
|
mLowLight = layoutView.findViewById(R.id.lowLight);
|
||||||
isAAPSv2 = stub.findViewById(R.id.AAPSv2);
|
mRelativeLayout = layoutView.findViewById(R.id.main_layout);
|
||||||
mHighLight = stub.findViewById(R.id.highLight);
|
mLinearLayout = layoutView.findViewById(R.id.secondary_layout);
|
||||||
mLowLight = stub.findViewById(R.id.lowLight);
|
mLinearLayout2 = layoutView.findViewById(R.id.tertiary_layout);
|
||||||
mRelativeLayout = stub.findViewById(R.id.main_layout);
|
mGlucoseDial = layoutView.findViewById(R.id.glucose_dial);
|
||||||
mLinearLayout = stub.findViewById(R.id.secondary_layout);
|
mDeltaGauge = layoutView.findViewById(R.id.delta_pointer);
|
||||||
mLinearLayout2 = stub.findViewById(R.id.tertiary_layout);
|
mHourHand = layoutView.findViewById(R.id.hour_hand);
|
||||||
mGlucoseDial = stub.findViewById(R.id.glucose_dial);
|
mMinuteHand = layoutView.findViewById(R.id.minute_hand);
|
||||||
mDeltaGauge = stub.findViewById(R.id.delta_pointer);
|
mChartTap = layoutView.findViewById(R.id.chart_zoom_tap);
|
||||||
mHourHand = stub.findViewById(R.id.hour_hand);
|
mMainMenuTap = layoutView.findViewById(R.id.main_menu_tap);
|
||||||
mMinuteHand = stub.findViewById(R.id.minute_hand);
|
chart = layoutView.findViewById(R.id.chart);
|
||||||
mChartTap = stub.findViewById(R.id.chart_zoom_tap);
|
|
||||||
mMainMenuTap = stub.findViewById(R.id.main_menu_tap);
|
|
||||||
chart = stub.findViewById(R.id.chart);
|
|
||||||
layoutSet = true;
|
layoutSet = true;
|
||||||
setupCharts();
|
setupCharts();
|
||||||
setDataFields();
|
setDataFields();
|
||||||
missedReadingAlert();
|
missedReadingAlert();
|
||||||
});
|
|
||||||
wakeLock.acquire(50);
|
wakeLock.acquire(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class CircleWatchface extends WatchFace {
|
||||||
//register Message Receiver
|
//register Message Receiver
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
myLayout = inflater.inflate(R.layout.modern_layout, null);
|
myLayout = inflater.inflate(R.layout.activity_circle, null);
|
||||||
prepareLayout();
|
prepareLayout();
|
||||||
prepareDrawTime();
|
prepareDrawTime();
|
||||||
|
|
||||||
|
@ -507,6 +507,7 @@ public class CircleWatchface extends WatchFace {
|
||||||
addArch(canvas, (offset + .8f) * offsetMultiplier + 11, getBackgroundColor(), 360);
|
addArch(canvas, (offset + .8f) * offsetMultiplier + 11, getBackgroundColor(), 360);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected void onTapCommand(int tapType, int x, int y, long eventTime) {
|
protected void onTapCommand(int tapType, int x, int y, long eventTime) {
|
||||||
if (mSgv == null) return;
|
if (mSgv == null) return;
|
||||||
|
|
|
@ -38,6 +38,7 @@ public class Cockpit extends BaseWatchFace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle() {
|
protected WatchFaceStyle getWatchFaceStyle() {
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class DigitalStyle extends BaseWatchFace {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle() {
|
protected WatchFaceStyle getWatchFaceStyle() {
|
||||||
return new WatchFaceStyle.Builder(this)
|
return new WatchFaceStyle.Builder(this)
|
||||||
|
|
|
@ -59,6 +59,7 @@ public class Home extends BaseWatchFace {
|
||||||
sp.putString("chart_timeframe", "" + timeframe);
|
sp.putString("chart_timeframe", "" + timeframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle(){
|
protected WatchFaceStyle getWatchFaceStyle(){
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class Home2 extends BaseWatchFace {
|
||||||
sp.putString("chart_timeframe", "" + timeframe);
|
sp.putString("chart_timeframe", "" + timeframe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle() {
|
protected WatchFaceStyle getWatchFaceStyle() {
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class LargeHome extends BaseWatchFace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle(){
|
protected WatchFaceStyle getWatchFaceStyle(){
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||||
|
|
|
@ -148,24 +148,18 @@ public class NOChart extends WatchFace {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performViewSetup() {
|
public void performViewSetup() {
|
||||||
final WatchViewStub stub = layoutView.findViewById(R.id.watch_view_stub);
|
mTime = layoutView.findViewById(R.id.watch_time);
|
||||||
|
mSgv = layoutView.findViewById(R.id.sgv);
|
||||||
stub.setOnLayoutInflatedListener(stub1 -> {
|
mTimestamp = layoutView.findViewById(R.id.timestamp);
|
||||||
mTime = stub1.findViewById(R.id.watch_time);
|
mDelta = layoutView.findViewById(R.id.delta);
|
||||||
mSgv = stub1.findViewById(R.id.sgv);
|
mAvgDelta = layoutView.findViewById(R.id.avgdelta);
|
||||||
mTimestamp = stub1.findViewById(R.id.timestamp);
|
mRelativeLayout = layoutView.findViewById(R.id.main_layout);
|
||||||
mDelta = stub1.findViewById(R.id.delta);
|
statusView = layoutView.findViewById(R.id.aps_status);
|
||||||
mAvgDelta = stub1.findViewById(R.id.avgdelta);
|
layoutSet = true;
|
||||||
mRelativeLayout = stub1.findViewById(R.id.main_layout);
|
showAgeAndStatus();
|
||||||
statusView = stub1.findViewById(R.id.aps_status);
|
mRelativeLayout.measure(specW, specH);
|
||||||
layoutSet = true;
|
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), mRelativeLayout.getMeasuredHeight());
|
||||||
showAgeAndStatus();
|
rxBus.send(new EventWearToMobile(new EventData.ActionResendData("NOChart:performViewSetup")));
|
||||||
mRelativeLayout.measure(specW, specH);
|
|
||||||
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(),
|
|
||||||
mRelativeLayout.getMeasuredHeight());
|
|
||||||
});
|
|
||||||
rxBus.send(new EventWearToMobile(new EventData.ActionResendData("NOChart" +
|
|
||||||
":performViewSetup")));
|
|
||||||
wakeLock.acquire(50);
|
wakeLock.acquire(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,6 +198,7 @@ public class NOChart extends WatchFace {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
protected WatchFaceStyle getWatchFaceStyle() {
|
protected WatchFaceStyle getWatchFaceStyle() {
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
||||||
|
|
|
@ -1,279 +0,0 @@
|
||||||
package info.nightscout.androidaps.watchfaces;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.support.wearable.watchface.WatchFaceStyle;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.animation.Animation;
|
|
||||||
import android.view.animation.LinearInterpolator;
|
|
||||||
import android.view.animation.RotateAnimation;
|
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import info.nightscout.androidaps.R;
|
|
||||||
import info.nightscout.androidaps.interaction.menus.MainMenuActivity;
|
|
||||||
import info.nightscout.shared.SafeParse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by andrew-warrington on 01/12/2017.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class Steampunk extends BaseWatchFace {
|
|
||||||
|
|
||||||
private long chartTapTime = 0;
|
|
||||||
private long mainMenuTapTime = 0;
|
|
||||||
private float lastEndDegrees = 0f;
|
|
||||||
private float deltaRotationAngle = 0f;
|
|
||||||
|
|
||||||
@SuppressLint("InflateParams") @Override
|
|
||||||
public void onCreate() {
|
|
||||||
forceSquareCanvas = true;
|
|
||||||
super.onCreate();
|
|
||||||
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
|
|
||||||
layoutView = inflater.inflate(R.layout.activity_steampunk, null);
|
|
||||||
performViewSetup();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onTapCommand(int tapType, int x, int y, long eventTime) {
|
|
||||||
|
|
||||||
if (tapType == TAP_TYPE_TAP &&
|
|
||||||
x >= mChartTap.getLeft() &&
|
|
||||||
x <= mChartTap.getRight() &&
|
|
||||||
y >= mChartTap.getTop() &&
|
|
||||||
y <= mChartTap.getBottom()) {
|
|
||||||
if (eventTime - chartTapTime < 800) {
|
|
||||||
changeChartTimeframe();
|
|
||||||
}
|
|
||||||
chartTapTime = eventTime;
|
|
||||||
|
|
||||||
} else if (tapType == TAP_TYPE_TAP &&
|
|
||||||
x >= mMainMenuTap.getLeft() &&
|
|
||||||
x <= mMainMenuTap.getRight() &&
|
|
||||||
y >= mMainMenuTap.getTop() &&
|
|
||||||
y <= mMainMenuTap.getBottom()) {
|
|
||||||
if (eventTime - mainMenuTapTime < 800) {
|
|
||||||
Intent intent = new Intent(this, MainMenuActivity.class);
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
mainMenuTapTime = eventTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected WatchFaceStyle getWatchFaceStyle() {
|
|
||||||
return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setColorDark() {
|
|
||||||
|
|
||||||
if (mLinearLayout2 != null) {
|
|
||||||
if (ageLevel() <= 0 && singleBg.getTimeStamp() != 0) {
|
|
||||||
mLinearLayout2.setBackgroundResource(R.drawable.redline);
|
|
||||||
mTimestamp.setTextColor(getResources().getColor(R.color.red_600));
|
|
||||||
} else {
|
|
||||||
mLinearLayout2.setBackgroundResource(0);
|
|
||||||
mTimestamp.setTextColor(getResources().getColor(R.color.black_86p));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mLoop != null) {
|
|
||||||
if (loopLevel == 0) {
|
|
||||||
mLoop.setTextColor(getResources().getColor(R.color.red_600));
|
|
||||||
} else {
|
|
||||||
mLoop.setTextColor(getResources().getColor(R.color.black_86p));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!singleBg.getSgvString().equals("---")) {
|
|
||||||
|
|
||||||
float rotationAngle = 0f; //by default, show ? on the dial (? is at 0 degrees on the dial)
|
|
||||||
|
|
||||||
if (!singleBg.getGlucoseUnits().equals("-")) {
|
|
||||||
|
|
||||||
//ensure the glucose dial is the correct units
|
|
||||||
if (singleBg.getGlucoseUnits().equals("mmol")) {
|
|
||||||
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mmol);
|
|
||||||
} else {
|
|
||||||
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mgdl);
|
|
||||||
}
|
|
||||||
|
|
||||||
//convert the Sgv to degrees of rotation
|
|
||||||
if (singleBg.getGlucoseUnits().equals("mmol")) {
|
|
||||||
rotationAngle = SafeParse.stringToFloat(singleBg.getSgvString()) * 18f; //convert to
|
|
||||||
// mg/dL, which is equivalent to degrees
|
|
||||||
} else {
|
|
||||||
rotationAngle = SafeParse.stringToFloat(singleBg.getSgvString()); //if glucose a value is received, use it to determine the amount of rotation of the dial.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rotationAngle > 330)
|
|
||||||
rotationAngle = 330; //if the glucose value is higher than 330 then show "HIGH" on the dial. ("HIGH" is at 330 degrees on the dial)
|
|
||||||
if (rotationAngle != 0 && rotationAngle < 30)
|
|
||||||
rotationAngle = 30; //if the glucose value is lower than 30 show "LOW" on the dial. ("LOW" is at 30 degrees on the dial)
|
|
||||||
if (lastEndDegrees == 0) lastEndDegrees = rotationAngle;
|
|
||||||
|
|
||||||
//rotate glucose dial
|
|
||||||
RotateAnimation rotate = new RotateAnimation(
|
|
||||||
lastEndDegrees, rotationAngle - lastEndDegrees,
|
|
||||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
|
||||||
Animation.RELATIVE_TO_SELF, 0.5f);
|
|
||||||
rotate.setFillAfter(true);
|
|
||||||
rotate.setInterpolator(new LinearInterpolator());
|
|
||||||
rotate.setDuration(1);
|
|
||||||
mGlucoseDial.startAnimation(rotate);
|
|
||||||
lastEndDegrees = rotationAngle; //store the final angle as a starting point for the next rotation.
|
|
||||||
}
|
|
||||||
|
|
||||||
//set the delta gauge and rotate the delta pointer
|
|
||||||
float deltaIsNegative = 1f; //by default go clockwise
|
|
||||||
if (!singleBg.getAvgDelta().equals("--")) { //if a legitimate delta value is
|
|
||||||
// received,
|
|
||||||
// then...
|
|
||||||
if (singleBg.getAvgDelta().charAt(0) == '-')
|
|
||||||
deltaIsNegative = -1f; //if the delta is negative, go counter-clockwise
|
|
||||||
Float AbssAvgDelta = SafeParse.stringToFloat(singleBg.getAvgDelta().substring(1)); //get rid of the sign so it can be converted to float.
|
|
||||||
String autogranularity = "0"; //autogranularity off
|
|
||||||
//ensure the delta gauge is the right units and granularity
|
|
||||||
if (!singleBg.getGlucoseUnits().equals("-")) {
|
|
||||||
if (singleBg.getGlucoseUnits().equals("mmol")) {
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("4")) { //Auto granularity
|
|
||||||
autogranularity = "1"; // low (init)
|
|
||||||
if (AbssAvgDelta < 0.3) {
|
|
||||||
autogranularity = "3"; // high if below 0.3 mmol/l
|
|
||||||
} else if (AbssAvgDelta < 0.5) {
|
|
||||||
autogranularity = "2"; // medium if below 0.5 mmol/l
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("1") || autogranularity.equals("1")) { //low
|
|
||||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_10);
|
|
||||||
deltaRotationAngle = (AbssAvgDelta * 30f);
|
|
||||||
}
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("2") || autogranularity.equals("2")) { //medium
|
|
||||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_05);
|
|
||||||
deltaRotationAngle = (AbssAvgDelta * 60f);
|
|
||||||
}
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("3") || autogranularity.equals("3")) { //high
|
|
||||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_03);
|
|
||||||
deltaRotationAngle = (AbssAvgDelta * 100f);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("4")) { //Auto granularity
|
|
||||||
autogranularity = "1"; // low (init)
|
|
||||||
if (AbssAvgDelta < 5) {
|
|
||||||
autogranularity = "3"; // high if below 5 mg/dl
|
|
||||||
} else if (AbssAvgDelta < 10) {
|
|
||||||
autogranularity = "2"; // medium if below 10 mg/dl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("1") || autogranularity.equals("1")) { //low
|
|
||||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_20);
|
|
||||||
deltaRotationAngle = (AbssAvgDelta * 1.5f);
|
|
||||||
}
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("2") || autogranularity.equals("2")) { //medium
|
|
||||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_10);
|
|
||||||
deltaRotationAngle = (AbssAvgDelta * 3f);
|
|
||||||
}
|
|
||||||
if (sp.getString("delta_granularity", "2").equals("3") || autogranularity.equals("3")) { //high
|
|
||||||
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_5);
|
|
||||||
deltaRotationAngle = (AbssAvgDelta * 6f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (deltaRotationAngle > 40) deltaRotationAngle = 40f;
|
|
||||||
mDeltaGauge.setRotation(deltaRotationAngle * deltaIsNegative);
|
|
||||||
}
|
|
||||||
|
|
||||||
//rotate the minute hand.
|
|
||||||
mMinuteHand.setRotation(Float.parseFloat(sMinute) * 6f);
|
|
||||||
|
|
||||||
//rotate the hour hand.
|
|
||||||
mHourHand.setRotation((Float.parseFloat(sHour) * 30f) + (Float.parseFloat(sMinute) * 0.5f));
|
|
||||||
|
|
||||||
setTextSizes();
|
|
||||||
|
|
||||||
if (mLoop != null) {
|
|
||||||
mLoop.setBackgroundResource(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (chart != null) {
|
|
||||||
highColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
|
|
||||||
lowColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
|
|
||||||
midColor = ContextCompat.getColor(getApplicationContext(), R.color.black);
|
|
||||||
gridColor = ContextCompat.getColor(getApplicationContext(), R.color.grey_steampunk);
|
|
||||||
basalBackgroundColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
|
||||||
basalCenterColor = ContextCompat.getColor(getApplicationContext(), R.color.basal_dark);
|
|
||||||
if (sp.getInt("chart_timeframe", 3) < 3) {
|
|
||||||
pointSize = 2;
|
|
||||||
} else {
|
|
||||||
pointSize = 1;
|
|
||||||
}
|
|
||||||
setupCharts();
|
|
||||||
}
|
|
||||||
|
|
||||||
invalidate();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setColorLowRes() {
|
|
||||||
setColorDark();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setColorBright() {
|
|
||||||
setColorDark();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setTextSizes() {
|
|
||||||
|
|
||||||
float fontSmall = 10f;
|
|
||||||
float fontMedium = 11f;
|
|
||||||
float fontLarge = 12f;
|
|
||||||
|
|
||||||
if (bIsRound) {
|
|
||||||
fontSmall = 11f;
|
|
||||||
fontMedium = 12f;
|
|
||||||
fontLarge = 13f;
|
|
||||||
}
|
|
||||||
|
|
||||||
//top row. large font unless text too big (i.e. detailedIOB)
|
|
||||||
mCOB2.setTextSize(fontLarge);
|
|
||||||
mBasalRate.setTextSize(fontLarge);
|
|
||||||
if (status.getIobDetail().length() < 7) {
|
|
||||||
mIOB2.setTextSize(fontLarge);
|
|
||||||
} else {
|
|
||||||
mIOB2.setTextSize(fontSmall);
|
|
||||||
}
|
|
||||||
|
|
||||||
//bottom row. font medium unless text too long (i.e. longer than 9' timestamp)
|
|
||||||
if (mTimestamp.getText().length() < 3 || mLoop.getText().length() < 3) { //always resize these fields together, for symmetry.
|
|
||||||
mTimestamp.setTextSize(fontMedium);
|
|
||||||
mLoop.setTextSize(fontMedium);
|
|
||||||
} else {
|
|
||||||
mTimestamp.setTextSize(fontSmall);
|
|
||||||
mLoop.setTextSize(fontSmall);
|
|
||||||
}
|
|
||||||
|
|
||||||
//if both batteries are shown, make them smaller.
|
|
||||||
if (sp.getBoolean("show_uploader_battery", true) && sp.getBoolean(
|
|
||||||
"show_rig_battery", false)) {
|
|
||||||
mUploaderBattery.setTextSize(fontSmall);
|
|
||||||
mRigBattery.setTextSize(fontSmall);
|
|
||||||
} else {
|
|
||||||
mUploaderBattery.setTextSize(fontMedium);
|
|
||||||
mRigBattery.setTextSize(fontMedium);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void changeChartTimeframe() {
|
|
||||||
int timeframe = sp.getInt("chart_timeframe", 3);
|
|
||||||
timeframe = (timeframe % 5) + 1;
|
|
||||||
if (timeframe < 3) {
|
|
||||||
pointSize = 2;
|
|
||||||
} else {
|
|
||||||
pointSize = 1;
|
|
||||||
}
|
|
||||||
setupCharts();
|
|
||||||
sp.putString("chart_timeframe", "" + timeframe);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,248 @@
|
||||||
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
|
package info.nightscout.androidaps.watchfaces
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Intent
|
||||||
|
import android.support.wearable.watchface.WatchFaceStyle
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.animation.Animation
|
||||||
|
import android.view.animation.LinearInterpolator
|
||||||
|
import android.view.animation.RotateAnimation
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import info.nightscout.androidaps.R
|
||||||
|
import info.nightscout.androidaps.interaction.menus.MainMenuActivity
|
||||||
|
import info.nightscout.shared.SafeParse.stringToFloat
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by andrew-warrington on 01/12/2017.
|
||||||
|
* Refactored by MilosKozak on 23/04/2022
|
||||||
|
*/
|
||||||
|
class SteampunkWatchface : BaseWatchFace() {
|
||||||
|
|
||||||
|
private var chartTapTime: Long = 0
|
||||||
|
private var mainMenuTapTime: Long = 0
|
||||||
|
private var lastEndDegrees = 0f
|
||||||
|
private var deltaRotationAngle = 0f
|
||||||
|
|
||||||
|
@SuppressLint("InflateParams")
|
||||||
|
override fun onCreate() {
|
||||||
|
forceSquareCanvas = true
|
||||||
|
super.onCreate()
|
||||||
|
val inflater = getSystemService(LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||||
|
layoutView = inflater.inflate(R.layout.activity_steampunk, null)
|
||||||
|
performViewSetup()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onTapCommand(tapType: Int, x: Int, y: Int, eventTime: Long) {
|
||||||
|
if (tapType == TAP_TYPE_TAP && x >= mChartTap.left && x <= mChartTap.right && y >= mChartTap.top && y <= mChartTap.bottom) {
|
||||||
|
if (eventTime - chartTapTime < 800) {
|
||||||
|
changeChartTimeframe()
|
||||||
|
}
|
||||||
|
chartTapTime = eventTime
|
||||||
|
} else if (tapType == TAP_TYPE_TAP && x >= mMainMenuTap.left && x <= mMainMenuTap.right && y >= mMainMenuTap.top && y <= mMainMenuTap.bottom) {
|
||||||
|
if (eventTime - mainMenuTapTime < 800) {
|
||||||
|
startActivity(Intent(this, MainMenuActivity::class.java).also { it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) })
|
||||||
|
}
|
||||||
|
mainMenuTapTime = eventTime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getWatchFaceStyle(): WatchFaceStyle {
|
||||||
|
return WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setColorDark() {
|
||||||
|
if (mLinearLayout2 != null) {
|
||||||
|
if (ageLevel() <= 0 && singleBg.timeStamp != 0L) {
|
||||||
|
mLinearLayout2.setBackgroundResource(R.drawable.redline)
|
||||||
|
mTimestamp.setTextColor(ContextCompat.getColor(this, R.color.red_600))
|
||||||
|
} else {
|
||||||
|
mLinearLayout2.setBackgroundResource(0)
|
||||||
|
mTimestamp.setTextColor(ContextCompat.getColor(this, R.color.black_86p))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (loopLevel == 0) {
|
||||||
|
mLoop?.setTextColor(ContextCompat.getColor(this, R.color.red_600))
|
||||||
|
} else {
|
||||||
|
mLoop?.setTextColor(ContextCompat.getColor(this, R.color.black_86p))
|
||||||
|
}
|
||||||
|
if (singleBg.sgvString != "---") {
|
||||||
|
var rotationAngle = 0f //by default, show ? on the dial (? is at 0 degrees on the dial)
|
||||||
|
if (singleBg.glucoseUnits != "-") {
|
||||||
|
|
||||||
|
//ensure the glucose dial is the correct units
|
||||||
|
if (singleBg.glucoseUnits == "mmol") {
|
||||||
|
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mmol)
|
||||||
|
} else {
|
||||||
|
mGlucoseDial.setImageResource(R.drawable.steampunk_dial_mgdl)
|
||||||
|
}
|
||||||
|
|
||||||
|
//convert the Sgv to degrees of rotation
|
||||||
|
rotationAngle = if (singleBg.glucoseUnits == "mmol") {
|
||||||
|
stringToFloat(singleBg.sgvString) * 18f //convert to
|
||||||
|
// mg/dL, which is equivalent to degrees
|
||||||
|
} else {
|
||||||
|
stringToFloat(singleBg.sgvString) //if glucose a value is received, use it to determine the amount of rotation of the dial.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rotationAngle > 330) rotationAngle = 330f //if the glucose value is higher than 330 then show "HIGH" on the dial. ("HIGH" is at 330 degrees on the dial)
|
||||||
|
if (rotationAngle != 0f && rotationAngle < 30) rotationAngle = 30f //if the glucose value is lower than 30 show "LOW" on the dial. ("LOW" is at 30 degrees on the dial)
|
||||||
|
if (lastEndDegrees == 0f) lastEndDegrees = rotationAngle
|
||||||
|
|
||||||
|
//rotate glucose dial
|
||||||
|
val rotate = RotateAnimation(
|
||||||
|
lastEndDegrees, rotationAngle - lastEndDegrees,
|
||||||
|
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||||
|
Animation.RELATIVE_TO_SELF, 0.5f
|
||||||
|
)
|
||||||
|
rotate.fillAfter = true
|
||||||
|
rotate.interpolator = LinearInterpolator()
|
||||||
|
rotate.duration = 1
|
||||||
|
mGlucoseDial.startAnimation(rotate)
|
||||||
|
lastEndDegrees = rotationAngle //store the final angle as a starting point for the next rotation.
|
||||||
|
}
|
||||||
|
|
||||||
|
//set the delta gauge and rotate the delta pointer
|
||||||
|
var deltaIsNegative = 1f //by default go clockwise
|
||||||
|
if (singleBg.avgDelta != "--") { //if a legitimate delta value is
|
||||||
|
// received,
|
||||||
|
// then...
|
||||||
|
if (singleBg.avgDelta[0] == '-') deltaIsNegative = -1f //if the delta is negative, go counter-clockwise
|
||||||
|
val absAvgDelta = stringToFloat(singleBg.avgDelta.substring(1)) //get rid of the sign so it can be converted to float.
|
||||||
|
var autoGranularity = "0" //auto-granularity off
|
||||||
|
//ensure the delta gauge is the right units and granularity
|
||||||
|
if (singleBg.glucoseUnits != "-") {
|
||||||
|
if (singleBg.glucoseUnits == "mmol") {
|
||||||
|
if (sp.getString("delta_granularity", "2") == "4") { //Auto granularity
|
||||||
|
autoGranularity = "1" // low (init)
|
||||||
|
if (absAvgDelta < 0.3) {
|
||||||
|
autoGranularity = "3" // high if below 0.3 mmol/l
|
||||||
|
} else if (absAvgDelta < 0.5) {
|
||||||
|
autoGranularity = "2" // medium if below 0.5 mmol/l
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sp.getString("delta_granularity", "2") == "1" || autoGranularity == "1") { //low
|
||||||
|
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_10)
|
||||||
|
deltaRotationAngle = absAvgDelta * 30f
|
||||||
|
}
|
||||||
|
if (sp.getString("delta_granularity", "2") == "2" || autoGranularity == "2") { //medium
|
||||||
|
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_05)
|
||||||
|
deltaRotationAngle = absAvgDelta * 60f
|
||||||
|
}
|
||||||
|
if (sp.getString("delta_granularity", "2") == "3" || autoGranularity == "3") { //high
|
||||||
|
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mmol_03)
|
||||||
|
deltaRotationAngle = absAvgDelta * 100f
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (sp.getString("delta_granularity", "2") == "4") { //Auto granularity
|
||||||
|
autoGranularity = "1" // low (init)
|
||||||
|
if (absAvgDelta < 5) {
|
||||||
|
autoGranularity = "3" // high if below 5 mg/dl
|
||||||
|
} else if (absAvgDelta < 10) {
|
||||||
|
autoGranularity = "2" // medium if below 10 mg/dl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sp.getString("delta_granularity", "2") == "1" || autoGranularity == "1") { //low
|
||||||
|
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_20)
|
||||||
|
deltaRotationAngle = absAvgDelta * 1.5f
|
||||||
|
}
|
||||||
|
if (sp.getString("delta_granularity", "2") == "2" || autoGranularity == "2") { //medium
|
||||||
|
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_10)
|
||||||
|
deltaRotationAngle = absAvgDelta * 3f
|
||||||
|
}
|
||||||
|
if (sp.getString("delta_granularity", "2") == "3" || autoGranularity == "3") { //high
|
||||||
|
mLinearLayout.setBackgroundResource(R.drawable.steampunk_gauge_mgdl_5)
|
||||||
|
deltaRotationAngle = absAvgDelta * 6f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (deltaRotationAngle > 40) deltaRotationAngle = 40f
|
||||||
|
mDeltaGauge.rotation = deltaRotationAngle * deltaIsNegative
|
||||||
|
}
|
||||||
|
|
||||||
|
//rotate the minute hand.
|
||||||
|
mMinuteHand.rotation = sMinute.toFloat() * 6f
|
||||||
|
|
||||||
|
//rotate the hour hand.
|
||||||
|
mHourHand.rotation = sHour.toFloat() * 30f + sMinute.toFloat() * 0.5f
|
||||||
|
setTextSizes()
|
||||||
|
mLoop?.setBackgroundResource(0)
|
||||||
|
if (chart != null) {
|
||||||
|
highColor = ContextCompat.getColor(this, R.color.black)
|
||||||
|
lowColor = ContextCompat.getColor(this, R.color.black)
|
||||||
|
midColor = ContextCompat.getColor(this, R.color.black)
|
||||||
|
gridColor = ContextCompat.getColor(this, R.color.grey_steampunk)
|
||||||
|
basalBackgroundColor = ContextCompat.getColor(this, R.color.basal_dark)
|
||||||
|
basalCenterColor = ContextCompat.getColor(this, R.color.basal_dark)
|
||||||
|
pointSize = if (sp.getInt("chart_timeframe", 3) < 3) {
|
||||||
|
2
|
||||||
|
} else {
|
||||||
|
1
|
||||||
|
}
|
||||||
|
setupCharts()
|
||||||
|
}
|
||||||
|
invalidate()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setColorLowRes() {
|
||||||
|
setColorDark()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setColorBright() {
|
||||||
|
setColorDark()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setTextSizes() {
|
||||||
|
var fontSmall = 10f
|
||||||
|
var fontMedium = 11f
|
||||||
|
var fontLarge = 12f
|
||||||
|
if (bIsRound) {
|
||||||
|
fontSmall = 11f
|
||||||
|
fontMedium = 12f
|
||||||
|
fontLarge = 13f
|
||||||
|
}
|
||||||
|
|
||||||
|
//top row. large font unless text too big (i.e. detailedIOB)
|
||||||
|
mCOB2.textSize = fontLarge
|
||||||
|
mBasalRate.textSize = fontLarge
|
||||||
|
if (status.iobDetail.length < 7) {
|
||||||
|
mIOB2.textSize = fontLarge
|
||||||
|
} else {
|
||||||
|
mIOB2.textSize = fontSmall
|
||||||
|
}
|
||||||
|
|
||||||
|
//bottom row. font medium unless text too long (i.e. longer than 9' timestamp)
|
||||||
|
if (mTimestamp.text.length < 3 || mLoop.text.length < 3) { //always resize these fields together, for symmetry.
|
||||||
|
mTimestamp.textSize = fontMedium
|
||||||
|
mLoop.textSize = fontMedium
|
||||||
|
} else {
|
||||||
|
mTimestamp.textSize = fontSmall
|
||||||
|
mLoop.textSize = fontSmall
|
||||||
|
}
|
||||||
|
|
||||||
|
//if both batteries are shown, make them smaller.
|
||||||
|
if (sp.getBoolean("show_uploader_battery", true) && sp.getBoolean(
|
||||||
|
"show_rig_battery", false
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
mUploaderBattery.textSize = fontSmall
|
||||||
|
mRigBattery.textSize = fontSmall
|
||||||
|
} else {
|
||||||
|
mUploaderBattery.textSize = fontMedium
|
||||||
|
mRigBattery.textSize = fontMedium
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun changeChartTimeframe() {
|
||||||
|
var timeframe = sp.getInt("chart_timeframe", 3)
|
||||||
|
timeframe = timeframe % 5 + 1
|
||||||
|
pointSize = if (timeframe < 3) {
|
||||||
|
2
|
||||||
|
} else {
|
||||||
|
1
|
||||||
|
}
|
||||||
|
setupCharts()
|
||||||
|
sp.putString("chart_timeframe", "" + timeframe)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,116 +1,116 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" tools:context=".watchfaces.Home" tools:deviceIds="wear_square"
|
android:layout_height="match_parent" tools:context=".watchfaces.Home" tools:deviceIds="wear_square"
|
||||||
android:background="@color/black"
|
android:background="@color/black"
|
||||||
android:id="@+id/main_layout">
|
android:id="@+id/main_layout">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:textAlignment="center">
|
android:textAlignment="center">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="-5dp"
|
android:layout_marginTop="-5dp"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="5dp"
|
android:paddingTop="5dp"
|
||||||
android:textAlignment="center">
|
android:textAlignment="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/delta"
|
android:id="@+id/delta"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:gravity="center_vertical|center_horizontal|center"
|
android:gravity="center_vertical|center_horizontal|center"
|
||||||
android:text="---"
|
android:text="---"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="24sp" />
|
android:textSize="24sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sgv"
|
android:id="@+id/sgv"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:text="---"
|
android:text="---"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="45sp" />
|
android:textSize="45sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/avgdelta"
|
android:id="@+id/avgdelta"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:gravity="center_vertical|center_horizontal|center"
|
android:gravity="center_vertical|center_horizontal|center"
|
||||||
android:text=" ---"
|
android:text=" ---"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="26sp" />
|
android:textSize="26sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/dummy1"
|
android:id="@+id/dummy1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2dp"
|
android:layout_height="2dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:gravity="center_horizontal" />
|
android:gravity="center_horizontal" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/aps_status"
|
android:id="@+id/aps_status"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="No Loop Status"
|
android:text="No Loop Status"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="21sp" />
|
android:textSize="21sp" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/dummy2"
|
android:id="@+id/dummy2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2dp"
|
android:layout_height="2dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:gravity="center_horizontal" />
|
android:gravity="center_horizontal" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal|bottom"
|
android:gravity="center_horizontal|bottom"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:textAlignment="center">
|
android:textAlignment="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/watch_time"
|
android:id="@+id/watch_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:text="23:24"
|
android:text="23:24"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="45sp" />
|
android:textSize="45sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/timestamp"
|
android:id="@+id/timestamp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical|center_horizontal"
|
android:layout_gravity="center_vertical|center_horizontal"
|
||||||
android:text="--'"
|
android:text="--'"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="24sp" />
|
android:textSize="24sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
|
@ -4,7 +4,7 @@
|
||||||
android:id="@+id/main_layout"
|
android:id="@+id/main_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".watchfaces.Steampunk"
|
tools:context=".watchfaces.SteampunkWatchface"
|
||||||
tools:deviceIds="wear_square">
|
tools:deviceIds="wear_square">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
|
@ -1,116 +1,116 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" tools:context=".watchfaces.Home" tools:deviceIds="wear_square"
|
android:layout_height="match_parent" tools:context=".watchfaces.Home" tools:deviceIds="wear_square"
|
||||||
android:background="@color/black"
|
android:background="@color/black"
|
||||||
android:id="@+id/main_layout">
|
android:id="@+id/main_layout">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical|center_horizontal"
|
android:gravity="center_vertical|center_horizontal"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:textAlignment="center">
|
android:textAlignment="center">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="-5dp"
|
android:layout_marginTop="-5dp"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="5dp"
|
android:paddingTop="5dp"
|
||||||
android:textAlignment="center">
|
android:textAlignment="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/delta"
|
android:id="@+id/delta"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:gravity="center_vertical|center_horizontal|center"
|
android:gravity="center_vertical|center_horizontal|center"
|
||||||
android:text="---"
|
android:text="---"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="24sp" />
|
android:textSize="24sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sgv"
|
android:id="@+id/sgv"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:text="---"
|
android:text="---"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="45sp" />
|
android:textSize="45sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/avgdelta"
|
android:id="@+id/avgdelta"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:gravity="center_vertical|center_horizontal|center"
|
android:gravity="center_vertical|center_horizontal|center"
|
||||||
android:text=" ---"
|
android:text=" ---"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="26sp" />
|
android:textSize="26sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/dummy1"
|
android:id="@+id/dummy1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2dp"
|
android:layout_height="2dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:gravity="center_horizontal" />
|
android:gravity="center_horizontal" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/aps_status"
|
android:id="@+id/aps_status"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="No Loop Status"
|
android:text="No Loop Status"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="21sp" />
|
android:textSize="21sp" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/dummy2"
|
android:id="@+id/dummy2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2dp"
|
android:layout_height="2dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:gravity="center_horizontal" />
|
android:gravity="center_horizontal" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal|bottom"
|
android:gravity="center_horizontal|bottom"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:textAlignment="center">
|
android:textAlignment="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/watch_time"
|
android:id="@+id/watch_time"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:text="23:24"
|
android:text="23:24"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="45sp" />
|
android:textSize="45sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/timestamp"
|
android:id="@+id/timestamp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical|center_horizontal"
|
android:layout_gravity="center_vertical|center_horizontal"
|
||||||
android:text="--'"
|
android:text="--'"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="24sp" />
|
android:textSize="24sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
|
@ -4,7 +4,7 @@
|
||||||
android:id="@+id/main_layout"
|
android:id="@+id/main_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".watchfaces.Steampunk"
|
tools:context=".watchfaces.SteampunkWatchface"
|
||||||
tools:deviceIds="wear_round">
|
tools:deviceIds="wear_round">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_bigchart"
|
|
||||||
app:roundLayout="@layout/round_activity_bigchart"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_bigchart_small"
|
|
||||||
app:roundLayout="@layout/round_activity_bigchart_small"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_cockpit"
|
|
||||||
app:roundLayout="@layout/round_cockpit"
|
|
||||||
tools:context=".watchfaces.Cockpit"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_digitalstyle"
|
|
||||||
app:roundLayout="@layout/round_activity_digitalstyle"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_home"
|
|
||||||
app:roundLayout="@layout/round_activity_home"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_home_2"
|
|
||||||
app:roundLayout="@layout/round_activity_home_2"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_home_large"
|
|
||||||
app:roundLayout="@layout/round_activity_home_large"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_nochart"
|
|
||||||
app:roundLayout="@layout/round_activity_nochart"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_activity_nochart_small"
|
|
||||||
app:roundLayout="@layout/round_activity_nochart_small"
|
|
||||||
tools:context=".watchfaces.Home"
|
|
||||||
tools:deviceIds="wear"/>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<android.support.wearable.view.WatchViewStub
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/watch_view_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:rectLayout="@layout/rect_steampunk"
|
|
||||||
app:roundLayout="@layout/round_steampunk"
|
|
||||||
tools:context=".watchfaces.Cockpit"
|
|
||||||
tools:deviceIds="wear"/>
|
|
Loading…
Reference in a new issue