|
|
|
@ -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) {
|
|
|
|
|