1
0
Fork 0

No issue: Remove duplicate wordmark and update about page (#3590)

master
Tiger Oakes 2019-07-01 11:54:16 -04:00 committed by Sawyer Blatz
parent 219b5f3d01
commit d42052079a
8 changed files with 79 additions and 64 deletions

View File

@ -11,7 +11,7 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.annotation.RequiresApi
import androidx.core.content.pm.PackageInfoCompat import androidx.core.content.pm.PackageInfoCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import kotlinx.android.synthetic.main.fragment_about.* import kotlinx.android.synthetic.main.fragment_about.*
@ -20,6 +20,7 @@ import org.mozilla.fenix.R
import org.mozilla.geckoview.BuildConfig as GeckoViewBuildConfig import org.mozilla.geckoview.BuildConfig as GeckoViewBuildConfig
class AboutFragment : Fragment() { class AboutFragment : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_about, container, false) return inflater.inflate(R.layout.fragment_about, container, false)
} }
@ -27,35 +28,40 @@ class AboutFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val appName = requireContext().resources.getString(R.string.app_name) val appName = getString(R.string.app_name)
(activity as AppCompatActivity).title = getString(R.string.preferences_about, appName) activity?.title = getString(R.string.preferences_about, appName)
val maybeGecko = if (SDK_INT < Build.VERSION_CODES.N) {
"GV: "
} else {
" \uD83E\uDD8E "
}
val aboutText = try { val aboutText = try {
val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0) val packageInfo = requireContext().packageManager.getPackageInfo(requireContext().packageName, 0)
val geckoVersion = PackageInfoCompat.getLongVersionCode(packageInfo).toString() + maybeGecko + val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo).toString()
GeckoViewBuildConfig.MOZ_APP_VERSION + "-" + GeckoViewBuildConfig.MOZ_APP_BUILDID
val componentsVersion = mozilla.components.Build.version val componentsVersion = mozilla.components.Build.version
val maybeGecko = if (SDK_INT >= Build.VERSION_CODES.N) GECKO_EMOJI else "GV"
val geckoVersion = GeckoViewBuildConfig.MOZ_APP_VERSION + "-" + GeckoViewBuildConfig.MOZ_APP_BUILDID
String.format( String.format(
"%s (Build #%s)\nAC: %s", "%s (Build #%s)\n%s: %s\n%s: %s",
packageInfo.versionName, packageInfo.versionName,
geckoVersion, versionCode,
componentsVersion COMPONENTS_EMOJI,
componentsVersion,
maybeGecko,
geckoVersion
) )
} catch (e: PackageManager.NameNotFoundException) { } catch (e: PackageManager.NameNotFoundException) {
"" ""
} }
val buildDate = BuildConfig.BUILD_DATE val buildDate = BuildConfig.BUILD_DATE
val content = resources.getString(R.string.about_content, appName) val content = getString(R.string.about_content, appName)
about_text.text = aboutText about_text.text = aboutText
about_content.text = content about_content.text = content
build_date.text = buildDate build_date.text = buildDate
} }
companion object {
private const val COMPONENTS_EMOJI = "\uD83D\uDCE6"
@RequiresApi(Build.VERSION_CODES.N)
private const val GECKO_EMOJI = "\uD83E\uDD8E"
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<inset xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/ic_logo_wordmark_private"/>

View File

@ -2,67 +2,71 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
tools:context="org.mozilla.fenix.settings.AboutFragment"> tools:context="org.mozilla.fenix.settings.AboutFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/wordmark" android:id="@+id/wordmark"
android:importantForAccessibility="no" android:layout_marginTop="24dp"
android:src="?fenixLogo" android:layout_width="0dp"
android:layout_marginTop="24dp" android:layout_height="80dp"
android:layout_height="80dp" android:contentDescription="@string/app_name"
android:layout_width="0dp" android:src="?fenixLogo"
app:layout_constraintWidth_percent="0.75" app:layout_constraintWidth_percent="0.75"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"/>
<TextView <TextView
android:id="@+id/about_text" android:id="@+id/about_text"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="16sp" android:textSize="16sp"
android:textIsSelectable="true" android:textIsSelectable="true"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
app:layout_constraintWidth_percent="0.8" app:layout_constraintWidth_percent="0.8"
app:layout_constraintTop_toBottomOf="@id/wordmark" app:layout_constraintTop_toBottomOf="@id/wordmark"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:textAlignment="center" /> tools:text="1.0.x (Build #x 🦎 69.x-x)\nAC: 1.0.0"
android:textAlignment="center" />
<TextView <TextView
android:id="@+id/about_content" android:id="@+id/about_content"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="18sp" android:textSize="18sp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
app:layout_constraintWidth_percent="0.8" app:layout_constraintWidth_percent="0.8"
app:layout_constraintTop_toBottomOf="@id/about_text" app:layout_constraintTop_toBottomOf="@id/about_text"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:textAlignment="center" /> tools:text="@string/about_content"
android:textAlignment="center" />
<TextView <TextView
android:id="@+id/build_date" android:id="@+id/build_date"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:textSize="16sp" android:textSize="16sp"
android:textIsSelectable="true" android:textIsSelectable="true"
app:layout_constraintWidth_percent="0.8" app:layout_constraintWidth_percent="0.8"
app:layout_constraintTop_toBottomOf="@id/about_content" app:layout_constraintTop_toBottomOf="@id/about_content"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:textAlignment="center" /> tools:text="Monday 1/2 @ 5:00 PM"
android:textAlignment="center" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>