chore: simplify source code intent #97

Merged
PeterCxy merged 2 commits from septs/OpenEUICC:simplify-source-code into master 2024-12-08 16:30:02 +01:00
2 changed files with 7 additions and 6 deletions

View file

@ -47,10 +47,6 @@ class SettingsFragment: PreferenceFragmentCompat() {
setOnPreferenceClickListener(::onAppVersionClicked) setOnPreferenceClickListener(::onAppVersionClicked)
} }
findPreference<Preference>("pref_info_source_code")?.apply {
intent = Intent(Intent.ACTION_VIEW, Uri.parse(summary.toString()))
}
findPreference<Preference>("pref_language")?.apply { findPreference<Preference>("pref_language")?.apply {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) return@apply if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) return@apply
isVisible = true isVisible = true

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<im.angry.openeuicc.ui.preference.LongSummaryPreferenceCategory <im.angry.openeuicc.ui.preference.LongSummaryPreferenceCategory
app:title="@string/pref_notifications" app:title="@string/pref_notifications"
app:summary="@string/pref_notifications_desc" app:summary="@string/pref_notifications_desc"
@ -88,6 +89,10 @@
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:title="@string/pref_info_source_code" app:title="@string/pref_info_source_code"
app:summary="@string/pref_info_source_code_url" app:summary="@string/pref_info_source_code_url"
app:key="pref_info_source_code"/> app:key="pref_info_source_code">
<intent
android:action="android.intent.action.VIEW"
android:data="@string/pref_info_source_code_url" />
</Preference>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>