Commit 54543e9c authored by clairehurst's avatar clairehurst 🌱 Committed by Pier Angelo Vendrame
Browse files

TB 44027 [android]: Update PBM lockscreen

#44027 Update PBM lockscreen
parent d69e7f4c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -62,4 +62,8 @@ private const val MEDIUM_WINDOW_WIDTH = 700
    device = Devices.PIXEL_TABLET,
    uiMode = Configuration.UI_MODE_NIGHT_YES,
)
@Preview(
    name = "Large text",
    fontScale = 2.5f,
)
annotation class FlexibleWindowLightDarkPreview
+7.26 KiB
Loading image diff...
+4 −4
Original line number Diff line number Diff line
@@ -56,8 +56,7 @@ class UnlockPrivateTabsFragment : Fragment(), UserInteractionHandler {
                UnlockPrivateTabsScreen(
                    onUnlockClicked = { requestPrompt() },
                    onLeaveClicked = {
                        PrivateBrowsingLocked.seeOtherTabsClicked.record()
                        closeFragment()
                        requireActivity().moveTaskToBack(true)
                    },
                )

@@ -67,13 +66,14 @@ class UnlockPrivateTabsFragment : Fragment(), UserInteractionHandler {
    }

    override fun onBackPressed(): Boolean {
        closeFragment()
        requireActivity().moveTaskToBack(true)
        return true
    }

    private fun requestPrompt() {
        DefaultBiometricUtils.bindBiometricsCredentialsPromptOrShowWarning(
            titleRes = R.string.pbm_authentication_unlock_private_tabs,
            titleRes = R.string.tor_authentication_unlock_private_tabs,
            titleRes2 = R.string.app_name,
            view = requireView(),
            onShowPinVerification = { intent -> startForResult.launch(intent) },
            onAuthSuccess = ::onAuthSuccess,
+28 −15
Original line number Diff line number Diff line
@@ -31,6 +31,14 @@ import org.mozilla.fenix.ext.isLargeWindow
import org.mozilla.fenix.theme.FirefoxTheme
import org.mozilla.fenix.theme.Theme

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
import org.mozilla.fenix.compose.parseHtml

private const val FILL_WIDTH_LARGE_WINDOW = 0.5f
private const val FILL_WIDTH_DEFAULT = 1.0f

@@ -71,17 +79,31 @@ private fun Header() {
    Column(
        modifier = Modifier.padding(horizontal = 16.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
    ) {
        Row (
            verticalAlignment = Alignment.CenterVertically
        ) {
            Image(
            painter = painterResource(id = R.drawable.ic_pbm_firefox_logo),
                painter = painterResource(id = R.drawable.tor_browser_app_icon),
                contentDescription = null, // decorative only.
            modifier = Modifier.padding(32.dp),
                Modifier
                    .size(62.dp)
                    .padding(end = 10.dp),
            )
            Text(
                text = stringResource(R.string.app_name),
                color = FirefoxTheme.colors.textPrimary,
                fontWeight = FontWeight.Bold,
                fontSize = 30.sp,
                letterSpacing = 0.18.sp,
                lineHeight = 30.sp,
            )
        }

        Spacer(modifier = Modifier.height(24.dp))

        Text(
            text = stringResource(id = R.string.pbm_authentication_unlock_private_tabs),
            text = stringResource(id = R.string.tor_authentication_unlock_private_tabs, stringResource(R.string.app_name)),
            color = FirefoxTheme.colors.textPrimary,
            textAlign = TextAlign.Center,
            style = FirefoxTheme.typography.headline6,
@@ -109,15 +131,6 @@ private fun Footer(onUnlockClicked: () -> Unit, onLeaveClicked: () -> Unit) {
            modifier = Modifier.fillMaxWidth(),
            onClick = onUnlockClicked,
        )

        Spacer(modifier = Modifier.height(8.dp))

        TextButton(
            text = stringResource(R.string.pbm_authentication_leave_private_tabs),
            onClick = onLeaveClicked,
            textColor = FirefoxTheme.colors.textActionPrimary,
            upperCaseText = false,
        )
    }
}

+2 −1
Original line number Diff line number Diff line
@@ -312,7 +312,8 @@ fun Fragment.verifyUser(
    onVerified: (() -> Unit)? = null,
) {
    biometricUtils.bindBiometricsCredentialsPromptOrShowWarning(
        titleRes = R.string.pbm_authentication_unlock_private_tabs,
        titleRes = R.string.tor_authentication_unlock_private_tabs,
        titleRes2 = R.string.app_name,
        view = requireView(),
        onShowPinVerification = { intent -> fallbackVerification.launch(intent) },
        onAuthSuccess = { handleVerificationSuccess(requireContext(), onVerified) },
Loading