diff --git a/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java b/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java index cd55503..b01e7cd 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java @@ -4,6 +4,8 @@ import android.app.Activity; import android.app.Application; import android.content.Context; +import android.location.Location; +import android.location.LocationListener; import android.media.MediaPlayer; import android.os.Bundle; @@ -49,7 +51,7 @@ import retrofit2.converter.jackson.JacksonConverterFactory; -public class MyDialogFragment extends DialogFragment { +public class MyDialogFragment extends DialogFragment implements LocationListener { Button CancelButton; private EditText editText; @@ -66,10 +68,33 @@ private ArrayList category; - + private double latitude; + private double longitude; private String data; + @Override + public void onLocationChanged(Location location) { + + latitude = location.getLatitude(); + longitude = location.getLongitude(); + + } + + @Override + public void onStatusChanged(String provider, int status, Bundle extras) { + + } + + @Override + public void onProviderEnabled(String provider) { + + } + + @Override + public void onProviderDisabled(String provider) { + + } public interface DialogFragmentListener{ @@ -273,6 +298,7 @@ */ + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -325,6 +351,7 @@ category.add("c02"); //toastMessage = "タイトルが入力されていません"; + ((MainActivity) getActivity()).subscribe(this); /* int matchParent = ViewGroup.LayoutParams.MATCH_PARENT; @@ -403,6 +430,7 @@ + //for(int i = 0;i list = new ArrayList<>(); @@ -438,13 +466,16 @@ data = amaryllis.getData(); //voiceデータの改行を消去 String str = data.replace("\n", ""); + //String str = "AAAAGGZ0eXAzZ3A0AAAAAGlzb20zZ3A0AAACkm1vb3YAAABsbXZoZAAAAADbz/QR28/0EQAAA+gAAEYAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAB5bWV0YQAAACFoZGxyAAAAAAAAAABtZHRhAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="; - Call call = voicememosService.postVoicememos(amaryllis.getUid(), amaryllis.getToken(), 10, str, 35, 135, "untitled", "abcde",category); + Call call = voicememosService.postVoicememos(amaryllis.getUid(), amaryllis.getToken(), 10, str, latitude, longitude, "untitled", "abcde",category); call.enqueue(new Callback() { @Override public void onResponse(Call call, Response response) { Voicememo voicememo = response.body(); + String aa = voicememo.getVid(); System.out.println("Success!!!!!!!"); + System.out.println(aa); } @Override