Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #1116 - Uses alias link for help
Browse files Browse the repository at this point in the history
  • Loading branch information
boek committed Jun 14, 2019
1 parent 5540230 commit 7ebdfcc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,12 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
}
}
ToolbarMenu.Item.Help -> {
requireComponents.useCases.tabsUseCases.addTab.invoke(SupportUtils.HELP_URL)
requireComponents.useCases.tabsUseCases.addTab.invoke(
SupportUtils.getSumoURLForTopic(
requireContext(),
SupportUtils.SumoTopic.HELP
)
)
}
ToolbarMenu.Item.NewTab -> {
val directions = BrowserFragmentDirections
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,10 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
HomeMenu.Item.Help -> {
invokePendingDeleteJobs()
(activity as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = SupportUtils.HELP_URL,
searchTermOrURL = SupportUtils.getSumoURLForTopic(
context!!,
SupportUtils.SumoTopic.HELP
),
newTab = true,
from = BrowserDirection.FromHome
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver {
}
resources.getString(pref_key_help) -> {
(activity as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = SupportUtils.HELP_URL,
searchTermOrURL = SupportUtils.getSumoURLForTopic(context!!, SupportUtils.SumoTopic.HELP),
newTab = true,
from = BrowserDirection.FromSettings
)
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/org/mozilla/fenix/settings/SupportUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ import java.util.Locale

object SupportUtils {
const val RATE_APP_URL = "market://details?id=" + BuildConfig.APPLICATION_ID
const val MOZILLA_MANIFESTO_URL = "https://www.mozilla.org/en-GB/about/manifesto/"
const val FENIX_PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=${BuildConfig.APPLICATION_ID}"
val PRIVACY_NOTICE_URL: String
get() = "https://www.mozilla.org/${getLanguageTag(Locale.getDefault())}/privacy/firefox/"

val HELP_URL: String
get() = "https://support.mozilla.org/${getLanguageTag(Locale.getDefault())}/products/firefox-preview"

enum class SumoTopic(
internal val topicStr: String
) {
HELP("faq-android"),
PRIVATE_BROWSING_MYTHS("common-myths-about-private-browsing"),
YOUR_RIGHTS("your-rights")
}
Expand Down

0 comments on commit 7ebdfcc

Please sign in to comment.