From a69c1150eac74717e62f0117fe50a5cafa23c0e7 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Fri, 25 Nov 2016 21:29:46 +0100 Subject: [PATCH] tap tests --- .idea/misc.xml | 2 +- wear/build.gradle | 15 +++++++-- .../info/nightscout/androidaps/BIGChart.java | 23 ++++++++++--- .../nightscout/androidaps/BaseWatchFace.java | 6 ++-- .../androidaps/CircleWatchface.java | 4 +-- .../java/info/nightscout/androidaps/Home.java | 4 ++- .../info/nightscout/androidaps/LargeHome.java | 2 +- wear/wear.iml | 32 +++++++++---------- 8 files changed, 58 insertions(+), 30 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb68289f4..5d19981032 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/wear/build.gradle b/wear/build.gradle index 53251f7db6..1b546ec267 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -34,10 +34,21 @@ android { } } +allprojects { + repositories { + jcenter() + flatDir { + dirs 'libs' + } + } +} + + dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.ustwo.android:clockwise-wearable:1.0.2' - compile 'com.google.android.support:wearable:1.1.0' + //compile 'com.ustwo.android:clockwise-wearable:1.0.2' + compile 'com.google.android.support:wearable:1.4.0' compile 'com.google.android.gms:play-services-wearable:7.3.0' compile files('libs/hellocharts-library-1.5.5.jar') + compile(name:'ustwo-clockwise-debug', ext:'aar') } diff --git a/wear/src/main/java/info/nightscout/androidaps/BIGChart.java b/wear/src/main/java/info/nightscout/androidaps/BIGChart.java index 64d125115e..7aa00d2d79 100644 --- a/wear/src/main/java/info/nightscout/androidaps/BIGChart.java +++ b/wear/src/main/java/info/nightscout/androidaps/BIGChart.java @@ -18,6 +18,7 @@ import android.os.PowerManager; import android.preference.PreferenceManager; import android.support.v4.content.LocalBroadcastManager; import android.support.wearable.view.WatchViewStub; +import android.support.wearable.watchface.WatchFaceStyle; import android.text.format.DateFormat; import android.util.Log; import android.view.Display; @@ -29,10 +30,11 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.google.android.gms.wearable.DataMap; -import com.ustwo.clockwise.WatchFace; -import com.ustwo.clockwise.WatchFaceTime; -import com.ustwo.clockwise.WatchMode; -import com.ustwo.clockwise.WatchShape; +import com.ustwo.clockwise.wearable.WatchFace; +import com.ustwo.clockwise.common.WatchFaceTime; +import com.ustwo.clockwise.common.WatchMode; +import com.ustwo.clockwise.common.WatchShape; +import com.ustwo.clockwise.common.util.Logr; import java.util.ArrayList; import java.util.Date; @@ -135,6 +137,19 @@ public class BIGChart extends WatchFace implements SharedPreferences.OnSharedPre wakeLock.acquire(50); } + @Override + protected void onTapCommand(int tapType, int x, int y, long eventTime) { + statusView.setText("x:" + x +" y:" + y + " t:" + tapType); + invalidate(); + } + + @Override + protected WatchFaceStyle getWatchFaceStyle(){ + return new WatchFaceStyle.Builder(this).setAcceptsTapEvents(true).build(); + } + + + public int ageLevel() { if(timeSince() <= (1000 * 60 * 12)) { return 1; diff --git a/wear/src/main/java/info/nightscout/androidaps/BaseWatchFace.java b/wear/src/main/java/info/nightscout/androidaps/BaseWatchFace.java index cf64467a4e..06891d8d5f 100644 --- a/wear/src/main/java/info/nightscout/androidaps/BaseWatchFace.java +++ b/wear/src/main/java/info/nightscout/androidaps/BaseWatchFace.java @@ -26,9 +26,9 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.google.android.gms.wearable.DataMap; -import com.ustwo.clockwise.WatchFace; -import com.ustwo.clockwise.WatchFaceTime; -import com.ustwo.clockwise.WatchShape; +import com.ustwo.clockwise.wearable.WatchFace; +import com.ustwo.clockwise.common.WatchFaceTime; +import com.ustwo.clockwise.common.WatchShape; import java.util.ArrayList; import java.util.Date; diff --git a/wear/src/main/java/info/nightscout/androidaps/CircleWatchface.java b/wear/src/main/java/info/nightscout/androidaps/CircleWatchface.java index f59647d218..c81b6de6f1 100644 --- a/wear/src/main/java/info/nightscout/androidaps/CircleWatchface.java +++ b/wear/src/main/java/info/nightscout/androidaps/CircleWatchface.java @@ -26,8 +26,8 @@ import android.view.WindowManager; import android.widget.TextView; import com.google.android.gms.wearable.DataMap; -import com.ustwo.clockwise.WatchFace; -import com.ustwo.clockwise.WatchFaceTime; +import com.ustwo.clockwise.wearable.WatchFace; +import com.ustwo.clockwise.common.WatchFaceTime; import java.util.ArrayList; import java.util.Calendar; diff --git a/wear/src/main/java/info/nightscout/androidaps/Home.java b/wear/src/main/java/info/nightscout/androidaps/Home.java index c600326235..ba157b82e1 100644 --- a/wear/src/main/java/info/nightscout/androidaps/Home.java +++ b/wear/src/main/java/info/nightscout/androidaps/Home.java @@ -3,10 +3,12 @@ package info.nightscout.androidaps; import android.graphics.Color; import android.view.LayoutInflater; -import com.ustwo.clockwise.WatchMode; +import com.ustwo.clockwise.common.WatchMode; import lecho.lib.hellocharts.util.ChartUtils; +import static android.content.Context.LAYOUT_INFLATER_SERVICE; + public class Home extends BaseWatchFace { @Override diff --git a/wear/src/main/java/info/nightscout/androidaps/LargeHome.java b/wear/src/main/java/info/nightscout/androidaps/LargeHome.java index 59fb4a11e7..da9cf19a51 100644 --- a/wear/src/main/java/info/nightscout/androidaps/LargeHome.java +++ b/wear/src/main/java/info/nightscout/androidaps/LargeHome.java @@ -3,7 +3,7 @@ package info.nightscout.androidaps; import android.graphics.Color; import android.view.LayoutInflater; -import com.ustwo.clockwise.WatchMode; +import com.ustwo.clockwise.common.WatchMode; public class LargeHome extends BaseWatchFace { diff --git a/wear/wear.iml b/wear/wear.iml index 0d2683ce42..13caf1cb90 100644 --- a/wear/wear.iml +++ b/wear/wear.iml @@ -43,6 +43,13 @@ + + + + + + + @@ -51,13 +58,6 @@ - - - - - - - @@ -126,12 +126,12 @@ - - + + - - + + @@ -147,13 +147,13 @@ + + - + + - - - - + \ No newline at end of file