Standalone Tags - Checkpoint

This commit is contained in:
Roxanne Skelly 2019-02-14 08:48:37 -08:00
parent 5db764f5df
commit 20d7e00ea8
6 changed files with 158 additions and 20 deletions

View file

@ -39,6 +39,7 @@ Item {
property bool isConcurrency: action === 'concurrency';
property bool isAnnouncement: action === 'announcement';
property bool isStacked: !isConcurrency && drillDownToPlace;
property bool standaloneOptimized: true;
property int textPadding: 10;
property int smallMargin: 4;
@ -281,7 +282,26 @@ Item {
right: parent.right;
margins: smallMargin;
}
}
HiFiGlyphs {
id: standaloneOptomizedBadge
anchors {
right: actionIcon.left
verticalCenter: parent.verticalCenter
bottom: parent.bottom;
}
height: root.standaloneOptimized ? 34 : 0
visible: standaloneOptimized
text: hifi.glyphs.hmd
size: 34
horizontalAlignment: Text.AlignHCenter
color: hifi.colors.blueHighlight
}
function go() {
Tablet.playSound(TabletEnums.ButtonClick);
goFunction(drillDownToPlace ? ("/places/" + placeName) : ("/user_stories/" + storyId));

View file

@ -122,6 +122,8 @@ Rectangle {
marketplaceItem.license = result.data.license;
marketplaceItem.available = result.data.availability === "available";
marketplaceItem.created_at = result.data.created_at;
marketplaceItem.standaloneOptimized = result.data.standalone_optimized;
marketplaceItem.standaloneVisible = result.data.standalone_optimized || result.data.standalone_incompatible;
marketplaceItemScrollView.contentHeight = marketplaceItemContent.height;
itemsList.visible = false;
marketplaceItemView.visible = true;
@ -534,7 +536,8 @@ Rectangle {
price: model.cost
available: model.availability === "available"
isLoggedIn: root.isLoggedIn;
standaloneOptimized: model.standalone_optimized
onShowItem: {
MarketplaceScriptingInterface.getMarketplaceItem(item_id);
}

View file

@ -39,9 +39,11 @@ Rectangle {
property string posted: ""
property bool available: false
property string created_at: ""
property bool isLoggedIn: false;
property int edition: -1;
property bool supports3DHTML: false;
property bool isLoggedIn: false
property int edition: -1
property bool supports3DHTML: false
property bool standaloneVisible: false
property bool standaloneOptimized: false
onCategoriesChanged: {
@ -50,16 +52,6 @@ Rectangle {
categoriesListModel.append({"category":category});
});
}
onDescriptionChanged: {
if(root.supports3DHTML) {
descriptionTextModel.clear();
descriptionTextModel.append({text: description});
} else {
descriptionText.text = description;
}
}
onAttributionsChanged: {
attributionsModel.clear();
@ -246,11 +238,38 @@ Rectangle {
right: parent.right;
top: itemImage.bottom;
}
height: categoriesList.y - buyButton.y + categoriesList.height
height: categoriesList.y - badges.y + categoriesList.height
function evalHeight() {
height = categoriesList.y - buyButton.y + categoriesList.height;
console.log("HEIGHT: " + height);
height = categoriesList.y - badges.y + categoriesList.height;
}
Item {
id: badges
anchors {
left: parent.left
top: parent.top
right: parent.right
}
height: childrenRect.height
HiFiGlyphs {
id: standaloneOptomizedBadge
anchors {
left: parent.left
verticalCenter: parent.verticalCenter
}
height: root.standaloneOptimized ? 34 : 0
visible: root.standaloneOptimized
text: hifi.glyphs.hmd
size: 34
horizontalAlignment: Text.AlignHCenter
color: hifi.colors.blueHighlight
}
}
HifiControlsUit.Button {
@ -258,7 +277,7 @@ Rectangle {
anchors {
right: parent.right
top: parent.top
top: badges.bottom
left: parent.left
topMargin: 15
}
@ -529,13 +548,55 @@ Rectangle {
}
}
}
Item {
id: standaloneItem
anchors {
top: licenseItem.bottom
topMargin: 15
left: parent.left
right: parent.right
}
height: root.standaloneVisible ? childrenRect.height : 0
visible: root.standaloneVisible
RalewaySemiBold {
id: standaloneLabel
anchors.top: parent.top
anchors.left: parent.left
width: paintedWidth
height: 20
text: root.standaloneOptimized ? "STAND-ALONE OPTIMIZED:" : "STAND-ALONE INCOMPATIBLE:"
size: 14
color: hifi.colors.lightGrayText
verticalAlignment: Text.AlignVCenter
}
RalewaySemiBold {
id: standaloneOptimizedText
anchors.top: standaloneLabel.bottom
anchors.left: parent.left
anchors.topMargin: 5
width: paintedWidth
text: root.standaloneOptimized ? "This item is stand-alone optimized" : "This item is incompatible with stand-alone devices"
size: 14
color: hifi.colors.lightGray
verticalAlignment: Text.AlignVCenter
}
}
Item {
id: descriptionItem
property string text: ""
anchors {
top: licenseItem.bottom
top: standaloneItem.bottom
topMargin: 15
left: parent.left
right: parent.right

View file

@ -35,7 +35,8 @@ Rectangle {
property string category: ""
property int price: 0
property bool available: false
property bool isLoggedIn: false;
property bool isLoggedIn: false
property bool standaloneOptimized: false
signal buy()
signal showItem()
@ -288,8 +289,38 @@ Rectangle {
onClicked: root.categoryClicked(root.category);
}
}
Item {
id: badges
anchors {
left: parent.left
top: categoryLabel.bottom
right: buyButton.left
}
height: childrenRect.height
HiFiGlyphs {
id: standaloneOptomizedBadge
anchors {
left: parent.left
leftMargin: 15
verticalCenter: parent.verticalCenter
}
height: 24
visible: root.standaloneOptimized
text: hifi.glyphs.hmd
size: 24
horizontalAlignment: Text.AlignHCenter
color: hifi.colors.blueHighlight
}
}
HifiControlsUit.Button {
id: buyButton
anchors {
right: parent.right
top: parent.top

View file

@ -50,6 +50,8 @@ Item {
property string upgradeTitle;
property bool updateAvailable: root.updateItemId && root.updateItemId !== "";
property bool valid;
property bool standaloneOptimized;
property bool standaloneIncompatible;
property string originalStatusText;
property string originalStatusColor;
@ -838,6 +840,25 @@ Item {
root.sendToPurchases({ method: 'flipCard' });
}
}
}
HiFiGlyphs {
id: standaloneOptomizedBadge
anchors {
right: parent.right
bottom: parent.bottom
rightMargin: 15
bottomMargin:12
}
height: root.standaloneOptimized ? 34 : 0
visible: root.standaloneOptimized
text: hifi.glyphs.hmd
size: 34
horizontalAlignment: Text.AlignHCenter
color: hifi.colors.blueHighlight
}
}

View file

@ -553,6 +553,8 @@ Rectangle {
upgradeTitle: model.upgrade_title;
itemType: model.item_type;
valid: model.valid;
standaloneOptimized: model.standalone_optimized
standaloneIncompatible: model.standalone_incompatible
anchors.topMargin: 10;
anchors.bottomMargin: 10;