This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1545805 - Update Fennec Onboarding process; r=VladBaicu
The new Onboarding process will have updated imagery and strings. It will also not show the "Customize" screen anymore. It will only be shown if the new Strings are localized; Differential Revision: https://phabricator.services.mozilla.com/D28863
- Loading branch information
Petru Lingurar
committed
Apr 25, 2019
1 parent
431dce2
commit 3f255eb
Showing
11 changed files
with
167 additions
and
32 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
mobile/android/base/java/org/mozilla/gecko/util/OnboardingStringUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- | ||
* 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/. */ | ||
|
||
package org.mozilla.gecko.util; | ||
|
||
import android.content.Context; | ||
import android.content.res.Resources; | ||
|
||
import org.mozilla.gecko.AppConstants; | ||
import org.mozilla.gecko.R; | ||
|
||
import java.util.Locale; | ||
|
||
public class OnboardingStringUtil { | ||
private static OnboardingStringUtil INSTANCE; | ||
|
||
private static String initialWelcomeMessage; | ||
private static String updatedWelcomeMessage; | ||
private static String initialWelcomeSubtext = | ||
"A modern mobile browser from Mozilla, the non-profit committed to a free and open web."; | ||
private static String updatedWelcomeSubtext; | ||
|
||
private static String initialPrivacySubtext = "Private Browsing with Tracking Protection blocks " + | ||
"trackers while you browse and won’t remember your history when you finish browsing."; | ||
private static String updatedPrivacySubtext; | ||
|
||
private static String initialSyncSubtext = "Use Sync to find the bookmarks, passwords, and other " + | ||
"things you save to &brandShortName; on all your devices."; | ||
private static String updatedSyncSubtext; | ||
|
||
private static boolean areStringsLocalized = false; | ||
|
||
private OnboardingStringUtil(final Context context) { | ||
|
||
final Locale locale = context.getResources().getConfiguration().locale; | ||
if ("en".equals(locale.getLanguage())) { | ||
areStringsLocalized = true; | ||
return; | ||
} | ||
|
||
final Resources resources = context.getResources(); | ||
initialWelcomeMessage = "Thanks for choosing " + AppConstants.MOZ_APP_BASENAME; | ||
updatedWelcomeMessage = resources.getString(R.string.firstrun_urlbar_message); | ||
updatedWelcomeSubtext = resources.getString(R.string.firstrun_urlbar_subtext); | ||
updatedPrivacySubtext = resources.getString(R.string.firstrun_privacy_subtext); | ||
updatedSyncSubtext = resources.getString(R.string.firstrun_sync_subtext); | ||
|
||
final boolean areWelcomeStringsLocalized = | ||
!initialWelcomeMessage.equals(updatedWelcomeMessage) && | ||
!initialWelcomeSubtext.equals(updatedWelcomeSubtext); | ||
final boolean arePrivacyStringsLocalized = | ||
!initialPrivacySubtext.equals(updatedPrivacySubtext); | ||
final boolean areSyncStringsLocalized = | ||
!initialSyncSubtext.equals(updatedSyncSubtext); | ||
|
||
areStringsLocalized = areWelcomeStringsLocalized && arePrivacyStringsLocalized && areSyncStringsLocalized; | ||
} | ||
|
||
public static OnboardingStringUtil getInstance(final Context context) { | ||
if (INSTANCE == null) { | ||
INSTANCE = new OnboardingStringUtil(context); | ||
} | ||
return INSTANCE; | ||
} | ||
|
||
public boolean areStringsLocalized() { | ||
return areStringsLocalized; | ||
} | ||
} |