OSDN Git Service

グラフ表示モードを標準にした。
authorMRSa <mrsa@myad.jp>
Sun, 8 Apr 2018 09:56:01 +0000 (18:56 +0900)
committerMRSa <mrsa@myad.jp>
Sun, 8 Apr 2018 09:56:01 +0000 (18:56 +0900)
wear/src/main/java/net/osdn/gokigen/joggingtimer/stopwatch/MainActivity.java
wear/src/main/java/net/osdn/gokigen/joggingtimer/stopwatch/graphview/LapTimeGraphView.java

index 89758e4..e1f1254 100644 (file)
@@ -33,7 +33,7 @@ public class MainActivity extends WearableActivity implements IClickCallback, My
     private final IWearableActivityControl controller = new WearableActivityController();
     private MyTimerCounter counter = new MyTimerCounter();
     private boolean isCounterLapTime = true;
-    private boolean isLaptimeView = false;
+    private boolean isLaptimeView = true;
     private int currentLapCount = 0;
     private ITimerStopTrigger stopTrigger = null;
 
@@ -90,9 +90,6 @@ public class MainActivity extends WearableActivity implements IClickCallback, My
             // start a timer!
             startTimer();
         }
-
-        // 表示ビューの切り替え
-        changeGraphicView(isLaptimeView);
     }
 
     /**
@@ -669,7 +666,13 @@ public class MainActivity extends WearableActivity implements IClickCallback, My
             @Override
             public void run()
             {
+                // ラップタイム表示状態の更新
                 reloadLapTimeList(forceStartTimer);
+
+                // 表示ビューの切り替え
+                changeGraphicView(isLaptimeView);
+
+                // 表示のボタン状態を変更
                 updateTimerLabel();
             }
         });
index 1b27071..f3bd769 100644 (file)
@@ -25,7 +25,6 @@ public class LapTimeGraphView extends View
     private boolean isStarted = false;
     private long maxLaptime = 0;
     private long lastSystemLaptime = 0;
-    //private long currentLapTime = 0;
     private int totalLaptimeCount = 0;
 
     private List<Long> refTimeList = null;
@@ -332,6 +331,10 @@ public class LapTimeGraphView extends View
         refLapTimeList = null;
 
         refTimeList = timerCounter.getReferenceLapTimeList();
+        if (refTimeList == null)
+        {
+            return;
+        }
         totalLaptimeCount = refTimeList.size();
         maxLaptime = 0;
         if (totalLaptimeCount <= 1)