diff --git a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java index 442cbeb..ede712b 100644 --- a/app/src/main/java/com/example/cosmosclient/app/Cosmos.java +++ b/app/src/main/java/com/example/cosmosclient/app/Cosmos.java @@ -2,7 +2,11 @@ import android.app.Application; +import com.example.cosmosclient.entities.AreaInformation; import com.example.cosmosclient.entities.Group; +import com.example.cosmosclient.entities.Location; + +import java.util.HashMap; import java.util.HashMap; @@ -11,6 +15,7 @@ private Group curGroup=null; private HashMap groups = new HashMap<>(); private String uId=null; + private HashMap areaInfo = new HashMap<>(); //token処理 public void setToken(String token){ @@ -51,4 +56,13 @@ public String getuId(){ return uId; } + + //areaInfo処理 + public void setAreaInfo(int areaId, AreaInformation AreaInfo){ + this.areaInfo.put(areaId,AreaInfo); + } + public AreaInformation getAreaInfo(int areaId){ + return areaInfo.get(areaId); + } + } diff --git a/app/src/main/java/com/example/cosmosclient/entities/AreaInformation.java b/app/src/main/java/com/example/cosmosclient/entities/AreaInformation.java new file mode 100644 index 0000000..4a581ac --- /dev/null +++ b/app/src/main/java/com/example/cosmosclient/entities/AreaInformation.java @@ -0,0 +1,32 @@ +package com.example.cosmosclient.entities; + +import java.sql.Time; +import java.util.ArrayList; +import java.util.HashMap; + +public class AreaInformation { + private Location location = new Location(); + private HashMap> feature = new HashMap<>(); + private Time lastUpdated; + + public void setLocation(Location location){ + this.location = location; + } + public Location getLocation(){ + return this.location; + } + + public void setFeature(HashMap> feature) { + this.feature = feature; + } + public HashMap> getFeature() { + return feature; + } + + public void setLastUpdated(Time lastUpdated) { + this.lastUpdated = lastUpdated; + } + public Time getLastUpdated() { + return lastUpdated; + } +} diff --git a/app/src/main/java/com/example/cosmosclient/entities/Feature.java b/app/src/main/java/com/example/cosmosclient/entities/Feature.java new file mode 100644 index 0000000..63c3374 --- /dev/null +++ b/app/src/main/java/com/example/cosmosclient/entities/Feature.java @@ -0,0 +1,28 @@ +package com.example.cosmosclient.entities; + +public class Feature { + private String name; + private int code; + private Location location = new Location(); + + public void setName(String name){ + this.name = name; + } + public String getName(){ + return this.name; + } + + public void setCode(int code){ + this.code = code; + } + public int getCode(){ + return this.code; + } + + public void setLocation(Location location){ + this.location = location; + } + public Location getLocation(){ + return this.location; + } +} diff --git a/app/src/main/java/com/example/cosmosclient/entities/Location.java b/app/src/main/java/com/example/cosmosclient/entities/Location.java new file mode 100644 index 0000000..88468c3 --- /dev/null +++ b/app/src/main/java/com/example/cosmosclient/entities/Location.java @@ -0,0 +1,24 @@ +package com.example.cosmosclient.entities; + +public class Location { + private double latitude; + private double longitude; + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + public double getLatitude() { + return latitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + public double getLongitude() { + return longitude; + } + + public int hashCode(){ + return (int)((latitude+90)/0.1)+(int)((longitude*0.1)*1800); + } +} diff --git a/app/src/main/java/com/example/cosmosclient/resources/ShopRest.java b/app/src/main/java/com/example/cosmosclient/resources/ShopRest.java new file mode 100644 index 0000000..0d9a51c --- /dev/null +++ b/app/src/main/java/com/example/cosmosclient/resources/ShopRest.java @@ -0,0 +1,17 @@ +package com.example.cosmosclient.resources; + +import com.example.cosmosclient.entities.Feature; + +import retrofit2.Call; +import retrofit2.http.GET; +import retrofit2.http.Query; + +public interface ShopRest { + + @GET("rest") + Call ShopRequest(@Query("longitude") double longitude, + @Query("latitude") double latitude, + @Query("longitudeRange") double longitudeRange, + @Query("latitudeRange") double latitudeRange, + @Query("shop") int shop); +} diff --git a/app/src/main/java/com/example/cosmosclient/views/ForgotPasswordActivity.java b/app/src/main/java/com/example/cosmosclient/views/ForgotPasswordActivity.java index 651439d..515e911 100644 --- a/app/src/main/java/com/example/cosmosclient/views/ForgotPasswordActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/ForgotPasswordActivity.java @@ -21,22 +21,22 @@ //idの取得 final EditText EmailAddressText = findViewById(R.id.NameText); - Button SendButton = findViewById(R.id.SendButton); + //Button SendButton = findViewById(R.id.SendButton); //EmailAddressText.addTextChangedListener(this); - //送信ボタン処理 - SendButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - String MailAddress = EmailAddressText.getText().toString(); - - //メールアドレスをサーバに送信する処理の予定 - Toast.makeText(ForgotPasswordActivity.this, - "入力されたアドレスにメールを送信しました", Toast.LENGTH_SHORT).show(); - finish(); - } - }); +// //送信ボタン処理 +// SendButton.setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// String MailAddress = EmailAddressText.getText().toString(); +// +// //メールアドレスをサーバに送信する処理の予定 +// Toast.makeText(ForgotPasswordActivity.this, +// "入力されたアドレスにメールを送信しました", Toast.LENGTH_SHORT).show(); +// finish(); +// } +// }); } //@Override // public void beforeTextChanged(CharSequence s, int start, int count,int after) { // //ignore diff --git a/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java b/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java index 46845dc..f1cd4e9 100644 --- a/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/SigninActivity.java @@ -1,5 +1,9 @@ package com.example.cosmosclient.views; +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.content.Context; import android.Manifest; import android.content.Context; import android.content.Intent; @@ -25,6 +29,7 @@ import com.example.cosmosclient.MainActivity; import com.example.cosmosclient.R; import com.example.cosmosclient.app.Cosmos; +import com.example.cosmosclient.entities.AreaInformation; import com.example.cosmosclient.entities.SigninResponse; import com.example.cosmosclient.resources.UsersRest; import com.example.cosmosclient.services.CosomosBackgroundService; diff --git a/app/src/main/res/layout/activity_forgot_password.xml b/app/src/main/res/layout/activity_forgot_password.xml index e5b5ac9..006209f 100644 --- a/app/src/main/res/layout/activity_forgot_password.xml +++ b/app/src/main/res/layout/activity_forgot_password.xml @@ -7,6 +7,7 @@ android:background="#FFFFFF" tools:context=".views.ForgotPasswordActivity"> + + + + \ No newline at end of file