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

Bug 965711 - [VsD Refresh] Homescreen/E.Me - Implement visual refresh to smart collections icons #16343

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified apps/homescreen/collections/funny/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/funny/icon_120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/funny/icon_135.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/funny/icon_90.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/games/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/games/icon_120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/games/icon_135.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/games/icon_90.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/local/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/local/icon_120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/local/icon_135.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/local/icon_90.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/music/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/music/icon_120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/music/icon_135.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/music/icon_90.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/news/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/news/icon_120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/news/icon_135.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/news/icon_90.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/shopping/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/shopping/icon_120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/shopping/icon_135.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/shopping/icon_90.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/showbiz/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/homescreen/collections/showbiz/icon_120.png
Binary file modified apps/homescreen/collections/showbiz/icon_135.png
Binary file modified apps/homescreen/collections/showbiz/icon_90.png
Binary file modified apps/homescreen/collections/social/icon.png
Binary file modified apps/homescreen/collections/social/icon_120.png
Binary file modified apps/homescreen/collections/social/icon_135.png
Binary file modified apps/homescreen/collections/social/icon_90.png
Binary file modified apps/homescreen/collections/sports/icon.png
Binary file modified apps/homescreen/collections/sports/icon_120.png
Binary file modified apps/homescreen/collections/sports/icon_135.png
Binary file modified apps/homescreen/collections/sports/icon_90.png
Binary file modified apps/homescreen/collections/tv/icon.png
Binary file modified apps/homescreen/collections/tv/icon_120.png
Binary file modified apps/homescreen/collections/tv/icon_135.png
Binary file modified apps/homescreen/collections/tv/icon_90.png
56 changes: 0 additions & 56 deletions apps/homescreen/everything.me/config/config.js
Expand Up @@ -54,62 +54,6 @@ Evme.Config = Evme.__config = {
}
},
'maxHistoryEntries': '10',
'iconsGroupSettings': {
'1': [{
'x': 'center',
'y': 'center',
'size': 0.65,
'shadowOffsetX': 0,
'shadowOffsetY': 2,
'shadowBlur': 2,
'shadowOpacity': 0.8
}],
'2': [{
'x': 24,
'y': 'center',
'size': 0.5,
'shadowOffsetX': 0,
'shadowOffsetY': 2,
'shadowBlur': 2,
'shadowOpacity': 0.7
},
{
'x': 6,
'y': 'center',
'size': 0.6,
'shadowOffsetX': 0,
'shadowOffsetY': 2,
'shadowBlur': 2,
'shadowOpacity': 0.8
}],
'3': [{
'x': 'right',
'y': 'center',
'size': 0.45,
'shadowOffsetX': 1,
'shadowOffsetY': 1,
'shadowBlur': 2,
'shadowOpacity': 0.4
},
{
'x': 'center+4',
'y': 'center',
'size': 0.5,
'shadowOffsetX': 1,
'shadowOffsetY': 1,
'shadowBlur': 2,
'shadowOpacity': 0.7
},
{
'x': 'left',
'y': 'center',
'size': 0.6,
'shadowOffsetX': 1,
'shadowOffsetY': 1,
'shadowBlur': 2,
'shadowOpacity': 0.9
}]
},
'design': {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecated: settings for old collection icon version

'apps': {
'defaultIconUrl': {
Expand Down
66 changes: 48 additions & 18 deletions apps/homescreen/everything.me/js/Brain.js
Expand Up @@ -134,6 +134,47 @@
}
}

function updateCollectionBgImage(collectionSettings) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor. this method is now used in 2 places. see below.

var request;

var p = new window.Promise(function handler(resolve, reject) {
var query = collectionSettings.getQuery(),
checksum = collectionSettings.bg ?
collectionSettings.bg.checksum : null;

request = Evme.DoATAPI.bgimage({
'_checksum': checksum,
'query': query,
'feature': SEARCH_SOURCES.SHORTCUT_COLLECTION,
'exact': true,
'width': Evme.__config.bgImageSize[0],
'height': Evme.__config.bgImageSize[1]
}, function onSuccess(data) {
if (data.response) {
Evme.Collection.update(collectionSettings, {
'bg': {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the stored bg object

'checksum': data.checksum,
'url': data.response.source,
'data': Evme.Utils.formatImageData(data.response.image),
'revision': data.response.image.revision
}
}, resolve);
} else {
reject();
}
});
});

// for backwards compatibility we return an 'abortable' object
p.abort = function abortWrapper() {
if (request.abort) {
request.abort();
}
};

return p;
}

/* EVENT HANDLERS */

// Core.js
Expand Down Expand Up @@ -994,25 +1035,12 @@
}

function loadBGImage() {
if (!Evme.Collection.isOpen()) { return; }
if (Evme.Collection.userSetBg()) { return; }

var query = Evme.Collection.getQuery();

requestCollectionImage = Evme.DoATAPI.bgimage({
'query': query,
'feature': SEARCH_SOURCES.SHORTCUT_COLLECTION,
'exact': true,
'width': Evme.__config.bgImageSize[0],
'height': Evme.__config.bgImageSize[1]
}, function onSuccess(data) {
Evme.Collection.setBackground({
'image': Evme.Utils.formatImageData(data.response.image),
'query': query,
'source': data.response.source,
'setByUser': false
});
var collectionSettings = Evme.Collection.getCurrentSettings();

requestCollectionImage = updateCollectionBgImage(collectionSettings);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. update bg when collection opens

requestCollectionImage.then(function resolved() {
requestCollectionImage = null;
}, function rejected() {
requestCollectionImage = null;
});
}
Expand Down Expand Up @@ -1305,6 +1333,8 @@
Evme.Collection.update(collectionSettings, {
'extraIconsData': extraIconsData
});

updateCollectionBgImage(collectionSettings);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. update bg when creating new collections

}
});
}
Expand Down
2 changes: 0 additions & 2 deletions apps/homescreen/everything.me/js/Core.js
Expand Up @@ -292,8 +292,6 @@ window.Evme = new function Evme_Core() {

Evme.InstalledAppsService.init();

Evme.IconGroup.init({});

Evme.IconManager.init({});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IconGroup deprecated


Evme.SearchHistory.init({
Expand Down
1 change: 1 addition & 0 deletions apps/homescreen/everything.me/js/api/DoATAPI.js
Expand Up @@ -240,6 +240,7 @@ Evme.DoATAPI = new function Evme_DoATAPI() {
!options && (options = {});

var params = {
'_checksum': options._checksum || '',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

send _checksum to get NO CHANGE response when bg did not change

'query': options.query,
'experienceId': options.experienceId || '',
'typeHint': options.typeHint || '',
Expand Down
3 changes: 2 additions & 1 deletion apps/homescreen/everything.me/js/everything.me.js
Expand Up @@ -254,7 +254,8 @@ var EverythingME = {
'modules/Results/ResultManager.js',
'modules/Searchbar/Searchbar.js',
'modules/SearchHistory/SearchHistory.js',
'modules/Collection/Collection.js'
'modules/Collection/Collection.js',
'modules/Collection/CollectionIcon.js'
],
css_files = [
'shared/style/confirm.css',
Expand Down