Verified Commit 2b184720 authored by clairehurst's avatar clairehurst 🌱 Committed by Pier Angelo Vendrame
Browse files

[android] Bug_43351: Add function to disable forcing ALL CAPS for the fenix...

[android] Bug_43351: Add function to disable forcing ALL CAPS for the fenix snackbar action button text

This is needed because the default snackbar will force all caps, which can cause problems in some languages. See #43351 and bugzilla bug 1935387.

TODO: Remove once the forced all caps is removed by mozilla.
parent 40159f15
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1120,6 +1120,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorIn
                isDisplayedWithBrowserToolbar = true,
            )
                .setText(getString(R.string.connection_assist_connect_to_tor_before_opening_links))
                .setAllCapsForActionButton(false)
                .setAction(getString(R.string.connection_assist_connect_to_tor_before_opening_links_confirmation)) {
                    torConnectionAssistViewModel.handleConnect(searchTermOrURL)
                    if (navHost.navController.previousBackStackEntry?.destination?.id == R.id.torConnectionAssistFragment) {
+8 −0
Original line number Diff line number Diff line
@@ -100,6 +100,14 @@ class FenixSnackbar private constructor(
        }
    }

    /**
     * @param textAllCaps Present the text in ALL CAPS. This may use a small-caps form when available.
     * Overwrites the default value set in fenix_snackbar.xml
     */
    fun setAllCapsForActionButton(textAllCaps: Boolean) = this.apply {
        binding.snackbarBtn.isAllCaps = textAllCaps
    }

    companion object {
        const val LENGTH_LONG = Snackbar.LENGTH_LONG
        const val LENGTH_SHORT = Snackbar.LENGTH_SHORT