Add OSS licenses

This commit is contained in:
Mygod
2020-01-26 12:09:12 +08:00
parent 3cee5a4782
commit 3372d8bcbd
5 changed files with 23 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import be.mygod.vpnhotspot.util.RootSession
import be.mygod.vpnhotspot.util.launchUrl
import be.mygod.vpnhotspot.util.showAllowingStateLoss
import be.mygod.vpnhotspot.widget.SmartSnackbar
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
@@ -171,6 +172,10 @@ class SettingsPreferenceFragment : PreferenceFragmentCompat() {
EBegFragment().showAllowingStateLoss(parentFragmentManager, "EBegFragment")
true
}
findPreference<Preference>("misc.licenses")!!.setOnPreferenceClickListener {
startActivity(Intent(context, OssLicensesMenuActivity::class.java))
true
}
}
override fun onDisplayPreferenceDialog(preference: Preference) {

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"/>
</vector>

View File

@@ -88,5 +88,10 @@
app:icon="@drawable/ic_action_card_giftcard"
app:title="@string/settings_misc_donate"
app:summary="@string/settings_misc_donate_summary"/>
<Preference
app:key="misc.licenses"
app:icon="@drawable/ic_action_code"
app:title="@string/oss_license_title"
app:summary="@string/preferences_license_summary"/>
</PreferenceCategory>
</PreferenceScreen>