Fix for channel view layout (#167)

* Fix for channel view layout

* tweak
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2023-10-14 12:08:42 -04:00
1 parent 0aad02f5e6
commit 4efbdda167
3 files changed
+32 -13

No files matched your search

+6
View File
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Layout in channel view so that the upload time and view count of videos is visible
## [0.13.1] - 2023-10-08
### Added
@@ -5,7 +5,8 @@ import "pkg:/source/utils/Types.bs"
function Init()
m.container = m.top.findNode("container")
m.scrollAnimation = m.top.findNode("scrollAnimation")
m.scrollAnimationInterpolator = m.scrollAnimation.findNode("scrollAnimationInterpolator")
m.containerTranslation = m.scrollAnimation.findNode("containerTranslation")
m.bannerTranslation = m.scrollAnimation.findNode("bannerTranslation")
m.banner = m.top.findNode("banner")
m.thumbnail = m.top.findNode("thumbnail")
@@ -95,16 +96,24 @@ function OnBannerLoadStatus() as void
return
end if
aspect = m.banner.bitmapWidth / m.banner.bitmapHeight
m.banner.height = m.banner.width / aspect
m.banner.translation = [0, -m.banner.height]
bannerAspect = m.banner.bitmapWidth / m.banner.bitmapHeight
bannerHeight = m.banner.width / bannerAspect
m.banner.height = bannerHeight
m.banner.translation = [0, -bannerHeight]
m.banner.visible = true
startPos = [0, -bannerHeight]
endPos = [0, 0]
midPos = [0, (startPos[1] + endPos[1]) / 2]
m.bannerTranslation.keyValue = [startPos, midPos, endPos]
startPos = [0, 0]
endPos = [0, m.banner.height]
midPos = [0, m.banner.height / 2]
endPos = [0, bannerHeight - m.thumbnail.height * 0.4]
midPos = [0, (startPos[1] + endPos[1]) / 2]
m.containerTranslation.keyValue = [startPos, midPos, endPos]
m.scrollAnimationInterpolator.keyValue = [startPos, midPos, endPos]
m.scrollAnimation.control = "start"
end function
@@ -11,12 +11,12 @@
color="0x242424">
</Rectangle>
<Group id="container">
<Poster
id="banner"
width="1280"
visible="false" />
<Poster
id="banner"
width="1280"
visible="false" />
<Group id="container">
<Poster
translation="[115,20]"
width="104"
@@ -58,7 +58,11 @@
delay="0.3"
duration="0.6">
<Vector2DFieldInterpolator
id="scrollAnimationInterpolator"
id="bannerTranslation"
key="[ 0.0, 0.5, 1.0 ]"
fieldToInterp="banner.translation" />
<Vector2DFieldInterpolator
id="containerTranslation"
key="[ 0.0, 0.5, 1.0 ]"
fieldToInterp="container.translation" />
</Animation>