//リストビューの内容をcurrentDispDateの内容で更新する void UpdateListView() { //リストビューの初期化 Adapter.ClearAllElement(); //表示できるデータが一件もなければ if (currentDispDate == DateTime.MinValue) { YearText.text = "-"; MonthText.text = "-"; } //表示できるデータがあれば else { //一か月分のデータを表示する SetDataToList(new DateTime(currentDispDate.Year, currentDispDate.Month, 1, 0, 0, 0), new DateTime(currentDispDate.Year, currentDispDate.Month, DateTime.DaysInMonth(currentDispDate.Year, currentDispDate.Month), 23, 59, 59)); //画面の日付表示も更新 if (CSVManager.isInvalidDate(currentDispDate)) { YearText.text = "-"; MonthText.text = "-"; } else { YearText.text = currentDispDate.Year.ToString(); MonthText.text = currentDispDate.Month.ToString() + "月"; } //表示した日付を記録 UserDataManager.Scene.SaveHistoryDate(currentDispDate); } }
void SearchDevice() { //リストを初期化 Adapter.ClearAllElement(); //既にコルーチンが走ってたら終了処理をしてから新しく開始するようにする if (searchDeviceCoroutine != null) { //コルーチン停止 StopCoroutine(searchDeviceCoroutine); //もし既にデバイスと接続済みであれば、検索結果が表示できるように切断を行ってから行う if (UserDataManager.State.isConnectingDevice()) { BluetoothManager.Instance.Disconnect(); } //初期化として検索停止しておく BluetoothManager.Instance.StopScanning(); } searchDeviceCoroutine = StartCoroutine(SearchDeviceFlow()); }