CreateRoot #2

Merged
Utahshi merged 3 commits from CreateRoot into master 2024-06-19 04:55:23 +00:00
3 changed files with 34 additions and 5 deletions
Showing only changes of commit 38a565c392 - Show all commits

View File

@ -1,5 +1,29 @@
package com.example.oplogy;
public class CreateRoot {
import android.util.Log;
}
import com.google.android.gms.maps.model.LatLng;
import com.google.firebase.Timestamp;
public class CreateRoot {
private String address;
private Timestamp startTimestamp;
private Timestamp endTimestamp;
private long studentNumber;
private LatLng latLng;
public void receiveData(String address, Timestamp startTimestamp, Timestamp endTimestamp, long studentNumber, LatLng latLng) {
this.address = address;
this.startTimestamp = startTimestamp;
this.endTimestamp = endTimestamp;
this.studentNumber = studentNumber;
this.latLng = latLng;
// 受け取ったデータを利用してログを出力
Log.d("CreateRoot", "address: " + address);
Log.d("CreateRoot", "startTimestamp: " + startTimestamp);
Log.d("CreateRoot", "endTimestamp: " + endTimestamp);
Log.d("CreateRoot", "studentNumber: " + studentNumber);
Log.d("CreateRoot", "latLng: " + latLng);
}
}

View File

@ -29,13 +29,18 @@ public class GeoCoder {
// 住所を緯度経度に変換
LatLng latLng = geocodeAddress(address.get(0));
//デバッグ用ログ
Log.d("FirestoreReception", "address: " + address.get(0));
Log.d("FirestoreReception", "firstDay: " + firstDay.get(0));
Log.d("FirestoreReception", "firstDay: " + firstDay.get(1));
Log.d("FirestoreReception", "studentNumber: " + studentNumber);
Log.d("FirestoreReception", "latLng: "+latLng );
// CreateRootクラスのインスタンスを作成
CreateRoot createRoot = new CreateRoot();
// データを渡す
createRoot.receiveData(address.get(0), firstDay.get(0), firstDay.get(1), studentNumber, latLng);
// 緯度経度をLogに出力
Log.d("緯度経度", "latLng: "+latLng );
} catch (NullPointerException e) {
Log.e("NullPointerException", "getの中身がnull" + e);
}

View File

@ -92,7 +92,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
// ルート作成のクリック処理
if(view == root){
imageRoot.setImageResource(R.drawable.pin);
Intent toRoot = new Intent(MainActivity.this,MapsActivity.class);
Intent toRoot = new Intent(MainActivity.this,Maps.class);
startActivity(toRoot);
}
// 提出状況のクリック処理