diff --git a/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java b/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java index 6e00703..019bfc1 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java @@ -30,9 +30,11 @@ import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; +import com.google.android.gms.maps.Projection; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; +import com.google.android.gms.maps.model.VisibleRegion; import org.ntlab.amaryllis.client.Amaryllis; import org.ntlab.amaryllis.client.MainActivity; @@ -45,6 +47,7 @@ import java.io.File; import java.io.FileInputStream; +import java.util.ArrayList; import retrofit2.Call; import retrofit2.Callback; @@ -73,7 +76,7 @@ Button RecordButton; Button PlaybackButton; private double latitude,longitude; -// double latitude,longitude; + private double latmax,latmin,longmax,longmin; private byte[] byteData = new byte[4096]; //private short[] shortData = new short[2048]; @@ -106,6 +109,17 @@ googleMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); +// Projection p = googleMap.getProjection(); +// VisibleRegion vr = p.getVisibleRegion(); +// double latmax = vr.latLngBounds.northeast.latitude; +// double latmin = vr.latLngBounds.southwest.latitude; +// double longmax = vr.latLngBounds.northeast.longitude; +// double longmin = vr.latLngBounds.southwest.longitude; +// System.out.println(latmax + "!!!!!!!!!!!!!"); +// System.out.println(latmin + "!!!!!!!!!!!!!"); +// System.out.println(longmax + "!!!!!!!!!!!!!"); +// System.out.println(longmin + "!!!!!!!!!!!!!"); + } }; @@ -125,7 +139,7 @@ @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - + ((MainActivity) getActivity()).subscribe(this); Retrofit retrofit = new Retrofit.Builder() .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/amaryllis/") .addConverterFactory(JacksonConverterFactory.create()) @@ -163,6 +177,18 @@ public void onLocationChanged(Location location) { latitude=location.getLatitude(); longitude=location.getLongitude(); + Call> call = voicememosService.getVoicememos(latmax,latmin,longmax,longmin); + call.enqueue(new Callback>() { + @Override + public void onResponse(Call> call, Response> response) { + + } + + @Override + public void onFailure(Call> call, Throwable t) { + + } + }); } @Override