Changes

Jump to: navigation, search

Firefox OS/Stingray/SmartScreen/

1,433 bytes added, 03:59, 6 November 2014
Card UI
Card UI is the main feature of smart screen. It comprised of smart system, smart home, app deck, device deck, tv deck, settings app, browser app, and dashboard app. Bookmarks or short-cuts in smart home are '''CARDs'''. All decks has the ability to create a card to smart-home app. All decks and apps are normal app in smart-system app. Their relationships can be found as the following figure:
 
[[File:Smart_Screen(1).png|Relationships among apps]]
 
== Smart Home ==
Smart home app is the default home app which hosts decks and cards. Smart home app is the owner of cards data store. It creates a card while a deck sends a '''mozActivity''' to smart home. And all decks will listen the change event or read the cards record of data store to determine if their cards are already created.
The card can be deleted from both deck and smart home. If card is asked to be removed from a deck, the deck sends a mozActivity to smart home app to remove it. If a card is removed from smart home, the deck may know it by read the record from data store or listen the change event of data store.
According to [[File:Ux-spec-unpin-from-app.png|UX specabout unpin from app]] As per the design of mozActivity, system app always opens a activity window for it. But card removed from deck app should not have a transition to smart home app, according to UX spec above. We may let data store be writable or send a mozActivity to smart system app and send an IAC message to smart home app to tell that. And this is a workaround to archive that. (THE WORKAROUND IS NOT DECIDED, YET)
== Smart System ==
The smart system app is folk from phone's system app. We may find the smart-system app at {GAIA}/tv_apps/smart-system . We The file custom-prefs.js is a pref file which overrides the default preferences in b2g. While booting, B2G reads b2g.system_startup_url, b2g.system_manifest_url and b2g.neterror.url to find the entry point of system app. So, we use the custom-prefs.js to switch to smart-system app in TV build, like:
user_pref('b2g.system_startup_url',
user_pref('b2g.neterror.url',
'app://smart-system.gaiamobile.org/net_error.html');
 
The main difference between phone's system app and smart system app is we introduce landing app in smart system. Once the device booted, the first app shown to user is '''LANDING APP''' which can be any app users want. Smart system app reads a mozSettings, landing_app.manifestURL, to find out the landing app:
Another difference is that smart system app removes lots ICC related modules, like icc, callscreen, dialer_agent, etc. We kept the whole window management, popups, dialogs, toast, orientation manager, sound manager, etc in smart system. Most of them are related to window management and background service. So, the smart system may boot a little faster than phone's system app.
According to UX/VD, we will change the behavior of window manager, including the landing app support, animations, launching position, etc. (THE DETAILED CHANGES IS NOT DECIDED, YET.)
== Decks ==
Decks are apps with the ability to '''PIN A CARD TO HOME'''and the pined cards are grouped by decks. All decks will be shown at smart home app and can be set as the landing appby default. According  === Pin to the definition Home ===[[File:Pin_To_Home.png|Flow of smart pin to home and unpin from home, a ]] A deck can use '''mozActivity''' to pin a card to home and can have should declare the data store permission to query if an launch path is pined as a card.  A launch path may point to the deck app itself of or to another app's launch path. Like TV deck, it may pin a channel as a card whose launch path may the same as TV deck with hash included, ie: apps://tv.gaiamobile.org/#66. Or app deck may pin an app as a card whose launch path may be apps://otherapp.gaiamobile.org/index.html. An , please find the following example of pin to home may be:
// From TV deck to pin a channel as a card new mozActivityMozActivity({
name: 'pin-to-home',
data: {
}
});
 
Or app deck may pin an app as a card whose launch path may be apps://otherapp.gaiamobile.org/index.html, like the following example:
 
// From app deck to pin an app as a card
new MozActivity({
name: 'pin-to-home',
data: {
manifestURL: 'app://otherapp.gaiamobile.org/manifest.webapp',
launchPath: '/index.html',
name: 'Other App',
thumbnail: ref-to-icon
}
});
 
=== Consistent Menu ===
[[File:Ux-spec-unpin-from-app.png|UX spec about unpin from app]]
 
As per UX spec above, we need a consistent pin/unpin menu among all decks. To achieve that, we use system context menu which is based on [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu MENU] tag. An example can be found at:
 
<body contextmenu="ctxmenu">
...
<menu type="context" id="ctxmenu">
<menuitem label="Pin to Home" icon="/icons/pin-to-home.png"></menuitem>
<menuitem label="Add as Favorite" icon="/icon/favorite.gif"></menuitem>
</menu>
...
</body>
Confirm
209
edits

Navigation menu