Skip to content

Commit

Permalink
Fix not loading comments when switching between episodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed May 1, 2023
1 parent dd6ca7c commit 717b0a5
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ endif ()
project(wiliwili)
set(VERSION_MAJOR "1")
set(VERSION_MINOR "0")
set(VERSION_REVISION "0")
set(VERSION_REVISION "1")
set(PROJECT_TITLEID "0x010FF000FFFF0001")
set(PROJECT_AUTHOR "xfangfang")
set(PROJECT_ICON ${CMAKE_CURRENT_SOURCE_DIR}/resources/icon/icon.jpg)
Expand Down
4 changes: 2 additions & 2 deletions resources/i18n/en-US/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "v1.0.0",
"version": "v1.0.1",
"version_major": 1,
"version_minor": 0,
"version_revision": 0
"version_revision": 1
}
14 changes: 7 additions & 7 deletions resources/xml/fragment/player_comment_action.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,34 @@

<SVGImage
focusable="true"
id="comment/action/svg/gallery"
id="comment/action/svg/reply"
margin="14"
width="48"
height="48"
cornerRadius="48"
highlightCornerRadius="48"
visibility="gone"
SVG="@res/svg/bpx-svg-sprite-fullpage.svg"/>
SVG="@res/svg/bpx-svg-sprite-reply.svg"/>

<SVGImage
focusable="true"
id="comment/action/svg/reply"
id="comment/action/svg/like"
margin="14"
width="48"
height="48"
cornerRadius="48"
highlightCornerRadius="48"
SVG="@res/svg/bpx-svg-sprite-reply.svg"/>
SVG="@res/svg/bpx-svg-sprite-liked.svg"/>

<SVGImage
focusable="true"
id="comment/action/svg/like"
id="comment/action/svg/gallery"
margin="14"
width="48"
height="48"
cornerRadius="48"
highlightCornerRadius="48"
SVG="@res/svg/bpx-svg-sprite-liked.svg"/>
visibility="gone"
SVG="@res/svg/bpx-svg-sprite-fullpage.svg"/>

</brls:Box>

Expand Down
2 changes: 1 addition & 1 deletion scripts/linux/cn.xfangfang.wiliwili.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ul>
</description>
<releases>
<release date="2023-04-30" version="1.0.0">
<release date="2023-05-01" version="1.0.1">
<description>
<p>
Please See Official Changelog at github.com/xfangfang/wiliwili/releases
Expand Down
15 changes: 15 additions & 0 deletions wiliwili/source/activity/player_season_activity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ void PlayerSeasonActivity::onIndexChange(size_t index) {
// 如果遇到id为0,说明是标题,那么就停止播放
// 也就是说目前的设定是自动连播不会跨越section播放
if (episodeList[index].id == 0) return;

// 设置评论区骨架屏幕
this->recyclingGrid->estimatedRowHeight = 100;
this->recyclingGrid->showSkeleton();
// 当焦点在评论区时,将焦点转移到tab栏
auto view = brls::Application::getCurrentFocus();
// 焦点位于当前页面,且在 评论 或 回复 上
if (view->getParentActivity() == this &&
(dynamic_cast<VideoComment*>(view) != nullptr ||
dynamic_cast<VideoCommentReply*>(view) != nullptr)) {
tabFrame->focusTab(0);
}

// 因为是手动切换分集,所以将分集进度设置为 0
episodeList[index].progress = 0;
this->changeEpisode(episodeList[index]);
this->changeIndexEvent.fire(index);
}
Expand Down
7 changes: 6 additions & 1 deletion wiliwili/source/fragment/player_single_comment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,12 @@ void PlayerCommentAction::showDelete() {
this->svgDelete->setVisibility(brls::Visibility::VISIBLE);
}

brls::View* PlayerCommentAction::getDefaultFocus() { return this->svgLike; }
brls::View* PlayerCommentAction::getDefaultFocus() {
if (this->svgGallery->getVisibility() == brls::Visibility::VISIBLE) {
return this->svgGallery;
}
return this->svgLike;
}

void PlayerCommentAction::dismiss(std::function<void(void)> cb) {
this->showDismissAnimation();
Expand Down

0 comments on commit 717b0a5

Please sign in to comment.