Merge pull request 'マップ表示のバグ修正' (#53) from murakumo_classIdが0になる問題 into master
Reviewed-on: #53
This commit is contained in:
commit
65edd2e9f8
|
@ -27,8 +27,11 @@ public class FirestoreReception {
|
||||||
//ClassIdを引数にデータの作成を行う
|
//ClassIdを引数にデータの作成を行う
|
||||||
public void getDocumentsByClassId(int classId) {
|
public void getDocumentsByClassId(int classId) {
|
||||||
myDataList.clear();
|
myDataList.clear();
|
||||||
CollectionReference collectionRef = db.collection("testDistinct");
|
//pixel6a
|
||||||
|
CollectionReference collectionRef = db.collection("test0711Data");
|
||||||
|
|
||||||
|
//xiaomi
|
||||||
|
// CollectionReference collectionRef = db.collection("testDistinct");
|
||||||
// classIdが引数のものを取得する
|
// classIdが引数のものを取得する
|
||||||
collectionRef.whereEqualTo("classId", classId).get()
|
collectionRef.whereEqualTo("classId", classId).get()
|
||||||
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
|
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
|
||||||
|
|
|
@ -42,9 +42,6 @@ import java.util.Map;
|
||||||
|
|
||||||
public class Maps extends FragmentActivity implements OnMapReadyCallback, View.OnClickListener, GoogleMap.OnMarkerClickListener {
|
public class Maps extends FragmentActivity implements OnMapReadyCallback, View.OnClickListener, GoogleMap.OnMarkerClickListener {
|
||||||
|
|
||||||
ImageView backMain;
|
|
||||||
private GoogleMap mMap;
|
|
||||||
private LinearLayout locationsName;
|
|
||||||
//GoogleMapAPiで使用可能な色
|
//GoogleMapAPiで使用可能な色
|
||||||
private static final int[] COLORS = new int[]{Color.parseColor("#007FFF"), // HUE_AZURE
|
private static final int[] COLORS = new int[]{Color.parseColor("#007FFF"), // HUE_AZURE
|
||||||
Color.parseColor("#0000FF"), // HUE_BLUE
|
Color.parseColor("#0000FF"), // HUE_BLUE
|
||||||
|
@ -57,13 +54,14 @@ public class Maps extends FragmentActivity implements OnMapReadyCallback, View.O
|
||||||
Color.parseColor("#8A2BE2"), // HUE_VIOLET
|
Color.parseColor("#8A2BE2"), // HUE_VIOLET
|
||||||
Color.parseColor("#FFFF00") // HUE_YELLOW
|
Color.parseColor("#FFFF00") // HUE_YELLOW
|
||||||
};
|
};
|
||||||
private int colorIndex = 0;
|
|
||||||
private final List<LatLng> latLngList = new ArrayList<>();
|
private final List<LatLng> latLngList = new ArrayList<>();
|
||||||
private final List<String> nameList = new ArrayList<>();
|
private final List<String> nameList = new ArrayList<>();
|
||||||
private final List<Integer> colorList = new ArrayList<>();
|
private final List<Integer> colorList = new ArrayList<>();
|
||||||
|
|
||||||
private final Map<String, Runnable> dateMap = new HashMap<>();
|
private final Map<String, Runnable> dateMap = new HashMap<>();
|
||||||
|
ImageView backMain;
|
||||||
|
private GoogleMap mMap;
|
||||||
|
private LinearLayout locationsName;
|
||||||
|
private int colorIndex = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -213,11 +211,22 @@ public class Maps extends FragmentActivity implements OnMapReadyCallback, View.O
|
||||||
|
|
||||||
//家庭訪問のscheduleを7桁の整数から○月〇日●時〇分(6041200→06月12日05時20分)に変換
|
//家庭訪問のscheduleを7桁の整数から○月〇日●時〇分(6041200→06月12日05時20分)に変換
|
||||||
private String formatSchedule(String schedule) {
|
private String formatSchedule(String schedule) {
|
||||||
String monthString = "0" + schedule.substring(0, 1);
|
Log.d("Maps", "schedule: " + schedule);
|
||||||
String dayString = schedule.substring(1, 3);
|
if (schedule.length() != 7) {
|
||||||
String hourString = schedule.substring(3, 5);
|
schedule = "0" + schedule;
|
||||||
String minuteString = schedule.substring(5, 7);
|
String monthString = schedule.substring(0, 2);
|
||||||
return monthString + "月" + dayString + "日" + hourString + "時" + minuteString + "分";
|
String dayString = schedule.substring(2, 4);
|
||||||
|
String hourString = "0" + schedule.substring(4, 5);
|
||||||
|
String minuteString = schedule.substring(5, 7);
|
||||||
|
return monthString + "月" + dayString + "日" + hourString + "時" + minuteString + "分";
|
||||||
|
} else {
|
||||||
|
String monthString = "0" + schedule.substring(0, 1);
|
||||||
|
String dayString = schedule.substring(1, 3);
|
||||||
|
String hourString = schedule.substring(3, 5);
|
||||||
|
String minuteString = schedule.substring(5, 7);
|
||||||
|
return monthString + "月" + dayString + "日" + hourString + "時" + minuteString + "分";
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 共有プリファレンスからMyDataListを取得するメソッド
|
// 共有プリファレンスからMyDataListを取得するメソッド
|
||||||
|
|
Loading…
Reference in New Issue
Block a user