aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java16
-rw-r--r--src/main/res/drawable-hdpi/ic_navigation_white_24dp.pngbin0 -> 341 bytes
-rw-r--r--src/main/res/drawable-mdpi/ic_navigation_white_24dp.pngbin0 -> 250 bytes
-rw-r--r--src/main/res/drawable-xhdpi/ic_navigation_white_24dp.pngbin0 -> 434 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/ic_navigation_white_24dp.pngbin0 -> 607 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/ic_navigation_white_24dp.pngbin0 -> 798 bytes
-rw-r--r--src/main/res/menu/showlocation.xml8
-rw-r--r--src/main/res/values/strings.xml1
8 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
index 1eac42936..d7e29e018 100644
--- a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
@@ -7,9 +7,12 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Address;
import android.location.Geocoder;
+import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
@@ -81,10 +84,23 @@ public class ShowLocationActivity extends Activity implements OnMapReadyCallback
case android.R.id.home:
finish();
return true;
+ case R.id.action_navigate:
+ double longitude = mLocation.longitude;
+ double latitude = mLocation.latitude;
+ Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:" + String.valueOf(latitude) + "," + String.valueOf(longitude)));
+ startActivity(intent);
+ return true;
}
return super.onOptionsItemSelected(item);
}
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.showlocation, menu);
+ return true;
+ }
+
@Override
protected void onResume() {
super.onResume();
diff --git a/src/main/res/drawable-hdpi/ic_navigation_white_24dp.png b/src/main/res/drawable-hdpi/ic_navigation_white_24dp.png
new file mode 100644
index 000000000..1873e58b6
--- /dev/null
+++ b/src/main/res/drawable-hdpi/ic_navigation_white_24dp.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/ic_navigation_white_24dp.png b/src/main/res/drawable-mdpi/ic_navigation_white_24dp.png
new file mode 100644
index 000000000..c445d2620
--- /dev/null
+++ b/src/main/res/drawable-mdpi/ic_navigation_white_24dp.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/ic_navigation_white_24dp.png b/src/main/res/drawable-xhdpi/ic_navigation_white_24dp.png
new file mode 100644
index 000000000..f06426120
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/ic_navigation_white_24dp.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/ic_navigation_white_24dp.png b/src/main/res/drawable-xxhdpi/ic_navigation_white_24dp.png
new file mode 100644
index 000000000..05b81cb1f
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/ic_navigation_white_24dp.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/ic_navigation_white_24dp.png b/src/main/res/drawable-xxxhdpi/ic_navigation_white_24dp.png
new file mode 100644
index 000000000..b040e204c
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/ic_navigation_white_24dp.png
Binary files differ
diff --git a/src/main/res/menu/showlocation.xml b/src/main/res/menu/showlocation.xml
new file mode 100644
index 000000000..227b9970f
--- /dev/null
+++ b/src/main/res/menu/showlocation.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/action_navigate"
+ android:showAsAction="always"
+ android:title="@string/navigate"
+ android:icon="@drawable/ic_navigation_white_24dp"/>
+</menu> \ No newline at end of file
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 046291896..50e076b6e 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -721,4 +721,5 @@
<string name="data_saver_enabled">Data saver enabled</string>
<string name="data_saver_enabled_explained">Your operating system is restricting Pix-Art Messenger from accessing the Internet when in background. To receive notifications of new messages you should allow Pix-Art Messenger unrestricted access when Data saver is on.\\nPix-Art Messenger will still make an effort to save data when possible.</string>
<string name="device_does_not_support_data_saver">Your device does not supporting disabling Data saver for Pix-Art Messenger.</string>
+ <string name="navigate">Navigate to location</string>
</resources>