diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index d93cd1fa83..a2e5cf0925 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -84,14 +84,15 @@ class ActionsFragment : DaggerFragment() { // This property is only valid between onCreateView and onDestroyView. 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 dm = DisplayMetrics() if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) { @Suppress("DEPRECATION") activity?.display?.getRealMetrics(dm) } else { - @Suppress("DEPRECATION") activity?.windowManager?.defaultDisplay?.getMetrics(dm) + @Suppress("DEPRECATION") + activity?.windowManager?.defaultDisplay?.getMetrics(dm) } _binding = ActionsFragmentBinding.inflate(inflater, container, false) return binding.root diff --git a/wear/src/main/AndroidManifest.xml b/wear/src/main/AndroidManifest.xml index d7041e76cb..0964bca9fe 100644 --- a/wear/src/main/AndroidManifest.xml +++ b/wear/src/main/AndroidManifest.xml @@ -146,7 +146,7 @@ (R.id.confirmbutton) confirmButton.setOnClickListener { val returnCommand = deserialize(actionKey) diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.kt index 979ba52887..e7e8b56355 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.kt @@ -44,7 +44,7 @@ class BolusActivity : ViewSelectorActivity() { container.addView(view) view.requestFocus() } 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(R.id.confirmbutton) confirmButton.setOnClickListener { rxBus.send(EventWearToMobile(ActionBolusPreCheck(SafeParse.stringToDouble(editInsulin?.editText?.text.toString()), 0))) diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CarbActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CarbActivity.kt index 44d226debd..4dd487bb79 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CarbActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CarbActivity.kt @@ -47,7 +47,7 @@ class CarbActivity : ViewSelectorActivity() { container.addView(view) view.requestFocus() } 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(R.id.confirmbutton) confirmButton.setOnClickListener { // With start time 0 and duration 0 diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.kt index c0207f6baa..21d7b41f31 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.kt @@ -70,7 +70,7 @@ class ECarbActivity : ViewSelectorActivity() { container.addView(view) view } 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(R.id.confirmbutton) confirmButton.setOnClickListener { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.kt index 20e9346174..a10163e466 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.kt @@ -46,7 +46,7 @@ class FillActivity : ViewSelectorActivity() { view.requestFocus() view } 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(R.id.confirmbutton) confirmButton.setOnClickListener { //check if it can happen that the fragment is never created that hold data? diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ProfileSwitchActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ProfileSwitchActivity.kt index 0ee7ec7ba3..73b9551b53 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ProfileSwitchActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ProfileSwitchActivity.kt @@ -66,7 +66,7 @@ class ProfileSwitchActivity : ViewSelectorActivity() { container.addView(view) view } 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(R.id.confirmbutton) confirmButton.setOnClickListener { //check if it can happen that the fragment is never created that hold data? diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.kt index d999a61eb1..cab25b52eb 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.kt @@ -88,7 +88,7 @@ class TempTargetActivity : ViewSelectorActivity() { container.addView(view) view } 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(R.id.confirmbutton) confirmButton.setOnClickListener { //check if it can happen that the fragment is never created that hold data? diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TreatmentActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TreatmentActivity.kt index 661d4cb421..ed504969b1 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TreatmentActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TreatmentActivity.kt @@ -56,7 +56,7 @@ class TreatmentActivity : ViewSelectorActivity() { container.addView(view) view } 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(R.id.confirmbutton) confirmButton.setOnClickListener { //check if it can happen that the fragment is never created that hold data? diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.kt index 2443c0923a..53247573a7 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.kt @@ -63,7 +63,7 @@ class WizardActivity : ViewSelectorActivity() { container.addView(view) view } 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(R.id.confirmbutton) confirmButton.setOnClickListener { val action = ActionWizardPreCheck( diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java index cd56d3fd0a..475a9d654b 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BIGChart.java @@ -180,23 +180,18 @@ public class BIGChart extends WatchFace { } public void performViewSetup() { - final WatchViewStub stub = layoutView.findViewById(R.id.watch_view_stub); - - stub.setOnLayoutInflatedListener(stub1 -> { - mTime = stub1.findViewById(R.id.watch_time); - mSgv = stub1.findViewById(R.id.sgv); - mTimestamp = stub1.findViewById(R.id.timestamp); - mDelta = stub1.findViewById(R.id.delta); - mAvgDelta = stub1.findViewById(R.id.avgdelta); - mRelativeLayout = stub1.findViewById(R.id.main_layout); - chart = stub1.findViewById(R.id.chart); - statusView = stub1.findViewById(R.id.aps_status); - layoutSet = true; - showAgeAndStatus(); - mRelativeLayout.measure(specW, specH); - mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), - mRelativeLayout.getMeasuredHeight()); - }); + mTime = layoutView.findViewById(R.id.watch_time); + mSgv = layoutView.findViewById(R.id.sgv); + mTimestamp = layoutView.findViewById(R.id.timestamp); + mDelta = layoutView.findViewById(R.id.delta); + mAvgDelta = layoutView.findViewById(R.id.avgdelta); + mRelativeLayout = layoutView.findViewById(R.id.main_layout); + chart = layoutView.findViewById(R.id.chart); + statusView = layoutView.findViewById(R.id.aps_status); + layoutSet = true; + showAgeAndStatus(); + mRelativeLayout.measure(specW, specH); + mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), mRelativeLayout.getMeasuredHeight()); rxBus.send(new EventWearToMobile(new EventData.ActionResendData("BIGChart:performViewSetup"))); wakeLock.acquire(50); } @@ -251,6 +246,7 @@ public class BIGChart extends WatchFace { } + @SuppressWarnings("deprecation") @Override protected WatchFaceStyle getWatchFaceStyle() { return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.java index 7668b8ce40..d34dcfb31c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.java @@ -71,15 +71,9 @@ public abstract class BaseWatchFace extends WatchFace { CompositeDisposable disposable = new CompositeDisposable(); - protected EventData.SingleBg singleBg = new EventData.SingleBg(0, "---", "-", "--", "--", "--" - , 0, 0.0, 0.0, 0.0, 0); + protected EventData.SingleBg singleBg = new EventData.SingleBg(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.TreatmentData treatmentData = new EventData.TreatmentData( - new ArrayList<>(), - new ArrayList<>(), - new ArrayList<>(), - new ArrayList<>() - ); + protected EventData.TreatmentData treatmentData = new EventData.TreatmentData(new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>()); protected EventData.GraphData graphData = new EventData.GraphData(new ArrayList<>()); static IntentFilter iFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); @@ -174,15 +168,11 @@ public abstract class BaseWatchFace extends WatchFace { .subscribe(event -> { status = event; // this event is received as last batch of data - if (isSimpleUi()) { - if (needUpdate()) { - invalidate(); - } - } else { + if (!isSimpleUi() || !needUpdate()) { setupCharts(); setDataFields(); - invalidate(); } + invalidate(); }) ); @@ -260,50 +250,47 @@ public abstract class BaseWatchFace extends WatchFace { } public void performViewSetup() { - final WatchViewStub layoutStub = layoutView.findViewById(R.id.watch_view_stub); - - layoutStub.setOnLayoutInflatedListener((WatchViewStub stub) -> { - mTime = stub.findViewById(R.id.watch_time); - mHour = stub.findViewById(R.id.hour); - mMinute = stub.findViewById(R.id.minute); - mTimePeriod = stub.findViewById(R.id.timePeriod); - mDay = stub.findViewById(R.id.day); - mDayName = stub.findViewById(R.id.dayname); - mMonth = stub.findViewById(R.id.month); - mDate = stub.findViewById(R.id.date_time); - mLoop = stub.findViewById(R.id.loop); - mSgv = stub.findViewById(R.id.sgv); - mDirection = stub.findViewById(R.id.direction); - mTimestamp = stub.findViewById(R.id.timestamp); - mIOB1 = stub.findViewById(R.id.iob_text); - mIOB2 = stub.findViewById(R.id.iobView); - mCOB1 = stub.findViewById(R.id.cob_text); - mCOB2 = stub.findViewById(R.id.cobView); - mBgi = stub.findViewById(R.id.bgiView); - mStatus = stub.findViewById(R.id.externaltstatus); - mBasalRate = stub.findViewById(R.id.tmpBasal); - mUploaderBattery = stub.findViewById(R.id.uploader_battery); - mRigBattery = stub.findViewById(R.id.rig_battery); - mDelta = stub.findViewById(R.id.delta); - mAvgDelta = stub.findViewById(R.id.avgdelta); - isAAPSv2 = stub.findViewById(R.id.AAPSv2); - mHighLight = stub.findViewById(R.id.highLight); - mLowLight = stub.findViewById(R.id.lowLight); - mRelativeLayout = stub.findViewById(R.id.main_layout); - mLinearLayout = stub.findViewById(R.id.secondary_layout); - mLinearLayout2 = stub.findViewById(R.id.tertiary_layout); - mGlucoseDial = stub.findViewById(R.id.glucose_dial); - mDeltaGauge = stub.findViewById(R.id.delta_pointer); - mHourHand = stub.findViewById(R.id.hour_hand); - mMinuteHand = stub.findViewById(R.id.minute_hand); - mChartTap = stub.findViewById(R.id.chart_zoom_tap); - mMainMenuTap = stub.findViewById(R.id.main_menu_tap); - chart = stub.findViewById(R.id.chart); + mTime = layoutView.findViewById(R.id.watch_time); + mHour = layoutView.findViewById(R.id.hour); + mMinute = layoutView.findViewById(R.id.minute); + mTimePeriod = layoutView.findViewById(R.id.timePeriod); + mDay = layoutView.findViewById(R.id.day); + mDayName = layoutView.findViewById(R.id.dayname); + mMonth = layoutView.findViewById(R.id.month); + mDate = layoutView.findViewById(R.id.date_time); + mLoop = layoutView.findViewById(R.id.loop); + mSgv = layoutView.findViewById(R.id.sgv); + mDirection = layoutView.findViewById(R.id.direction); + mTimestamp = layoutView.findViewById(R.id.timestamp); + mIOB1 = layoutView.findViewById(R.id.iob_text); + mIOB2 = layoutView.findViewById(R.id.iobView); + mCOB1 = layoutView.findViewById(R.id.cob_text); + mCOB2 = layoutView.findViewById(R.id.cobView); + mBgi = layoutView.findViewById(R.id.bgiView); + mStatus = layoutView.findViewById(R.id.externaltstatus); + mBasalRate = layoutView.findViewById(R.id.tmpBasal); + mUploaderBattery = layoutView.findViewById(R.id.uploader_battery); + mRigBattery = layoutView.findViewById(R.id.rig_battery); + mDelta = layoutView.findViewById(R.id.delta); + mAvgDelta = layoutView.findViewById(R.id.avgdelta); + isAAPSv2 = layoutView.findViewById(R.id.AAPSv2); + mHighLight = layoutView.findViewById(R.id.highLight); + mLowLight = layoutView.findViewById(R.id.lowLight); + mRelativeLayout = layoutView.findViewById(R.id.main_layout); + mLinearLayout = layoutView.findViewById(R.id.secondary_layout); + mLinearLayout2 = layoutView.findViewById(R.id.tertiary_layout); + mGlucoseDial = layoutView.findViewById(R.id.glucose_dial); + mDeltaGauge = layoutView.findViewById(R.id.delta_pointer); + mHourHand = layoutView.findViewById(R.id.hour_hand); + mMinuteHand = layoutView.findViewById(R.id.minute_hand); + mChartTap = layoutView.findViewById(R.id.chart_zoom_tap); + mMainMenuTap = layoutView.findViewById(R.id.main_menu_tap); + chart = layoutView.findViewById(R.id.chart); layoutSet = true; setupCharts(); setDataFields(); missedReadingAlert(); - }); + wakeLock.acquire(50); } diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java index d80b3e43d5..b9affede77 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/CircleWatchface.java @@ -100,7 +100,7 @@ public class CircleWatchface extends WatchFace { //register Message Receiver 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(); prepareDrawTime(); @@ -507,6 +507,7 @@ public class CircleWatchface extends WatchFace { addArch(canvas, (offset + .8f) * offsetMultiplier + 11, getBackgroundColor(), 360); } + @SuppressWarnings("deprecation") @Override protected void onTapCommand(int tapType, int x, int y, long eventTime) { if (mSgv == null) return; diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java index 9ac98fe0ce..5590b5ce70 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java @@ -38,6 +38,7 @@ public class Cockpit extends BaseWatchFace { } } + @SuppressWarnings("deprecation") @Override protected WatchFaceStyle getWatchFaceStyle() { return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle.java index b44f3c95dd..a780b14ff8 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle.java @@ -47,6 +47,7 @@ public class DigitalStyle extends BaseWatchFace { } + @SuppressWarnings("deprecation") @Override protected WatchFaceStyle getWatchFaceStyle() { return new WatchFaceStyle.Builder(this) diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java index fb15053f51..6c5a2eb0e2 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home.java @@ -59,6 +59,7 @@ public class Home extends BaseWatchFace { sp.putString("chart_timeframe", "" + timeframe); } + @SuppressWarnings("deprecation") @Override protected WatchFaceStyle getWatchFaceStyle(){ return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java index 21a600ce5f..6ffec5d910 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Home2.java @@ -63,6 +63,7 @@ public class Home2 extends BaseWatchFace { sp.putString("chart_timeframe", "" + timeframe); } + @SuppressWarnings("deprecation") @Override protected WatchFaceStyle getWatchFaceStyle() { return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/LargeHome.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/LargeHome.java index 29774131ef..7ba6053ad4 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/LargeHome.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/LargeHome.java @@ -43,6 +43,7 @@ public class LargeHome extends BaseWatchFace { } } + @SuppressWarnings("deprecation") @Override protected WatchFaceStyle getWatchFaceStyle(){ return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java index 4091e9a8db..9524b63772 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/NOChart.java @@ -148,24 +148,18 @@ public class NOChart extends WatchFace { } public void performViewSetup() { - final WatchViewStub stub = layoutView.findViewById(R.id.watch_view_stub); - - stub.setOnLayoutInflatedListener(stub1 -> { - mTime = stub1.findViewById(R.id.watch_time); - mSgv = stub1.findViewById(R.id.sgv); - mTimestamp = stub1.findViewById(R.id.timestamp); - mDelta = stub1.findViewById(R.id.delta); - mAvgDelta = stub1.findViewById(R.id.avgdelta); - mRelativeLayout = stub1.findViewById(R.id.main_layout); - statusView = stub1.findViewById(R.id.aps_status); - layoutSet = true; - showAgeAndStatus(); - mRelativeLayout.measure(specW, specH); - mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), - mRelativeLayout.getMeasuredHeight()); - }); - rxBus.send(new EventWearToMobile(new EventData.ActionResendData("NOChart" + - ":performViewSetup"))); + mTime = layoutView.findViewById(R.id.watch_time); + mSgv = layoutView.findViewById(R.id.sgv); + mTimestamp = layoutView.findViewById(R.id.timestamp); + mDelta = layoutView.findViewById(R.id.delta); + mAvgDelta = layoutView.findViewById(R.id.avgdelta); + mRelativeLayout = layoutView.findViewById(R.id.main_layout); + statusView = layoutView.findViewById(R.id.aps_status); + layoutSet = true; + showAgeAndStatus(); + mRelativeLayout.measure(specW, specH); + mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), mRelativeLayout.getMeasuredHeight()); + rxBus.send(new EventWearToMobile(new EventData.ActionResendData("NOChart:performViewSetup"))); wakeLock.acquire(50); } @@ -204,6 +198,7 @@ public class NOChart extends WatchFace { } + @SuppressWarnings("deprecation") @Override protected WatchFaceStyle getWatchFaceStyle() { return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java deleted file mode 100644 index 13791efd06..0000000000 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java +++ /dev/null @@ -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); - } -} diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/SteampunkWatchface.kt b/wear/src/main/java/info/nightscout/androidaps/watchfaces/SteampunkWatchface.kt new file mode 100644 index 0000000000..924032b773 --- /dev/null +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/SteampunkWatchface.kt @@ -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) + } +} \ No newline at end of file diff --git a/wear/src/main/res/layout/rect_activity_bigchart.xml b/wear/src/main/res/layout-notround/activity_bigchart.xml similarity index 100% rename from wear/src/main/res/layout/rect_activity_bigchart.xml rename to wear/src/main/res/layout-notround/activity_bigchart.xml diff --git a/wear/src/main/res/layout/rect_activity_bigchart_small.xml b/wear/src/main/res/layout-notround/activity_bigchart_small.xml similarity index 100% rename from wear/src/main/res/layout/rect_activity_bigchart_small.xml rename to wear/src/main/res/layout-notround/activity_bigchart_small.xml diff --git a/wear/src/main/res/layout/rect_cockpit.xml b/wear/src/main/res/layout-notround/activity_cockpit.xml similarity index 100% rename from wear/src/main/res/layout/rect_cockpit.xml rename to wear/src/main/res/layout-notround/activity_cockpit.xml diff --git a/wear/src/main/res/layout/rect_activity_digitalstyle.xml b/wear/src/main/res/layout-notround/activity_digitalstyle.xml similarity index 100% rename from wear/src/main/res/layout/rect_activity_digitalstyle.xml rename to wear/src/main/res/layout-notround/activity_digitalstyle.xml diff --git a/wear/src/main/res/layout/rect_activity_home.xml b/wear/src/main/res/layout-notround/activity_home.xml similarity index 100% rename from wear/src/main/res/layout/rect_activity_home.xml rename to wear/src/main/res/layout-notround/activity_home.xml diff --git a/wear/src/main/res/layout/rect_activity_home_2.xml b/wear/src/main/res/layout-notround/activity_home_2.xml similarity index 100% rename from wear/src/main/res/layout/rect_activity_home_2.xml rename to wear/src/main/res/layout-notround/activity_home_2.xml diff --git a/wear/src/main/res/layout/rect_activity_home_large.xml b/wear/src/main/res/layout-notround/activity_home_large.xml similarity index 100% rename from wear/src/main/res/layout/rect_activity_home_large.xml rename to wear/src/main/res/layout-notround/activity_home_large.xml diff --git a/wear/src/main/res/layout/rect_activity_nochart.xml b/wear/src/main/res/layout-notround/activity_nochart.xml similarity index 100% rename from wear/src/main/res/layout/rect_activity_nochart.xml rename to wear/src/main/res/layout-notround/activity_nochart.xml diff --git a/wear/src/main/res/layout/rect_activity_nochart_small.xml b/wear/src/main/res/layout-notround/activity_nochart_small.xml similarity index 97% rename from wear/src/main/res/layout/rect_activity_nochart_small.xml rename to wear/src/main/res/layout-notround/activity_nochart_small.xml index 2a4eae4f7e..7d57161c31 100644 --- a/wear/src/main/res/layout/rect_activity_nochart_small.xml +++ b/wear/src/main/res/layout-notround/activity_nochart_small.xml @@ -1,116 +1,116 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wear/src/main/res/layout/rect_steampunk.xml b/wear/src/main/res/layout-notround/activity_steampunk.xml similarity index 99% rename from wear/src/main/res/layout/rect_steampunk.xml rename to wear/src/main/res/layout-notround/activity_steampunk.xml index 771a03b619..e56d515d1b 100644 --- a/wear/src/main/res/layout/rect_steampunk.xml +++ b/wear/src/main/res/layout-notround/activity_steampunk.xml @@ -4,7 +4,7 @@ android:id="@+id/main_layout" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".watchfaces.Steampunk" + tools:context=".watchfaces.SteampunkWatchface" tools:deviceIds="wear_square"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wear/src/main/res/layout/round_steampunk.xml b/wear/src/main/res/layout-round/activity_steampunk.xml similarity index 99% rename from wear/src/main/res/layout/round_steampunk.xml rename to wear/src/main/res/layout-round/activity_steampunk.xml index 12ff642119..78f9c52383 100644 --- a/wear/src/main/res/layout/round_steampunk.xml +++ b/wear/src/main/res/layout-round/activity_steampunk.xml @@ -4,7 +4,7 @@ android:id="@+id/main_layout" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".watchfaces.Steampunk" + tools:context=".watchfaces.SteampunkWatchface" tools:deviceIds="wear_round"> - diff --git a/wear/src/main/res/layout/activity_bigchart_small.xml b/wear/src/main/res/layout/activity_bigchart_small.xml deleted file mode 100644 index 34ca885a09..0000000000 --- a/wear/src/main/res/layout/activity_bigchart_small.xml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/wear/src/main/res/layout/modern_layout.xml b/wear/src/main/res/layout/activity_circle.xml similarity index 100% rename from wear/src/main/res/layout/modern_layout.xml rename to wear/src/main/res/layout/activity_circle.xml diff --git a/wear/src/main/res/layout/activity_cockpit.xml b/wear/src/main/res/layout/activity_cockpit.xml deleted file mode 100644 index 06c1cd036d..0000000000 --- a/wear/src/main/res/layout/activity_cockpit.xml +++ /dev/null @@ -1,12 +0,0 @@ - - \ No newline at end of file diff --git a/wear/src/main/res/layout/activity_digitalstyle.xml b/wear/src/main/res/layout/activity_digitalstyle.xml deleted file mode 100644 index 5fd23a86b7..0000000000 --- a/wear/src/main/res/layout/activity_digitalstyle.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - \ No newline at end of file diff --git a/wear/src/main/res/layout/activity_home.xml b/wear/src/main/res/layout/activity_home.xml deleted file mode 100644 index a536938f68..0000000000 --- a/wear/src/main/res/layout/activity_home.xml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/wear/src/main/res/layout/activity_home_2.xml b/wear/src/main/res/layout/activity_home_2.xml deleted file mode 100644 index 1b3dd0be51..0000000000 --- a/wear/src/main/res/layout/activity_home_2.xml +++ /dev/null @@ -1,12 +0,0 @@ - - \ No newline at end of file diff --git a/wear/src/main/res/layout/activity_home_large.xml b/wear/src/main/res/layout/activity_home_large.xml deleted file mode 100644 index adff439ea1..0000000000 --- a/wear/src/main/res/layout/activity_home_large.xml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/wear/src/main/res/layout/activity_nochart.xml b/wear/src/main/res/layout/activity_nochart.xml deleted file mode 100644 index 4b7198aa78..0000000000 --- a/wear/src/main/res/layout/activity_nochart.xml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/wear/src/main/res/layout/activity_nochart_small.xml b/wear/src/main/res/layout/activity_nochart_small.xml deleted file mode 100644 index 955a214580..0000000000 --- a/wear/src/main/res/layout/activity_nochart_small.xml +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/wear/src/main/res/layout/activity_steampunk.xml b/wear/src/main/res/layout/activity_steampunk.xml deleted file mode 100644 index 3fa994d818..0000000000 --- a/wear/src/main/res/layout/activity_steampunk.xml +++ /dev/null @@ -1,12 +0,0 @@ - - \ No newline at end of file