Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #24987 from jmcanterafonseca/fix_settings_popup2
Browse files Browse the repository at this point in the history
Bug 1055685 - Contacts settings screen animates in too slowly
  • Loading branch information
jmcanterafonseca committed Oct 17, 2014
2 parents b0feabe + df55009 commit b0befba
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/communications/contacts/js/contacts.js
Expand Up @@ -36,7 +36,7 @@ var Contacts = (function() {

var goToForm = function edit() {
var transition = ActivityHandler.currentlyHandling ?
'activity-popup' : 'popup';
'activity-popup' : 'fade-in';

navigation.go('view-contact-form', transition);
};
Expand Down Expand Up @@ -694,7 +694,7 @@ var Contacts = (function() {
initSettings(function onSettingsReady() {
// The number of FB Friends has to be recalculated
contacts.Settings.refresh();
navigation.go('view-settings', 'popup');
navigation.go('view-settings', 'fade-in');
});
};

Expand Down
8 changes: 8 additions & 0 deletions apps/communications/contacts/js/navigation.js
Expand Up @@ -36,6 +36,14 @@ function navigationStack(currentView) {
},
backwards: {}
},
'fade-in': {
forwards: {
next: 'fade-in'
},
backwards: {
current: 'fade-out'
}
},
'go-deeper': {
forwards: {
current: 'app-go-deeper-out',
Expand Down
7 changes: 7 additions & 0 deletions apps/communications/contacts/style/contacts.css
Expand Up @@ -910,3 +910,10 @@ form[role="combobox"] span[data-field="type"] {
margin: 1rem;
width: calc(100% - 2rem);
}

/* We need this rule because these views are going to be in the bottom */
/* This will avoid a repainting and a flash to the user when we fade-out */
/* particulary in the flow: settings -> back() -> contact list */
#view-settings.fade-in, #view-contact-form.fade-in {
transform: translateY(0);
}
3 changes: 2 additions & 1 deletion tests/python/gaia-ui-tests/gaiatest/apps/contacts/app.py
@@ -1,6 +1,6 @@
# 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/.
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from marionette.by import By
from marionette.errors import JavascriptException
Expand Down Expand Up @@ -66,6 +66,7 @@ def a11y_click_new_contact(self):

def tap_settings(self):
self.marionette.find_element(*self._settings_button_locator).tap()
self.wait_for_element_not_displayed(*self._settings_button_locator)
from gaiatest.apps.contacts.regions.settings_form import SettingsForm
return SettingsForm(self.marionette)

Expand Down
Expand Up @@ -57,6 +57,7 @@ def tap_send_sms(self):
def tap_edit(self):
self.wait_for_element_displayed(*self._edit_contact_button_locator)
self.marionette.find_element(*self._edit_contact_button_locator).tap()
self.wait_for_element_not_displayed(*self._edit_contact_button_locator)
from gaiatest.apps.contacts.regions.contact_form import EditContact
return EditContact(self.marionette)

Expand Down

0 comments on commit b0befba

Please sign in to comment.