Skip to content

Commit

Permalink
Add About information for third party licenses
Browse files Browse the repository at this point in the history
This is a reasonably comprehensive list of third party libraries that are
used, though perhaps we need a Google acknowledgement too.
  • Loading branch information
davecraig committed Feb 4, 2025
1 parent 279b05e commit c9b0b78
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 8 deletions.
4 changes: 0 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import com.google.protobuf.gradle.id
import java.io.FileInputStream
import java.util.Properties

plugins {
id("com.android.application")
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
)
)
)

Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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
)
}
}
23 changes: 23 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3592,4 +3592,27 @@ Alternatively, you may continue previewing the app with a predefined test locati
<string name="osm_tag_train_station" translatable="false">"Train station"</string>
<string name="osm_tag_train_station_named" translatable="false">"%s Train station"</string>

<!-- We need to encode < as &lt; to prevent them being stripped prior to use -->
<!-- Licensing strings -->
<string name="copyright_notices" translatable="false">Soundscape wouldn\'t be possible without these fantastic third party libraries and data. Click on the links to see their licenses:</string>
<string name="osm_copyright" translatable="false">&lt;a href="https://www.openstreetmap.org/copyright">&#169;OpenStreetMap contributors&lt;/a> provide all of the geo data for mapping and audio used in Soundscape.</string>
<string name="openmaptiles_copyright" translatable="false">&lt;a href="https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md">&#169;OpenMapTiles&lt;/a> is used to generate the mapping tiles that we use.</string>
<string name="fmod_copyright" translatable="false">&lt;a href="https://www.fmod.com/legal">Audio Engine: FMOD Studio by Firelight Technologies Pty Ltd.&lt;/a> takes care of the audio playback.</string>
<!-- BSD 2-clause -->
<string name="maplibre_copyright" translatable="false">&lt;a href="https://github.com/maplibre/maplibre-native/blob/main/LICENSE.md">&#169;MapLibre&lt;/a> performs the map rendering for the UI.</string>
<!-- Eclipse -->
<string name="junit_copyright" translatable="false">&lt;a href="https://github.com/junit-team/junit4/blob/main/LICENSE-junit.txt">junit-team/junit4&lt;/a> for unit testing.</string>

<!-- Apache 2.0 -->
<string name="apache_notices" translatable="false">The remainder of the licenses are all Apache 2.0:</string>
<string name="rtree_copyright" translatable="false">&lt;a href="https://github.com/davidmoten/rtree2/blob/master/LICENCE">rtree2&lt;/a> makes our local geo-search much more efficient.</string>
<string name="realm_copyright" translatable="false">&lt;a href="https://github.com/realm/realm-kotlin/blob/main/LICENSE">Realm&lt;/a> takes care of our database.</string>
<string name="moshi_copyright" translatable="false">&lt;a href="https://github.com/square/moshi/blob/master/LICENSE.txt">square/moshi&lt;/a> for GeoJSON parsing.</string>
<string name="retrofit_copyright" translatable="false">&lt;a href="https://github.com/square/retrofit/blob/trunk/LICENSE.txt">square/retrofit&lt;/a> HTTP client abstraction.</string>
<string name="okhttp_copyright" translatable="false">&lt;a href="https://github.com/square/okhttp/blob/master/LICENSE.txt">square/okhttp&lt;/a> underlying HTTP client.</string>
<string name="otto_copyright" translatable="false">&lt;a href="https://github.com/square/otto/blob/master/LICENSE.txt">square/otto&lt;/a> to provide an event bus.</string>
<string name="leak_canary_copyright" translatable="false">&lt;a href="https://github.com/square/leakcanary/blob/main/LICENSE.txt">square/leakcanary&lt;/a> for adding mermaid diagrams to Dokka documentation.</string>
<string name="gpx_parser_copyright" translatable="false">&lt;a href="https://github.com/ticofab/android-gpx-parser/blob/master/LICENSE">ticofab/android-gpx-parser&lt;/a> for GPX parsing.</string>
<string name="preferences_copyright" translatable="false">&lt;a href="https://github.com/zhanghai/ComposePreference/blob/master/LICENSE">zhanghai/ComposePreference&lt;/a> for a simple settings UI.</string>
<string name="dokka_mermaid_copyright" translatable="false">&lt;a href="https://github.com/glureau/dokka-mermaid/blob/main/LICENSE">glureau/dokka-mermaid&lt;/a> for adding mermaid diagrams to Dokka documentation.</string>
</resources>
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" }
Expand Down

0 comments on commit c9b0b78

Please sign in to comment.