diff --git a/app/src/main/java/org/mozilla/fenix/Config.kt b/app/src/main/java/org/mozilla/fenix/Config.kt index 1cc1ac176..52454b373 100644 --- a/app/src/main/java/org/mozilla/fenix/Config.kt +++ b/app/src/main/java/org/mozilla/fenix/Config.kt @@ -6,9 +6,7 @@ package org.mozilla.fenix enum class ReleaseChannel { FenixDebug, - FenixProduction, - FennecProduction, FennecBeta; @@ -35,6 +33,12 @@ enum class ReleaseChannel { else -> false } + val isRelease: Boolean + get() = when (this) { + FennecProduction -> true + else -> false + } + val isBeta: Boolean get() = when (this) { FennecBeta -> true diff --git a/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt index 7bda04ec7..ece022c02 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt @@ -17,6 +17,7 @@ import com.google.android.gms.oss.licenses.OssLicensesMenuActivity import kotlinx.android.synthetic.main.fragment_about.* import org.mozilla.fenix.BrowserDirection import org.mozilla.fenix.BuildConfig +import org.mozilla.fenix.Config import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R import org.mozilla.fenix.components.metrics.Event @@ -38,6 +39,7 @@ import org.mozilla.geckoview.BuildConfig as GeckoViewBuildConfig */ class AboutFragment : Fragment(), AboutPageListener { + private lateinit var headerAppName: String private lateinit var appName: String private val aboutPageAdapter: AboutPageAdapter = AboutPageAdapter(this) @@ -48,6 +50,8 @@ class AboutFragment : Fragment(), AboutPageListener { ): View? { val rootView = inflater.inflate(R.layout.fragment_about, container, false) appName = getString(R.string.app_name) + headerAppName = + if (Config.channel.isRelease) getString(R.string.daylight_app_name) else appName activity?.title = getString(R.string.preferences_about, appName) return rootView @@ -64,10 +68,12 @@ class AboutFragment : Fragment(), AboutPageListener { ) } - lifecycle.addObserver(SecretDebugMenuTrigger( - logoView = wordmark, - settings = view.context.settings() - )) + lifecycle.addObserver( + SecretDebugMenuTrigger( + logoView = wordmark, + settings = view.context.settings() + ) + ) populateAboutHeader() aboutPageAdapter.submitList(populateAboutList()) @@ -75,12 +81,15 @@ class AboutFragment : Fragment(), AboutPageListener { private fun populateAboutHeader() { val aboutText = try { - val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0) + val packageInfo = + requireContext().packageManager.getPackageInfo(requireContext().packageName, 0) val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo).toString() val componentsAbbreviation = getString(R.string.components_abbreviation) - val componentsVersion = mozilla.components.Build.version + ", " + mozilla.components.Build.gitHash + val componentsVersion = + mozilla.components.Build.version + ", " + mozilla.components.Build.gitHash val maybeGecko = getString(R.string.gecko_view_abbreviation) - val geckoVersion = GeckoViewBuildConfig.MOZ_APP_VERSION + "-" + GeckoViewBuildConfig.MOZ_APP_BUILDID + val geckoVersion = + GeckoViewBuildConfig.MOZ_APP_VERSION + "-" + GeckoViewBuildConfig.MOZ_APP_BUILDID val appServicesAbbreviation = getString(R.string.app_services_abbreviation) val appServicesVersion = mozilla.components.Build.applicationServicesVersion @@ -99,7 +108,7 @@ class AboutFragment : Fragment(), AboutPageListener { "" } - val content = getString(R.string.about_content, appName) + val content = getString(R.string.about_content, headerAppName) val buildDate = BuildConfig.BUILD_DATE about_text.text = aboutText @@ -160,7 +169,12 @@ class AboutFragment : Fragment(), AboutPageListener { private fun openLibrariesPage() { startActivity(Intent(context, OssLicensesMenuActivity::class.java)) - OssLicensesMenuActivity.setActivityTitle(getString(R.string.open_source_licenses_title, appName)) + OssLicensesMenuActivity.setActivityTitle( + getString( + R.string.open_source_licenses_title, + appName + ) + ) } override fun onAboutItemClicked(item: AboutItem) { diff --git a/app/src/main/res/values/static_strings.xml b/app/src/main/res/values/static_strings.xml index 0d23cbf7c..cac5c60b5 100644 --- a/app/src/main/res/values/static_strings.xml +++ b/app/src/main/res/values/static_strings.xml @@ -36,4 +36,7 @@ link + + + Firefox Daylight