diff --git a/src/components/GridScreen/GridScreen.xml b/src/components/GridScreen/GridScreen.xml index 70c391f8..30b93fa9 100644 --- a/src/components/GridScreen/GridScreen.xml +++ b/src/components/GridScreen/GridScreen.xml @@ -16,7 +16,7 @@ rowitemSize="[[320,180]]" rowItemSpacing="[[20,0]]" itemSize="[1160,270]" - itemSpacing="[0,45]" + itemSpacing="[0,65]" rowLabelOffset="[[50,20]]" focusXOffset="[50]" showRowLabel="[true]" diff --git a/src/components/RowListItemComponent/RowListItemComponent.bs b/src/components/RowListItemComponent/RowListItemComponent.bs index 847546bf..b8a6799a 100644 --- a/src/components/RowListItemComponent/RowListItemComponent.bs +++ b/src/components/RowListItemComponent/RowListItemComponent.bs @@ -7,6 +7,7 @@ sub OnContentSet() m.top.FindNode("titleLabel").text = content.title m.top.FindNode("authorLabel").text = content.author m.top.FindNode("dateLabel").text = content.releaseDate + m.top.FindNode("viewCountLabel").text = FormatViewCount(content.viewCount) m.top.FindNode("poster").uri = content.hdPosterUrl if content.length <> invalid and content.length <> 0 m.top.FindNode("durationLabel").text = RokuYoutube.Utils.GetFormattedTime(content.length) @@ -15,3 +16,25 @@ sub OnContentSet() end if end if end sub + +function FormatViewCount(viewCount) + if viewCount < 1000 + return `${FormatFloat(viewCount)} views` + end if + + viewCount = viewCount / 1000 + if viewCount < 1000 + return `${FormatFloat(viewCount)}K views` + end if + + viewCount = viewCount / 1000 + return `${FormatFloat(viewCount)}M views` +end function + +function FormatFloat(X) + X = X * 10 + X = X + 0.5 + X = Fix(X) + X = X / 10 + return X +end function \ No newline at end of file diff --git a/src/components/RowListItemComponent/RowListItemComponent.xml b/src/components/RowListItemComponent/RowListItemComponent.xml index 38e00f63..72782085 100644 --- a/src/components/RowListItemComponent/RowListItemComponent.xml +++ b/src/components/RowListItemComponent/RowListItemComponent.xml @@ -52,7 +52,14 @@ height="25" horizAlign="right" font="font:SmallestSystemFont" - translation="[0, 225]" + translation="[0, 250]" + /> +