From 592864332538cf4f5615cfb24545791346766ae6 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 2 Apr 2023 10:05:50 -0700 Subject: [PATCH] Add OSM copyright to about section. --- .../java/net/voussoir/trkpt/SettingsFragment.kt | 13 +++++++++++++ app/src/main/res/drawable/ic_map_24dp.xml | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 app/src/main/res/drawable/ic_map_24dp.xml diff --git a/app/src/main/java/net/voussoir/trkpt/SettingsFragment.kt b/app/src/main/java/net/voussoir/trkpt/SettingsFragment.kt index 6ce410f..691eced 100644 --- a/app/src/main/java/net/voussoir/trkpt/SettingsFragment.kt +++ b/app/src/main/java/net/voussoir/trkpt/SettingsFragment.kt @@ -242,6 +242,19 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList preferenceCategoryAbout.contains(fork_notice) screen.addPreference(fork_notice) + val copyright_notice = Preference(context) + copyright_notice.title = "Map data" + copyright_notice.summary = "© OpenStreetMap contributors." + copyright_notice.setIcon(R.drawable.ic_map_24dp) + copyright_notice.setOnPreferenceClickListener { + val intent = Intent(Intent.ACTION_VIEW) + intent.setData(Uri.parse("https://www.openstreetmap.org")) + startActivity(intent) + return@setOnPreferenceClickListener true + } + preferenceCategoryAbout.contains(copyright_notice) + screen.addPreference(copyright_notice) + val preferenceAppVersion = Preference(context) preferenceAppVersion.title = getString(R.string.pref_app_version_title) preferenceAppVersion.setIcon(R.drawable.ic_info_24dp) diff --git a/app/src/main/res/drawable/ic_map_24dp.xml b/app/src/main/res/drawable/ic_map_24dp.xml new file mode 100644 index 0000000..805de7c --- /dev/null +++ b/app/src/main/res/drawable/ic_map_24dp.xml @@ -0,0 +1,14 @@ + + + +