This repository has been archived by the owner on Jun 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added navigation to order detail activity
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
app/src/main/java/jetzt/machbarschaft/android/util/NavigationUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package jetzt.machbarschaft.android.util; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
|
||
import jetzt.machbarschaft.android.database.entitie.Order; | ||
|
||
public class NavigationUtil { | ||
|
||
/** | ||
* Start maps app to navigate to order address | ||
*/ | ||
public static void navigateToAddress(Order mOrder, Context context) { | ||
if (mOrder == null) { | ||
return; | ||
} | ||
|
||
@SuppressLint("DefaultLocale") | ||
Uri locationUri = Uri.parse(String.format("geo:%f,%f?q=%s", | ||
mOrder.getLatitude(), mOrder.getLongitude(), mOrder.getCompleteAddress())); | ||
context.startActivity(new Intent(Intent.ACTION_VIEW, locationUri).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters