Skip to content
Permalink
Browse files

Show open source licenses

Closes #392
  • Loading branch information...
chrisbanes committed Aug 13, 2019
1 parent 31cdfcb commit fb55e4171c6a57a64a2a893a97277dec75c1830c
@@ -49,6 +49,8 @@ play {
serviceAccountCredentials = rootProject.file('signing/play-account.json')
}

apply plugin: 'com.google.android.gms.oss-licenses-plugin'

apply plugin: "androidx.navigation.safeargs.kotlin"

def appVersionCode = propOrDef("tivi.versioncode", 17) as Integer
@@ -228,6 +230,7 @@ dependencies {

implementation Libs.Google.firebaseCore
implementation Libs.Google.crashlytics
implementation Libs.Google.openSourceLicensesLibrary

testImplementation Libs.junit
testImplementation Libs.robolectric
@@ -16,6 +16,7 @@

package app.tivi.settings

import android.content.Intent
import android.os.Bundle
import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.net.toUri
@@ -24,6 +25,7 @@ import androidx.preference.PreferenceFragmentCompat
import app.tivi.BuildConfig
import app.tivi.R
import app.tivi.extensions.resolveThemeColor
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity

class SettingsFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
@@ -37,6 +39,11 @@ class SettingsFragment : PreferenceFragmentCompat() {
true
}

findPreference<Preference>("open_source")?.setOnPreferenceClickListener {
startActivity(Intent(requireContext(), OssLicensesMenuActivity::class.java))
true
}

findPreference<Preference>("version")?.apply {
summary = getString(R.string.settings_app_version_summary,
BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)
@@ -39,6 +39,11 @@
android:key="privacy_policy"
android:title="@string/view_privacy_policy" />

<Preference
android:key="open_source"
android:title="@string/settings_open_source"
android:summary="@string/settings_open_source_summary"/>

<Preference
android:key="version"
android:title="@string/settings_app_version" />
@@ -45,6 +45,7 @@ buildscript {

classpath Libs.Google.gmsGoogleServices
classpath Libs.Google.fabricPlugin
classpath Libs.Google.openSourceLicensesPlugin

classpath Libs.AndroidX.Navigation.safeArgs
}
@@ -50,6 +50,9 @@ object Libs {
const val crashlytics = "com.crashlytics.sdk.android:crashlytics:2.10.1"
const val gmsGoogleServices = "com.google.gms:google-services:4.3.0"
const val fabricPlugin = "io.fabric.tools:gradle:1.31.0"

const val openSourceLicensesPlugin = "com.google.android.gms:oss-licenses-plugin:0.9.5"
const val openSourceLicensesLibrary = "com.google.android.gms:play-services-oss-licenses:17.0.0"
}

object Kotlin {
@@ -126,4 +126,7 @@
<string name="privacy_policy_url" translatable="false">https://chrisbanes.github.io/tivi/privacypolicy.html</string>
<string name="settings_app_version">Version</string>
<string name="settings_app_version_summary">v%1$s (%2$d)</string>

<string name="settings_open_source">Open source licenses</string>
<string name="settings_open_source_summary">Tivi 💞 open source</string>
</resources>

0 comments on commit fb55e41

Please sign in to comment.
You can’t perform that action at this time.