From c9b0b7816dacc543e140b9c0b008554a514700ac Mon Sep 17 00:00:00 2001 From: Dave Craig Date: Tue, 4 Feb 2025 16:05:04 +0000 Subject: [PATCH] Add About information for third party licenses This is a reasonably comprehensive list of third party libraries that are used, though perhaps we need a Google acknowledgement too. --- app/build.gradle.kts | 4 -- .../soundscape/screens/home/DrawerContent.kt | 7 ++- .../screens/home/home/HelpScreen.kt | 53 ++++++++++++++++++- app/src/main/res/values/strings.xml | 23 ++++++++ gradle/libs.versions.toml | 2 - 5 files changed, 81 insertions(+), 8 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e1f6de04..be8b97ef 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,6 +1,4 @@ import com.google.protobuf.gradle.id -import java.io.FileInputStream -import java.util.Properties plugins { id("com.android.application") @@ -217,8 +215,6 @@ dependencies { // GPX parser implementation (libs.android.gpx.parser) - // Open Street Map compose library - implementation (libs.mapcompose) // MapLibre library implementation (libs.maplibre) implementation (libs.maplibre.annotations) diff --git a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/DrawerContent.kt b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/DrawerContent.kt index 7378b464..5a1045ff 100644 --- a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/DrawerContent.kt +++ b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/DrawerContent.kt @@ -76,7 +76,7 @@ fun DrawerContent( icon = Icons.Rounded.Settings, ) DrawerMenuItem( - onClick = { onNavigate(HomeRoutes.Help.route + "/home") }, + onClick = { onNavigate(HomeRoutes.Help.route + "/page${R.string.menu_help_and_tutorials}") }, label = stringResource(R.string.menu_help_and_tutorials), Icons.AutoMirrored.Rounded.HelpOutline, ) @@ -95,5 +95,10 @@ fun DrawerContent( label = stringResource(R.string.share_title), icon = Icons.Rounded.IosShare, ) + DrawerMenuItem( + onClick = { onNavigate(HomeRoutes.Help.route + "/page${R.string.settings_about_app}") }, + label = stringResource(R.string.settings_about_app), + Icons.AutoMirrored.Rounded.HelpOutline, + ) } } diff --git a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/home/HelpScreen.kt b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/home/HelpScreen.kt index 93aca480..4944237b 100644 --- a/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/home/HelpScreen.kt +++ b/app/src/main/java/org/scottishtecharmy/soundscape/screens/home/home/HelpScreen.kt @@ -21,8 +21,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.TextLinkStyles +import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.fromHtml import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController @@ -296,6 +300,35 @@ private val helpPages = listOf( Section(R.string.faq_holding_phone_flat_question, SectionType.Faq, faqAnswer = R.string.faq_holding_phone_flat_answer), Section(R.string.faq_what_is_osm_question, SectionType.Faq, faqAnswer = R.string.faq_what_is_osm_answer), ) + ), + Sections( + R.string.settings_about_app, + listOf( + Section(R.string.settings_about_title_third_party, SectionType.Link), + ) + ), + Sections( + R.string.settings_about_title_third_party, + listOf( + Section(R.string.copyright_notices, SectionType.Title), + Section(R.string.osm_copyright, SectionType.Paragraph), + Section(R.string.openmaptiles_copyright, SectionType.Paragraph), + Section(R.string.fmod_copyright, SectionType.Paragraph), + Section(R.string.maplibre_copyright, SectionType.Paragraph), + Section(R.string.junit_copyright, SectionType.Paragraph), + + Section(R.string.apache_notices, SectionType.Title), + Section(R.string.rtree_copyright, SectionType.Paragraph), + Section(R.string.realm_copyright, SectionType.Paragraph), + Section(R.string.moshi_copyright, SectionType.Paragraph), + Section(R.string.retrofit_copyright, SectionType.Paragraph), + Section(R.string.okhttp_copyright, SectionType.Paragraph), + Section(R.string.otto_copyright, SectionType.Paragraph), + Section(R.string.leak_canary_copyright, SectionType.Paragraph), + Section(R.string.gpx_parser_copyright, SectionType.Paragraph), + Section(R.string.preferences_copyright, SectionType.Paragraph), + Section(R.string.dokka_mermaid_copyright, SectionType.Paragraph), + ) ) ) @@ -362,7 +395,13 @@ fun HelpScreen( SectionType.Paragraph -> { Text( - text = AnnotatedString.fromHtml(stringResource(section.textId)), + text = AnnotatedString.fromHtml( + stringResource(section.textId), + linkStyles = TextLinkStyles( + style = SpanStyle( + textDecoration = TextDecoration.Underline, + ) + ) ), style = MaterialTheme.typography.bodyMedium, color = OnSurface, ) @@ -614,3 +653,15 @@ fun OfflineHelpPreview() { ) } } + +@Preview(showBackground = true) +@Composable +fun ThirdPartyHelpPreview() { + SoundscapeTheme { + HelpScreen( + topic = "page${R.string.settings_about_title_third_party}", + navController = rememberNavController(), + modifier = Modifier + ) + } +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d29eff01..9f4cdd81 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -3592,4 +3592,27 @@ Alternatively, you may continue previewing the app with a predefined test locati "Train station" "%s Train station" + + + Soundscape wouldn\'t be possible without these fantastic third party libraries and data. Click on the links to see their licenses: + <a href="https://www.openstreetmap.org/copyright">©OpenStreetMap contributors</a> provide all of the geo data for mapping and audio used in Soundscape. + <a href="https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md">©OpenMapTiles</a> is used to generate the mapping tiles that we use. + <a href="https://www.fmod.com/legal">Audio Engine: FMOD Studio by Firelight Technologies Pty Ltd.</a> takes care of the audio playback. + + <a href="https://github.com/maplibre/maplibre-native/blob/main/LICENSE.md">©MapLibre</a> performs the map rendering for the UI. + + <a href="https://github.com/junit-team/junit4/blob/main/LICENSE-junit.txt">junit-team/junit4</a> for unit testing. + + + The remainder of the licenses are all Apache 2.0: + <a href="https://github.com/davidmoten/rtree2/blob/master/LICENCE">rtree2</a> makes our local geo-search much more efficient. + <a href="https://github.com/realm/realm-kotlin/blob/main/LICENSE">Realm</a> takes care of our database. + <a href="https://github.com/square/moshi/blob/master/LICENSE.txt">square/moshi</a> for GeoJSON parsing. + <a href="https://github.com/square/retrofit/blob/trunk/LICENSE.txt">square/retrofit</a> HTTP client abstraction. + <a href="https://github.com/square/okhttp/blob/master/LICENSE.txt">square/okhttp</a> underlying HTTP client. + <a href="https://github.com/square/otto/blob/master/LICENSE.txt">square/otto</a> to provide an event bus. + <a href="https://github.com/square/leakcanary/blob/main/LICENSE.txt">square/leakcanary</a> for adding mermaid diagrams to Dokka documentation. + <a href="https://github.com/ticofab/android-gpx-parser/blob/master/LICENSE">ticofab/android-gpx-parser</a> for GPX parsing. + <a href="https://github.com/zhanghai/ComposePreference/blob/master/LICENSE">zhanghai/ComposePreference</a> for a simple settings UI. + <a href="https://github.com/glureau/dokka-mermaid/blob/main/LICENSE">glureau/dokka-mermaid</a> for adding mermaid diagrams to Dokka documentation. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f8d79a8a..afbce296 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -36,7 +36,6 @@ appcompat = "1.7.0" coreKtxVersion = "1.6.1" lifecycleViewmodelCompose = "2.8.6" loggingInterceptor = "4.10.0" -mapcompose = "2.12.6" moshi = "1.15.1" moshiKotlinCodegen = "1.15.0" okhttp = "4.12.0" @@ -96,7 +95,6 @@ composepreferencelibrary = { module = "me.zhanghai.compose.preference:library", leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" } library-base = { module = "io.realm.kotlin:library-base", version.ref = "libraryBase" } logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "loggingInterceptor" } -mapcompose = { module = "ovh.plrapps:mapcompose", version.ref = "mapcompose" } material3 = { module = "androidx.compose.material3:material3" } moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" } moshi-kotlin-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshiKotlinCodegen" }