diff --git a/app/src/main/java/com/example/nemophila/Nemophila.java b/app/src/main/java/com/example/nemophila/Nemophila.java index 26e5d77..d87e5e1 100644 --- a/app/src/main/java/com/example/nemophila/Nemophila.java +++ b/app/src/main/java/com/example/nemophila/Nemophila.java @@ -3,10 +3,13 @@ import android.app.Application; import android.content.SharedPreferences; +import com.example.nemophila.entities.Account; import com.example.nemophila.entities.Shop; import com.google.type.LatLng; public class Nemophila extends Application { + private final int MAX_FILTER = 5; + //アカウントのデータ private String name; private String uid; @@ -19,12 +22,15 @@ private Shop dummyShop; //カメラのデータ - private Float cameraLatitude; - private Float cameraLongitude; + private double cameraLatitude; + private double cameraLongitude; private float zoom; - //Getter + //フィルターのデータ + private String[] selectGenre = new String[MAX_FILTER]; + private Account[] selectFriend = new Account[MAX_FILTER]; + //Account関連のGetter public String getName() { if(name == null){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); @@ -46,6 +52,8 @@ } return token; } + + //Shop関連のGetter public Shop getCurrentShop() { return currentShop; } @@ -58,14 +66,16 @@ public Shop getDummyShop() { return dummyShop; } - public Float getCameraLatitude() { + + //Camera関連のGetter + public double getCameraLatitude() { if(cameraLatitude == 0){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); cameraLatitude = preferences.getFloat("cameraLatitude", 0); } return cameraLatitude; } - public Float getCameraLongitude() { + public double getCameraLongitude() { if(cameraLongitude == 0){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); cameraLongitude = preferences.getFloat("cameraLongitude", 0); @@ -75,11 +85,19 @@ public float getZoom() { if(zoom == 0.0){ SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); - zoom = preferences.getFloat("zoom", 0); + zoom = preferences.getFloat("zoom", 10); } return zoom; } + //フィルター関連のGetter + public String[] getSelectGenre() { + return selectGenre; + } + public Account[] getSelectFriend() { + return selectFriend; + } + //Setter public void setName(String name) { SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); @@ -114,16 +132,16 @@ public void setDummyShop(Shop dummyShop) { this.dummyShop = dummyShop; } - public void setCameraLatitude(Float cameraLatitude) { + public void setCameraLatitude(double cameraLatitude) { SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.putFloat("cameraLatitude", cameraLatitude); + editor.putFloat("cameraLatitude", (float) cameraLatitude); this.cameraLatitude = cameraLatitude; } - public void setCameraLongitude(Float cameraLongitude) { + public void setCameraLongitude(double cameraLongitude) { SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); - editor.putFloat("cameraLongitude", cameraLongitude); + editor.putFloat("cameraLongitude", (float) cameraLongitude); this.cameraLongitude = cameraLongitude; } public void setZoom(float zoom) { @@ -132,4 +150,12 @@ editor.putFloat("zoom", zoom); this.zoom = zoom; } + +// //フィルター関連のSetter +// public void setSelectGenre(String selectGenre) { +// this.selectGenre = selectGenre; +// } +// public void setSelectFriend(Account selectFriend) { +// this.selectFriend = selectFriend; +// } }