Skip to content

Commit

Permalink
Add share location button
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed May 1, 2024
1 parent a06e002 commit 30f411e
Show file tree
Hide file tree
Showing 37 changed files with 89 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

- Bundle the latest data snapshots
- Remove sync progress indicator from the map screen
- Add place directions
- Add share location button

## [0.7.2] - 2023-04-26

Expand Down
12 changes: 12 additions & 0 deletions app/src/main/kotlin/element/ElementFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ class ElementFragment : Fragment() {
requireContext().startActivity(Intent.createChooser(intent, null))
}

R.id.action_share -> {
val element = runBlocking { elementsRepo.selectById(elementId)!! }
val osmType = element.osmJson.optString("type")
val osmId = element.osmJson.optLong("id")
val uri = Uri.parse("https://btcmap.org/merchant/$osmType:$osmId")
val intent = Intent(Intent.ACTION_SEND).apply {
putExtra(Intent.EXTRA_TEXT, uri.toString())
type = "text/plain"
}
requireContext().startActivity(Intent.createChooser(intent, null))
}

R.id.action_view_on_osm -> {
val element = runBlocking { elementsRepo.selectById(elementId)!! }
val osmType = element.osmJson.optString("type")
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/res/menu/element.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

<item
android:id="@+id/action_show_directions"
android:title="Directions"
android:icon="@drawable/directions"
android:title="@string/directions"
app:showAsAction="ifRoom" />

<item
android:id="@+id/action_share"
android:title="@string/share"
app:showAsAction="never" />

<item
android:id="@+id/action_view_on_osm"
android:title="@string/view_on_osm"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-af/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="zero">%d changes</item>
<item quantity="one">%d change</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d промяна</item>
<item quantity="other">%d промени</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="many">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d změn</item>
<item quantity="few">%d změn</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d Änderung</item>
<item quantity="other">%d Änderungen</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d αλλαγή</item>
<item quantity="other">%d αλλαγές</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d cambio</item>
<item quantity="many">%d cambios</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d modification</item>
<item quantity="many">%d modifications</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="many">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">שינויים %d</item>
<item quantity="two">שינויים %d</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="other">%d changes</item>
</plurals>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="other">%d changes</item>
</plurals>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-no/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="few">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d mudança</item>
<item quantity="many">%d mudanças</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ro/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="few">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d правка</item>
<item quantity="few">%d правок</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-sr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="few">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-sv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-th/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="other">%d การเปลี่ยนแปลง</item>
</plurals>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="few">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-ur/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="one">%d change</item>
<item quantity="other">%d changes</item>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-vi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="other">%d changes</item>
</plurals>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="other">%d changes</item>
</plurals>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<string name="new_local_merchant_accepts_bitcoins">New local merchant accepts bitcoins</string>
<string name="show_sync_summary">Show sync summary</string>
<string name="show_all_new_elements">Show all new elements</string>
<string name="directions">Directions</string>
<string name="share">Share</string>
<plurals name="d_changes">
<item quantity="zero">%d changes</item>
<item quantity="one">%d change</item>
Expand Down

0 comments on commit 30f411e

Please sign in to comment.