Skip to content

Commit

Permalink
Don't load licenses until clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Nov 13, 2023
1 parent 6839de7 commit 39d4829
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.kylecorry.trail_sense.licenses

data class Library(val name: String, val url: String, val license: String)
data class Library(val name: String, val url: String, val license: () -> String)
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LicenseFragment : PreferenceFragmentCompat() {
Alerts.dialog(
requireContext(),
library.name,
library.url + "\n\n" + library.license,
library.url + "\n\n" + library.license(),
cancelText = null,
allowLinks = true
)
Expand Down
85 changes: 49 additions & 36 deletions app/src/main/java/com/kylecorry/trail_sense/licenses/Licenses.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.kylecorry.trail_sense.licenses

@Suppress("SameParameterValue")
object Licenses {
val libraries = listOf(
Library(
"Pictogrammers",
"https://pictogrammers.com/",
"https://pictogrammers.com/"
) {
"""Pictogrammers Free License
--------------------------
Expand All @@ -28,86 +28,97 @@ licenses or are distributed under the Apache 2.0 license.
# Code: MIT (https://opensource.org/licenses/MIT)
The MIT license applies to all non-font and non-icon files."""
),
},
Library(
"Material Design Icons",
"https://github.com/google/material-design-icons/",
apache2("year", "Google", "")
),
) { apache2("year", "Google", "") },
Library(
"Material Components for Android",
"https://github.com/material-components/material-components-android",
"https://github.com/material-components/material-components-android"
) {
apache2("[yyyy]", "[name of copyright owner]", "")
),
},
Library(
"Android Jetpack",
"https://github.com/androidx/androidx",
"https://github.com/androidx/androidx"
) {
apache2("", "", "")
),
},
Library(
"RenderScript Intrinsics Replacement Toolkit",
"https://github.com/android/renderscript-intrinsics-replacement-toolkit",
"https://github.com/android/renderscript-intrinsics-replacement-toolkit"
) {
apache2("[yyyy]", "[name of copyright owner]", "")
),
},
Library(
"Markwon",
"https://github.com/noties/Markwon",
"https://github.com/noties/Markwon"
) {
apache2("{yyyy}", "{name of copyright owner}", "")
),
},
Library(
"ZXing",
"https://github.com/zxing/zxing",
"https://github.com/zxing/zxing"
) {
apache2(
"[yyyy]",
"[name of copyright owner]",
""
)
),
},
Library(
"CompassView",
"https://github.com/kix2902/CompassView",
"https://github.com/kix2902/CompassView"
) {
apache2(
"\${year}",
"\${owner}",
"Modifications made by Kyle Corry: Ported to Kotlin, changed styling."
)
),
},
Library(
"osgb",
"https://github.com/dstl/osgb",
"https://github.com/dstl/osgb"
) {
apache2(
"[yyyy]",
"[name of copyright owner]",
"Modifications made by Kyle Corry: Fixed WGS84 conversion bug"
)
),
},
Library(
"kotlinx.coroutines",
"https://github.com/Kotlin/kotlinx.coroutines",
"https://github.com/Kotlin/kotlinx.coroutines"
) {
apache2(
"2000-2020",
"JetBrains s.r.o. and Kotlin Programming Language contributors.",
""
)
),
},
Library(
"kotlin-csv",
"https://github.com/doyaaaaaken/kotlin-csv",
"https://github.com/doyaaaaaken/kotlin-csv"
) {
apache2("2021", "doyaaaaaken", "")
),
},
Library(
"subsampling-scale-image-view",
"https://github.com/davemorrissey/subsampling-scale-image-view",
"https://github.com/davemorrissey/subsampling-scale-image-view"
) {
apache2("2020", "davemorrissey", "")
),
},
Library(
"NPMap Symbol Library",
"https://github.com/nationalparkservice/symbol-library",
"https://github.com/nationalparkservice/symbol-library"
) {
bsd("2013", "Mapbox, LLC")
),
},
Library(
"NASA WORLD WIND (ported by Berico-Technologies)",
"https://github.com/Berico-Technologies/Geo-Coordinate-Conversion-Java",
"https://github.com/Berico-Technologies/Geo-Coordinate-Conversion-Java"
) {
"""NASA WORLD WIND
Copyright © 2004-2005 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. Copyright © 2004-2005 Contributors. All Rights Reserved.
Expand Down Expand Up @@ -181,28 +192,30 @@ D. Entire Understanding: This Agreement constitutes the entire understanding and
E. Binding Authority: By accepting and using the Subject Software under this Agreement, a Recipient affirms its authority to bind the Recipient to all terms and conditions of this Agreement and that that Recipient hereby agrees to all terms and conditions herein.
F. Point of Contact: Any Recipient contact with Government Agency is to be directed to the designated representative as follows: Patrick.Hogan@nasa.gov"""
),
},
Library(
"Natural Earth",
"https://www.naturalearthdata.com/",
"https://www.naturalearthdata.com/"
) {
"""Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com."""
),
},
Library(
"MERRA-2",
"https://disc.gsfc.nasa.gov/datasets/M2SMNXSLV_5.12.4/summary?keywords=statM_2d_slv_Nx",
"https://disc.gsfc.nasa.gov/datasets/M2SMNXSLV_5.12.4/summary?keywords=statM_2d_slv_Nx"
) {
"""Global Modeling and Assimilation Office (GMAO) (2015), MERRA-2 statM_2d_slv_Nx: 2d,Monthly,Aggregated Statistics,Single-Level,Assimilation,Single-Level Diagnostics V5.12.4, Greenbelt, MD, USA, Goddard Earth Sciences Data and Information Services Center (GES DISC), Accessed: 2023-05-22, 10.5067/KVIMOMCUO83U"""
),
},
Library(
"ETOPO 2022",
"https://doi.org/10.25921/fd45-gt74",
"https://doi.org/10.25921/fd45-gt74"
) {
"""NOAA National Centers for Environmental Information. 2022: ETOPO 2022 15 Arc-Second
Global Relief Model. NOAA National Centers for Environmental Information.
https://doi.org/10.25921/fd45-gt74 . Accessed 2023-05-26.
ETOPO 2022 metadata may be accessed here: ETOPO 2022 metadata landing page"""
)
}
)


private fun bsd(year: String, owner: String): String {
return """BSD License
Expand Down

0 comments on commit 39d4829

Please sign in to comment.