mirror of
				https://github.com/bspeice/UNCCGameDay
				synced 2025-11-03 18:00:43 -05:00 
			
		
		
		
	Add utility code to make navigation easy
This commit is contained in:
		@ -1,5 +1,8 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.net.Uri;
 | 
			
		||||
 | 
			
		||||
public class ParkingCoordinate {
 | 
			
		||||
	private double latitude;
 | 
			
		||||
	private double longitude;
 | 
			
		||||
@ -24,6 +27,16 @@ public class ParkingCoordinate {
 | 
			
		||||
		this.label = label;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public Uri getNavigationURI() {
 | 
			
		||||
		// URI used to construct an intent for navigation
 | 
			
		||||
		return Uri.parse("google.navigation:q=" + this.getLatitude() + "," + this.getLongitude());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public Intent getNavigationIntent() {
 | 
			
		||||
		// Intent used to do navigation
 | 
			
		||||
		return new Intent(Intent.ACTION_VIEW, this.getNavigationURI());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public ParkingCoordinate(double latitude, double longitude, String label) {
 | 
			
		||||
		this.latitude = latitude;
 | 
			
		||||
		this.longitude = longitude;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user