From 4efbdda1673650ede10779b7b3d661367d26f941 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 14 Oct 2023 12:08:42 -0400 Subject: [PATCH 1/2] Fix for channel view layout (#167) * Fix for channel view layout * tweak --- CHANGELOG.md | 6 +++++ .../src/components/ChannelView/ChannelView.bs | 23 +++++++++++++------ .../components/ChannelView/ChannelView.xml | 16 ++++++++----- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f261b24..464d8b0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/playlet-lib/src/components/ChannelView/ChannelView.bs b/playlet-lib/src/components/ChannelView/ChannelView.bs index aac5176d..22cdb3fe 100644 --- a/playlet-lib/src/components/ChannelView/ChannelView.bs +++ b/playlet-lib/src/components/ChannelView/ChannelView.bs @@ -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 diff --git a/playlet-lib/src/components/ChannelView/ChannelView.xml b/playlet-lib/src/components/ChannelView/ChannelView.xml index 777ebc73..b304bf1c 100644 --- a/playlet-lib/src/components/ChannelView/ChannelView.xml +++ b/playlet-lib/src/components/ChannelView/ChannelView.xml @@ -11,12 +11,12 @@ color="0x242424"> - -