Commit 100ecdf8 authored by A.P.R.C. Abeyrathna's avatar A.P.R.C. Abeyrathna

Merge branch 'IT19179568' into 'master'

Accuracy Update V2

See merge request 2022-020/2022-020!23
parents 54d1d26c 235246bc
package com.app.travelle; package com.app.travelle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import android.Manifest;
import android.content.pm.PackageManager;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MapStyleOptions; import com.google.android.gms.maps.model.MapStyleOptions;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.MarkerOptions;
import com.app.travelle.databinding.ActivityRetrieveBusMapBinding; import com.app.travelle.databinding.ActivityRetrieveBusMapBinding;
import com.google.android.gms.maps.model.PolylineOptions;
import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.DatabaseReference;
...@@ -29,6 +37,7 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba ...@@ -29,6 +37,7 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
private GoogleMap mMap; private GoogleMap mMap;
private ActivityRetrieveBusMapBinding binding; private ActivityRetrieveBusMapBinding binding;
Marker mm;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -88,17 +97,32 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba ...@@ -88,17 +97,32 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
System.out.println(latitude+longitude); System.out.println(latitude+longitude);
LatLng location = new LatLng(Double.parseDouble(latitude),Double.parseDouble(longitude)); LatLng location = new LatLng(Double.parseDouble(latitude),Double.parseDouble(longitude));
mMap.addMarker(new MarkerOptions().position(location).title("117"));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location,17));
} if(mm != null){
mm.remove();
}
mm = mMap.addMarker(new MarkerOptions()
.position(location)
.title("117")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bus_icon))
);
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location,17));
mMap.getUiSettings().setMapToolbarEnabled(false);
}
@Override @Override
public void onCancelled(@NonNull DatabaseError databaseError) { public void onCancelled(@NonNull DatabaseError databaseError) {
} }
}); });
} }
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="60dp" />
<!-- This is the border color -->
<stroke android:width="2dp" android:color="#FFFFFF" />
<!--- This is the background color -->
<solid android:color="#FFFFFF" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="@android:color/transparent" />
<item android:color="#6A6A6A" />
</selector>
\ No newline at end of file
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
android:id="@+id/imageView10" android:id="@+id/imageView10"
android:layout_width="508dp" android:layout_width="508dp"
android:layout_height="297dp" android:layout_height="297dp"
android:layout_marginStart="-67dp" android:layout_marginStart="-60dp"
android:layout_marginBottom="-40dp" android:layout_marginTop="572dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/rectangle_16" /> app:srcCompat="@drawable/rectangle_16" />
<!-- <com.google.android.material.textfield.TextInputLayout <!-- <com.google.android.material.textfield.TextInputLayout
...@@ -100,13 +100,14 @@ ...@@ -100,13 +100,14 @@
android:layout_width="340dp" android:layout_width="340dp"
android:layout_height="59dp" android:layout_height="59dp"
android:layout_marginStart="32dp" android:layout_marginStart="32dp"
android:layout_marginBottom="156dp" android:layout_marginBottom="30dp"
android:hint="Where to" android:hint="Where to"
android:fontFamily="@font/sans_bold"
android:textColorHint="@drawable/selector"
android:textAlignment="center" android:textAlignment="center"
android:completionThreshold="1" android:completionThreshold="1"
android:completionHint="Select a city" android:completionHint="Select a city"
android:background="#FFFFFF" android:background="@drawable/rounded_corner"
app:layout_constraintBottom_toTopOf="@+id/findbus" app:layout_constraintBottom_toTopOf="@+id/findbus"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
......
...@@ -6,16 +6,7 @@ ...@@ -6,16 +6,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".Welcome"> tools:context=".Welcome">
<ImageView <!--
android:id="@+id/imageView10"
android:layout_width="508dp"
android:layout_height="297dp"
android:layout_marginStart="-60dp"
android:layout_marginBottom="-40dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/rectangle_16" />
<!--
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/search_destination" android:id="@+id/search_destination"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
...@@ -47,16 +38,27 @@ ...@@ -47,16 +38,27 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
--> -->
<ImageView
android:id="@+id/imageView10"
android:layout_width="508dp"
android:layout_height="297dp"
android:layout_marginStart="-60dp"
android:layout_marginTop="572dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/rectangle_16" />
<Button <Button
android:id="@+id/button2" android:id="@+id/button2"
android:layout_width="124dp" android:layout_width="165dp"
android:layout_height="58dp" android:layout_height="70dp"
android:layout_marginStart="140dp" android:layout_marginStart="120dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:backgroundTint="#262730" android:backgroundTint="#262730"
android:text="FIND " android:text="FIND "
app:cornerRadius="60px"
android:textSize="60px" android:textSize="60px"
app:cornerRadius="60px"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
...@@ -75,12 +77,12 @@ ...@@ -75,12 +77,12 @@
android:layout_width="340dp" android:layout_width="340dp"
android:layout_height="59dp" android:layout_height="59dp"
android:layout_marginStart="32dp" android:layout_marginStart="32dp"
android:layout_marginBottom="156dp" android:layout_marginBottom="12dp"
android:text="Where to" android:background="#FFFFFF"
android:textAlignment="center"
android:completionThreshold="3" android:completionThreshold="3"
android:text="Where to"
android:background="#FFFFFF" android:textAlignment="center"
app:layout_constraintBottom_toTopOf="@+id/button2" app:layout_constraintBottom_toTopOf="@+id/button2"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
......
[
{
"elementType": "geometry",
"stylers": [
{
"color": "#1d2c4d"
}
]
},
{
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#8ec3b9"
}
]
},
{
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#1a3646"
}
]
},
{
"featureType": "administrative.country",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#4b6878"
}
]
},
{
"featureType": "administrative.land_parcel",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#64779e"
}
]
},
{
"featureType": "administrative.province",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#4b6878"
}
]
},
{
"featureType": "landscape.man_made",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#334e87"
}
]
},
{
"featureType": "landscape.natural",
"elementType": "geometry",
"stylers": [
{
"color": "#023e58"
}
]
},
{
"featureType": "poi",
"elementType": "geometry",
"stylers": [
{
"color": "#283d6a"
}
]
},
{
"featureType": "poi",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#6f9ba5"
}
]
},
{
"featureType": "poi",
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#1d2c4d"
}
]
},
{
"featureType": "poi.park",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#023e58"
}
]
},
{
"featureType": "poi.park",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#3C7680"
}
]
},
{
"featureType": "road",
"elementType": "geometry",
"stylers": [
{
"color": "#304a7d"
}
]
},
{
"featureType": "road",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#98a5be"
}
]
},
{
"featureType": "road",
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#1d2c4d"
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#545454"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry",
"stylers": [
{
"color": "#2c6675"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#255763"
}
]
},
{
"featureType": "road.highway",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#b0d5ce"
}
]
},
{
"featureType": "road.highway",
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#023e58"
}
]
},
{
"featureType": "road.local",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#878787"
}
]
},
{
"featureType": "transit",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#98a5be"
}
]
},
{
"featureType": "transit",
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#1d2c4d"
}
]
},
{
"featureType": "transit.line",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#283d6a"
}
]
},
{
"featureType": "transit.station",
"elementType": "geometry",
"stylers": [
{
"color": "#3a4762"
}
]
},
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#0e1626"
}
]
},
{
"featureType": "water",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#4e6d70"
}
]
}
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment