Bug 767121 - Show tip when toolbar hides for the first time in reader (r=mbrubeck)
authorLucas Rocha <lucasr@mozilla.com>
Thu, 26 Jul 2012 10:48:52 +0100
changeset 100563 82b24fab8f1d5aaf9fde0776118966cb98049dd9
parent 100562 106da1cef37bc5de7afe72baa4bf5cf0b7302d23
child 100564 5ff3558da89d9ec261e72fc030e7b4407291a16e
push id23185
push usermbrubeck@mozilla.com
push dateThu, 26 Jul 2012 20:58:28 +0000
treeherdermozilla-central@8a7ad0adcccf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs767121
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 767121 - Show tip when toolbar hides for the first time in reader (r=mbrubeck)
mobile/android/app/mobile.js
mobile/android/chrome/content/aboutReader.js
mobile/android/locales/en-US/chrome/aboutReader.properties
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -680,8 +680,11 @@ pref("dom.min_background_timeout_value",
 // The default of font size in reader (1-7)
 pref("reader.font_size", 4);
 
 // The default of margin size in reader (5%-25%)
 pref("reader.margin_size", 5);
 
 // The default color scheme in reader (light, dark, sepia)
 pref("reader.color_scheme", "light");
+
+// Used to show a first-launch tip in reader
+pref("reader.has_used_toolbar", false);
\ No newline at end of file
--- a/mobile/android/chrome/content/aboutReader.js
+++ b/mobile/android/chrome/content/aboutReader.js
@@ -200,16 +200,26 @@ let AboutReader = {
 
     if (!this._toolbarEnabled)
       return;
 
     if (this._getToolbarVisibility() === visible)
       return;
 
     this._toolbarElement.classList.toggle("toolbar-hidden");
+
+    if (!visible && !this._hasUsedToolbar) {
+      this._hasUsedToolbar = Services.prefs.getBoolPref("reader.has_used_toolbar");
+      if (!this._hasUsedToolbar) {
+        gChromeWin.NativeWindow.toast.show(gStrings.GetStringFromName("aboutReader.toolbarTip"), "short");
+
+        Services.prefs.setBoolPref("reader.has_used_toolbar", true);
+        this._hasUsedToolbar = true;
+      }
+    }
   },
 
   _toggleToolbarVisibility: function Reader_toggleToolbarVisibility(visible) {
     this._setToolbarVisibility(!this._getToolbarVisibility());
   },
 
   _loadFromURL: function Reader_loadFromURL(url) {
     this._showProgress();
--- a/mobile/android/locales/en-US/chrome/aboutReader.properties
+++ b/mobile/android/locales/en-US/chrome/aboutReader.properties
@@ -6,8 +6,10 @@ aboutReader.loading=Loading...
 aboutReader.loadError=Failed to load article from page
 
 aboutReader.textTitle=Text
 aboutReader.marginTitle=Margins
 
 aboutReader.colorSchemeLight=Light
 aboutReader.colorSchemeDark=Dark
 aboutReader.colorSchemeSepia=Sepia
+
+aboutReader.toolbarTip=Tap the screen to show reader options