Skip to content

Commit

Permalink
Remove function to get locale website
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-BaptisteC committed May 25, 2024
1 parent 61ff700 commit 7ceb264
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.eu.exodus_privacy.exodusprivacy.BuildConfig
import org.eu.exodus_privacy.exodusprivacy.R
import org.eu.exodus_privacy.exodusprivacy.databinding.FragmentAboutBinding
import org.eu.exodus_privacy.exodusprivacy.fragments.dialog.ThemeDialogFragment
import org.eu.exodus_privacy.exodusprivacy.utils.getLanguage
import org.eu.exodus_privacy.exodusprivacy.utils.openURL
import org.eu.exodus_privacy.exodusprivacy.utils.startIntent
import javax.inject.Inject
Expand All @@ -30,21 +29,13 @@ class AboutFragment : PreferenceFragmentCompat() {
companion object {
private const val analyzeURL = "https://reports.exodus-privacy.eu.org/analysis/submit/"
private const val alternativesURL = "https://reports.exodus-privacy.eu.org/info/next/"
private const val privacyPolicyURL = "https://exodus-privacy.eu.org/en/page/privacy-policy/"
private const val privacyPolicyURL = "https://exodus-privacy.eu.org/page/privacy-policy/"
private const val sourceCodeURL = "https://github.com/Exodus-Privacy/exodus-android-app"
private const val websiteURL = "https://exodus-privacy.eu.org/"
private const val mastodonURL = "https://framapiaf.org/@exodus"
private const val emailID = "[email protected]"
}

private fun getLocaleWebsiteURL(): String {
return if (getLanguage() != "fr") {
websiteURL + "en"
} else {
websiteURL + "fr"
}
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
_binding = FragmentAboutBinding.bind(view)
Expand Down Expand Up @@ -93,7 +84,7 @@ class AboutFragment : PreferenceFragmentCompat() {
}

findPreference<Preference>("website")?.setOnPreferenceClickListener {
openURL(customTabsIntent, it.context, getLocaleWebsiteURL())
openURL(customTabsIntent, it.context, websiteURL)
true
}

Expand All @@ -113,7 +104,7 @@ class AboutFragment : PreferenceFragmentCompat() {
}

findPreference<Preference>("privPolicy")?.setOnPreferenceClickListener {
openURL(customTabsIntent, it.context, getLocaleWebsiteURL() + "/page/privacy-policy/")
openURL(customTabsIntent, it.context, privacyPolicyURL)
true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.core.content.ContextCompat
import androidx.core.text.isDigitsOnly
import com.google.android.material.chip.Chip
import org.eu.exodus_privacy.exodusprivacy.R
import java.util.Locale

fun Chip.setExodusColor(size: String) {
val textColorStateList: ColorStateList
Expand Down Expand Up @@ -49,10 +48,6 @@ fun Chip.setExodusColor(size: String) {
this.chipBackgroundColor = backgroundColorStateList
}

fun getLanguage(): String {
return Locale.getDefault().language
}

fun PackageManager.getInstalledPackagesList(flags: Int): List<PackageInfo> {
return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
this.getInstalledPackages(flags)
Expand Down

0 comments on commit 7ceb264

Please sign in to comment.