Add usage of com.google.android.gms:oss-licenses-plugin to list open source licenses

This commit is contained in:
Benoit Marty 2019-06-18 17:42:07 +02:00
parent 92eb7d55dc
commit 9d3a8e7c40
6 changed files with 18 additions and 0 deletions

View File

@ -17,6 +17,7 @@ buildscript {
classpath "com.airbnb.okreplay:gradle-plugin:1.4.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2'
classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@ -1,4 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
@ -162,6 +163,9 @@ dependencies {
implementation "com.squareup.moshi:moshi-adapters:$moshi_version"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"

// OSS License
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'

// Log
implementation 'com.jakewharton.timber:timber:4.7.1'


View File

@ -54,6 +54,7 @@ public class PreferencesManager {
public static final String SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY";
public static final String SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY";
public static final String SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY = "SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY";
public static final String SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY = "SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY";
public static final String SETTINGS_COPYRIGHT_PREFERENCE_KEY = "SETTINGS_COPYRIGHT_PREFERENCE_KEY";
public static final String SETTINGS_CLEAR_CACHE_PREFERENCE_KEY = "SETTINGS_CLEAR_CACHE_PREFERENCE_KEY";
public static final String SETTINGS_CLEAR_MEDIA_CACHE_PREFERENCE_KEY = "SETTINGS_CLEAR_MEDIA_CACHE_PREFERENCE_KEY";

View File

@ -41,6 +41,7 @@ import androidx.core.content.ContextCompat
import androidx.core.content.edit
import androidx.core.view.isVisible
import androidx.preference.*
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import com.google.android.material.textfield.TextInputEditText
import com.google.android.material.textfield.TextInputLayout
import im.vector.matrix.android.api.Matrix
@ -693,6 +694,12 @@ class VectorSettingsPreferencesFragment : VectorPreferenceFragment(), SharedPref
false
}

findPreference(PreferencesManager.SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY)
.onPreferenceClickListener = Preference.OnPreferenceClickListener {
startActivity(Intent(requireActivity(), OssLicensesMenuActivity::class.java))
false
}

// update keep medias period
findPreference(PreferencesManager.SETTINGS_MEDIA_SAVING_PERIOD_KEY).let {
it.summary = PreferencesManager.getSelectedMediasSavingPeriodString(activity)

View File

@ -7,5 +7,6 @@
<string name="import_e2e_keys_from_file">"Import e2e keys from file \"%1$s\"."</string>

<string name="settings_sdk_version">Matrix SDK Version</string>
<string name="settings_other_third_party_notices">Other third party notices</string>

</resources>

View File

@ -480,6 +480,10 @@
android:key="SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY"
android:title="@string/settings_third_party_notices" />

<im.vector.riotredesign.core.preference.VectorPreference
android:key="SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY"
android:title="@string/settings_other_third_party_notices" />

<im.vector.riotredesign.core.preference.VectorPreference
android:key="SETTINGS_MEDIA_SAVING_PERIOD_KEY"
android:title="@string/settings_keep_media" />