Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-020
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
O.V.B Sewmina
2022-020
Commits
235246bc
Commit
235246bc
authored
Oct 09, 2022
by
A.P.R.C. Abeyrathna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accuracy Update V2
parent
689ae5f7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
325 additions
and
27 deletions
+325
-27
app/src/main/java/com/app/travelle/RetrieveBusMap.java
app/src/main/java/com/app/travelle/RetrieveBusMap.java
+27
-3
app/src/main/res/drawable/bus_icon.png
app/src/main/res/drawable/bus_icon.png
+0
-0
app/src/main/res/drawable/rounded_corner.xml
app/src/main/res/drawable/rounded_corner.xml
+15
-0
app/src/main/res/drawable/selector.xml
app/src/main/res/drawable/selector.xml
+5
-0
app/src/main/res/layout/activity_initial_map.xml
app/src/main/res/layout/activity_initial_map.xml
+7
-6
app/src/main/res/layout/activity_welcome.xml
app/src/main/res/layout/activity_welcome.xml
+20
-18
app/src/main/res/raw/silver_style.json
app/src/main/res/raw/silver_style.json
+251
-0
No files found.
app/src/main/java/com/app/travelle/RetrieveBusMap.java
View file @
235246bc
package
com.app.travelle
;
import
androidx.annotation.NonNull
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.fragment.app.FragmentActivity
;
import
android.Manifest
;
import
android.content.pm.PackageManager
;
import
android.content.res.Resources
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.Toast
;
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.SupportMapFragment
;
import
com.google.android.gms.maps.model.BitmapDescriptorFactory
;
import
com.google.android.gms.maps.model.LatLng
;
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.app.travelle.databinding.ActivityRetrieveBusMapBinding
;
import
com.google.android.gms.maps.model.PolylineOptions
;
import
com.google.firebase.database.DataSnapshot
;
import
com.google.firebase.database.DatabaseError
;
import
com.google.firebase.database.DatabaseReference
;
...
...
@@ -29,6 +37,7 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
private
GoogleMap
mMap
;
private
ActivityRetrieveBusMapBinding
binding
;
Marker
mm
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -88,17 +97,32 @@ public class RetrieveBusMap extends FragmentActivity implements OnMapReadyCallba
System
.
out
.
println
(
latitude
+
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
public
void
onCancelled
(
@NonNull
DatabaseError
databaseError
)
{
}
});
}
}
\ No newline at end of file
app/src/main/res/drawable/bus_icon.png
0 → 100644
View file @
235246bc
1.29 KB
app/src/main/res/drawable/rounded_corner.xml
0 → 100644
View file @
235246bc
<?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>
app/src/main/res/drawable/selector.xml
0 → 100644
View file @
235246bc
<?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
app/src/main/res/layout/activity_initial_map.xml
View file @
235246bc
...
...
@@ -17,10 +17,10 @@
android:id=
"@+id/imageView10"
android:layout_width=
"508dp"
android:layout_height=
"297dp"
android:layout_marginStart=
"-67dp"
android:layout_marginBottom=
"-40dp"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_marginStart=
"-60dp"
android:layout_marginTop=
"572dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/rectangle_16"
/>
<!-- <com.google.android.material.textfield.TextInputLayout
...
...
@@ -100,13 +100,14 @@
android:layout_width=
"340dp"
android:layout_height=
"59dp"
android:layout_marginStart=
"32dp"
android:layout_marginBottom=
"
156
dp"
android:layout_marginBottom=
"
30
dp"
android:hint=
"Where to"
android:fontFamily=
"@font/sans_bold"
android:textColorHint=
"@drawable/selector"
android:textAlignment=
"center"
android:completionThreshold=
"1"
android:completionHint=
"Select a city"
android:background=
"#FFFFFF"
android:background=
"@drawable/rounded_corner"
app:layout_constraintBottom_toTopOf=
"@+id/findbus"
app:layout_constraintStart_toStartOf=
"parent"
/>
...
...
app/src/main/res/layout/activity_welcome.xml
View file @
235246bc
...
...
@@ -6,16 +6,7 @@
android:layout_height=
"match_parent"
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
android:id="@+id/search_destination"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
...
...
@@ -47,16 +38,27 @@
</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
android:id=
"@+id/button2"
android:layout_width=
"1
24
dp"
android:layout_height=
"
58
dp"
android:layout_marginStart=
"1
4
0dp"
android:layout_width=
"1
65
dp"
android:layout_height=
"
70
dp"
android:layout_marginStart=
"1
2
0dp"
android:layout_marginBottom=
"16dp"
android:backgroundTint=
"#262730"
android:text=
"FIND "
app:cornerRadius=
"60px"
android:textSize=
"60px"
app:cornerRadius=
"60px"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
...
...
@@ -75,12 +77,12 @@
android:layout_width=
"340dp"
android:layout_height=
"59dp"
android:layout_marginStart=
"32dp"
android:layout_marginBottom=
"156dp"
android:text=
"Where to"
android:textAlignment=
"center"
android:layout_marginBottom=
"12dp"
android:background=
"#FFFFFF"
android:completionThreshold=
"3"
android:text=
"Where to"
android:
background=
"#FFFFFF
"
android:
textAlignment=
"center
"
app:layout_constraintBottom_toTopOf=
"@+id/button2"
app:layout_constraintStart_toStartOf=
"parent"
/>
...
...
app/src/main/res/raw/silver_style.json
0 → 100644
View file @
235246bc
[
{
"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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment