diff --git a/app/src/main/java/foundation/e/apps/ui/parentFragment/TimeoutFragment.kt b/app/src/main/java/foundation/e/apps/ui/parentFragment/TimeoutFragment.kt index c1e236c0712fc932991ecd47255cdeaef3ddbd7f..4d83cb13182ddc18e5482c99c86e8561d74f017b 100644 --- a/app/src/main/java/foundation/e/apps/ui/parentFragment/TimeoutFragment.kt +++ b/app/src/main/java/foundation/e/apps/ui/parentFragment/TimeoutFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 MURENA SAS + * Copyright (C) 2019-2023 MURENA SAS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,10 @@ package foundation.e.apps.ui.parentFragment +import android.content.Intent +import android.graphics.Paint +import android.net.Uri +import android.widget.TextView import androidx.annotation.LayoutRes import androidx.appcompat.app.AlertDialog import androidx.core.view.isVisible @@ -220,6 +224,17 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) { } } + private fun openTroubleshootingPage() { + val troubleshootUrl = getString(R.string.troubleshootURL) + val openUrlIntent = Intent(Intent.ACTION_VIEW) + openUrlIntent.data = Uri.parse(troubleshootUrl) + startActivity(openUrlIntent) + } + + private fun setTextviewUnderlined(textView: TextView) { + textView.paintFlags = textView.paintFlags or Paint.UNDERLINE_TEXT_FLAG + } + /** * Call to trigger [onTimeout]. * Can be called from anywhere in the fragment. @@ -235,6 +250,10 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) { logDisplay.isVisible = true moreInfo.isVisible = false } + setTextviewUnderlined(troubleshootingLink) + troubleshootingLink.setOnClickListener { + openTroubleshootingPage() + } val logToDisplay = exception.message ?: "" @@ -281,6 +300,10 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) { logDisplay.isVisible = true moreInfo.isVisible = false } + setTextviewUnderlined(troubleshootingLink) + troubleshootingLink.setOnClickListener { + openTroubleshootingPage() + } val logToDisplay = exception.message ?: "" if (logToDisplay.isNotBlank()) { @@ -336,6 +359,11 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) { logDisplay.isVisible = true moreInfo.isVisible = false } + setTextviewUnderlined(troubleshootingLink) + troubleshootingLink.setOnClickListener { + openTroubleshootingPage() + } + val logToDisplay = exception.message ?: "" if (logToDisplay.isNotBlank()) { logDisplay.text = logToDisplay @@ -412,4 +440,4 @@ abstract class TimeoutFragment(@LayoutRes layoutId: Int) : Fragment(layoutId) { super.onDestroyView() authObjects.value = null } -} +} \ No newline at end of file diff --git a/app/src/main/java/foundation/e/apps/ui/settings/SettingsFragment.kt b/app/src/main/java/foundation/e/apps/ui/settings/SettingsFragment.kt index cdff64f529a834f7a97919f5228d0ca0e325af16..b2e6140e1afc3609a6bbb45531e4b260ea9a3ebf 100644 --- a/app/src/main/java/foundation/e/apps/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/foundation/e/apps/ui/settings/SettingsFragment.kt @@ -1,6 +1,6 @@ /* * Apps Quickly and easily install Android apps onto your device! - * Copyright (C) 2022 E FOUNDATION + * Copyright (C) 2022-2023 E FOUNDATION * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/app/src/main/res/layout/custom_preference.xml b/app/src/main/res/layout/custom_preference.xml index 2ebf0bbbdbb6672b2b105174efde4b9aac19adf6..36981c7c1069c3db81a675998c357fd0f4090a46 100644 --- a/app/src/main/res/layout/custom_preference.xml +++ b/app/src/main/res/layout/custom_preference.xml @@ -24,6 +24,7 @@ android:layout_height="match_parent" android:orientation="vertical"> + - - \ No newline at end of file diff --git a/app/src/main/res/layout/custom_preferences_troubleshooting_link.xml b/app/src/main/res/layout/custom_preferences_troubleshooting_link.xml new file mode 100644 index 0000000000000000000000000000000000000000..b8f85dce57128473ef315bf3a3dccb2bbb348076 --- /dev/null +++ b/app/src/main/res/layout/custom_preferences_troubleshooting_link.xml @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_error_log.xml b/app/src/main/res/layout/dialog_error_log.xml index e4005d62888edd5e2ee3382524d7df09a06239df..52a727d1cd37af2c4a57eb6be70fb0af49319ed3 100644 --- a/app/src/main/res/layout/dialog_error_log.xml +++ b/app/src/main/res/layout/dialog_error_log.xml @@ -1,6 +1,6 @@ Update All diff --git a/app/src/main/res/xml/settings_preferences.xml b/app/src/main/res/xml/settings_preferences.xml index 13f2688d10c988acb3c69d966b48046df6f11362..6eeb9c06a5c0164c83b9cdd035386ba2f39c1cee 100644 --- a/app/src/main/res/xml/settings_preferences.xml +++ b/app/src/main/res/xml/settings_preferences.xml @@ -1,6 +1,6 @@