From 1955539cd352f5d601d6f6549b0091bbbba30e93 Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Sun, 1 Mar 2020 12:48:46 +0000 Subject: [PATCH] Minor amendments to compile screenshots --- .idea/codeStyles/Project.xml | 116 ++++++++++++++++++ .idea/gradle.xml | 4 + .idea/modules.xml | 2 +- app/src/main/AndroidManifest.xml | 2 +- .../example/h_mal/mochee/Fragment_Six.java | 22 +++- app/src/main/res/layout/fragment6.xml | 20 +-- build.gradle | 4 +- 7 files changed, 152 insertions(+), 18 deletions(-) create mode 100644 .idea/codeStyles/Project.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..681f41a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 7ac24c7..ee635a3 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -3,6 +3,9 @@ diff --git a/.idea/modules.xml b/.idea/modules.xml index 45894e9..357fda0 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b26ce5d..a07bfd8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -66,7 +66,7 @@ android:exported="false" /> - + \ No newline at end of file diff --git a/app/src/main/java/com/example/h_mal/mochee/Fragment_Six.java b/app/src/main/java/com/example/h_mal/mochee/Fragment_Six.java index ac66930..bf46fb4 100644 --- a/app/src/main/java/com/example/h_mal/mochee/Fragment_Six.java +++ b/app/src/main/java/com/example/h_mal/mochee/Fragment_Six.java @@ -1,5 +1,7 @@ package com.example.h_mal.mochee; +import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; @@ -16,6 +18,7 @@ import com.google.android.gms.maps.MapsInitializer; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; @@ -31,7 +34,7 @@ public class Fragment_Six extends Fragment{ private DatabaseReference mDatabase; @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, + public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment6, container, false); @@ -71,12 +74,23 @@ public class Fragment_Six extends Fragment{ // map.setMyLocationEnabled(true); // For dropping a marker at a point on the Map - LatLng sydney = new LatLng(51.2704, 0.5227); - map.addMarker(new MarkerOptions().position(sydney).title("Mochee Kent")).showInfoWindow(); + LatLng mocheeLocation = new LatLng(51.5226044,-0.118918); + map.addMarker(new MarkerOptions().position(mocheeLocation).title("Mochee")).showInfoWindow(); // For zooming automatically to the location of the marker - CameraPosition cameraPosition = new CameraPosition.Builder().target(sydney).zoom(12).build(); + CameraPosition cameraPosition = new CameraPosition.Builder().target(mocheeLocation).zoom(14).build(); map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); + + mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { + @Override + public boolean onMarkerClick(Marker marker) { + + Intent intent = new Intent(android.content.Intent.ACTION_VIEW, + Uri.parse("https://goo.gl/maps/nz4ukSBXrbvRwGvX6")); + getActivity().startActivity(intent); + return false; + } + }); } }); diff --git a/app/src/main/res/layout/fragment6.xml b/app/src/main/res/layout/fragment6.xml index 2c4f768..80f932c 100644 --- a/app/src/main/res/layout/fragment6.xml +++ b/app/src/main/res/layout/fragment6.xml @@ -8,16 +8,16 @@ android:layout_height="wrap_content" android:orientation="vertical"> - +