• R/O
  • HTTP
  • SSH
  • HTTPS

tokyorunners: コミット

Tokyo Runnersソースコード及びドキュメント


コミットメタ情報

リビジョン5f83b9b42add8c5c0dda82179122fc95d85bfa96 (tree)
日時2009-12-06 07:50:04
作者kazuhiko <kazhik@oran...>
コミッターkazuhiko

ログメッセージ

bugfix

変更サマリ

差分

--- a/src/net/kazhik/android/tokyorunners/MapMode.java
+++ b/src/net/kazhik/android/tokyorunners/MapMode.java
@@ -145,7 +145,7 @@ public class MapMode extends MapActivity {
145145 || currLon < lonFrom || currLon > lonTo)
146146 && (prevLat < latFrom || prevLat > latTo
147147 || prevLon < lonFrom || prevLon > lonTo)) {
148- // TODO: 両端とも画面外だが画面内を通る場合を考慮
148+ // TODO: 両端とも画面外だが線が画面内を通る場合が考慮されていない
149149 pxStart = null;
150150 // 上記以外の場合は経路を描画
151151 } else {
--- a/src/net/kazhik/android/tokyorunners/RunningHistory.java
+++ b/src/net/kazhik/android/tokyorunners/RunningHistory.java
@@ -33,7 +33,7 @@ public class RunningHistory extends ListActivity implements OnItemClickListener
3333 "yyyy/MM/dd hh:mm:ss");
3434
3535 /** The m_start time map. */
36- private HashMap<Integer, Long> m_startTimeMap = new HashMap<Integer, Long>();
36+ private ArrayList<Long> m_startTimeList = new ArrayList<Long>();
3737
3838 /** The Constant MENU_DELETE_THIS. */
3939 private static final int MENU_DELETE_THIS = Menu.FIRST + 200;
@@ -85,7 +85,7 @@ public class RunningHistory extends ListActivity implements OnItemClickListener
8585 // I need "select distinct"!
8686 continue;
8787 }
88- m_startTimeMap.put(history.size(), startTime);
88+ m_startTimeList.add(startTime);
8989
9090 String[] hist = new String[3];
9191 prevStartTime = startTime;
@@ -128,7 +128,7 @@ public class RunningHistory extends ListActivity implements OnItemClickListener
128128 public void onItemClick(AdapterView<?> parent, View view, int position,
129129 long id) {
130130 Intent returnData = new Intent();
131- long startTime = m_startTimeMap.get(position);
131+ long startTime = m_startTimeList.get(position);
132132
133133 returnData.setAction(Intent.ACTION_VIEW);
134134 returnData.putExtra("startTime", startTime);
@@ -160,7 +160,7 @@ public class RunningHistory extends ListActivity implements OnItemClickListener
160160 long startTime = 0;
161161 switch (item.getItemId()) {
162162 case MENU_DELETE_THIS:
163- startTime = m_startTimeMap.get(position);
163+ startTime = m_startTimeList.get(position);
164164
165165 String selection = RunningRecordProvider.START_TIME + " = ?";
166166 String[] selectionArgs = { Long.toString(startTime) };
@@ -169,6 +169,7 @@ public class RunningHistory extends ListActivity implements OnItemClickListener
169169 selection, selectionArgs);
170170
171171 historyArray.remove(historyArray.getItem(position));
172+ m_startTimeList.remove(position);
172173 break;
173174 case MENU_DELETE_ALL:
174175 getContentResolver().delete(RunningRecordProvider.REC_URI, null,
@@ -176,7 +177,7 @@ public class RunningHistory extends ListActivity implements OnItemClickListener
176177 historyArray.clear();
177178 break;
178179 case MENU_SAVE_GPX:
179- startTime = m_startTimeMap.get(position);
180+ startTime = m_startTimeList.get(position);
180181 saveRecordAsGpxFile(startTime);
181182 break;
182183 default:
--- a/src/net/kazhik/android/tokyorunners/TokyoRunners.java
+++ b/src/net/kazhik/android/tokyorunners/TokyoRunners.java
@@ -538,6 +538,7 @@ public class TokyoRunners extends TabActivity implements LocationListener {
538538 return;
539539 }
540540
541+ String pointName = "";
541542 // 音声出力でスタートを知らせる
542543 Location prevLocation = m_runningRecord.getPrevLocation();
543544 if (prevLocation == null) {
@@ -545,6 +546,7 @@ public class TokyoRunners extends TabActivity implements LocationListener {
545546 AudioManager.STREAM_SYSTEM, ToneGenerator.MAX_VOLUME);
546547 toneGenerator.startTone(ToneGenerator.TONE_PROP_BEEP);
547548 toneGenerator.stopTone();
549+ pointName = getString(R.string.point_start);
548550 }
549551
550552 // 精度が低いデータは無視
@@ -565,8 +567,8 @@ public class TokyoRunners extends TabActivity implements LocationListener {
565567
566568 }
567569
568- String pointName = m_runningRecord.addRecord(location.getTime(),
569- location, "");
570+ pointName = m_runningRecord.addRecord(location.getTime(),
571+ location, pointName);
570572
571573 // ラップタイム履歴
572574 if (pointName.length() > 0) {
@@ -639,6 +641,7 @@ public class TokyoRunners extends TabActivity implements LocationListener {
639641
640642 long currentTime = System.currentTimeMillis();
641643 Location startPoint = null;
644+ String pointName = "";
642645 if (m_useGPS) {
643646 startPoint = m_locMgr
644647 .getLastKnownLocation(LocationManager.GPS_PROVIDER);
@@ -650,10 +653,10 @@ public class TokyoRunners extends TabActivity implements LocationListener {
650653 startPoint = null;
651654 } else {
652655 currentTime = startPoint.getTime();
656+ pointName = getString(R.string.point_start);
653657 }
654658 }
655- m_runningRecord.addRecord(currentTime, startPoint,
656- getString(R.string.point_start));
659+ m_runningRecord.addRecord(currentTime, startPoint, pointName);
657660 m_running = true;
658661
659662 Button startStopButton = (Button) findViewById(R.id.button_start_stop);
旧リポジトリブラウザで表示