|
|
|
@ -1,10 +1,13 @@ |
|
|
|
|
package io.legado.app.ui.about |
|
|
|
|
|
|
|
|
|
import android.content.Intent |
|
|
|
|
import android.net.Uri |
|
|
|
|
import android.os.Bundle |
|
|
|
|
import androidx.preference.Preference |
|
|
|
|
import androidx.preference.PreferenceFragmentCompat |
|
|
|
|
import io.legado.app.App |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.utils.toast |
|
|
|
|
|
|
|
|
|
class AboutFragment : PreferenceFragmentCompat() { |
|
|
|
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { |
|
|
|
@ -18,4 +21,15 @@ class AboutFragment : PreferenceFragmentCompat() { |
|
|
|
|
} |
|
|
|
|
return super.onPreferenceTreeClick(preference) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun openIntent(intentName: String, address: String) { |
|
|
|
|
try { |
|
|
|
|
val intent = Intent(intentName) |
|
|
|
|
intent.data = Uri.parse(address) |
|
|
|
|
startActivity(intent) |
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
toast(R.string.can_not_open) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |