Skip to content

Commit

Permalink
Support inbox message (#322)
Browse files Browse the repository at this point in the history
* Support inbox message

* Support emote inbox chat

* Support send chat msg

* Refresh session list on dismiss

* Fix share message ui

* Fix panic on macOS

* Cache avatar for inbox Chat

* Inbox chat add message time

* Fix cell focus when chat reload

* Fix i18n in reply feed

* Adjusting the size of the message icon and navigation rules

* Update i18n

* Fix user list

* FeedCard: Show title when cover is unavailable

* FeedCard: Simplify like list

* Fix inbox chat fragment crash

* Adjust the style at the bottom of the inbox chat page

* Show animations when refreshing the chat list

* RecyclingGrid: Fix blocking main thread

* Avoid crashing due to closing the page too quickly
although I have not encountered this problem before

* Limit the maximum height of chat images

* A better way to set the position of chat images

* workaround where some messages exceed the box

* FeedList: Automatically load next page

* Support open activity page

---------

Co-authored-by: xfangfang <2553041586@qq.com>
  • Loading branch information
dragonflylee and xfangfang authored May 30, 2024
1 parent d4fb465 commit ab79071
Show file tree
Hide file tree
Showing 48 changed files with 2,232 additions and 79 deletions.
23 changes: 23 additions & 0 deletions resources/i18n/en-US/wiliwili.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,29 @@
"all": "All activities",
"refresh": "Refresh list"
},
"inbox": {
"chat": {
"tab": "Chat List",
"hint": "Send a message to start chatting ~",
"unknown": "The message type is currently not supported"
},
"tab": {
"like": "Likes",
"at": "@me",
"reply": "Replies"
},
"type": {
"video": "video",
"reply": "comment",
"article": "article",
"dynamic": "activity",
"album": "activity"
},
"more": "and {} people liked my {}",
"like": "liked my {}",
"at": "@me at {}",
"reply": "replied to my {}"
},
"mine": {
"login": {
"check": "Checking login info...",
Expand Down
23 changes: 23 additions & 0 deletions resources/i18n/zh-Hans/wiliwili.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,29 @@
"all": "全部动态",
"refresh": "刷新列表"
},
"inbox": {
"chat": {
"tab": "聊天列表",
"hint": "发个消息聊聊呗 ~",
"unknown": "暂不支持该消息"
},
"tab": {
"like": "收到的赞",
"at": "@我的",
"reply": "回复我的"
},
"type": {
"video": "视频",
"reply": "评论",
"article": "文章",
"dynamic": "动态",
"album": "动态"
},
"more": "等 {} 人赞了我的{}",
"like": "赞了我的{}",
"at": "在{}中@了我",
"reply": "回复了我的{}"
},
"mine": {
"login": {
"check": "检查登录信息...",
Expand Down
23 changes: 23 additions & 0 deletions resources/i18n/zh-Hant/wiliwili.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,29 @@
"all": "全部動態",
"refresh": "重新整理列表"
},
"inbox": {
"chat": {
"tab": "聊天列表",
"hint": "發個消息聊聊唄 ~",
"unknown": "暫不支持該消息"
},
"tab": {
"like": "收到的贊",
"at": "@我的",
"reply": "回復我的"
},
"type": {
"video": "視頻",
"reply": "評論",
"article": "文章",
"dynamic": "動態",
"album": "動態"
},
"more": "等 {} 人贊了我的{}",
"like": "贊了我的{}",
"at": "在{}中@了我",
"reply": "回復我的{}"
},
"mine": {
"login": {
"check": "檢查登入資訊...",
Expand Down
4 changes: 4 additions & 0 deletions resources/svg/ico-inbox-activate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/svg/ico-inbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions resources/xml/activity/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<Tab label=""
fontSize="18"
focusDown="main/setting"
focusDown="main/inbox"
icon="@res/svg/ico-mine.svg"
iconActivate="@res/svg/ico-mine-activate.svg">
<MineTab/>
Expand All @@ -45,14 +45,26 @@
alignItems="center"
positionType="absolute"
positionBottom="20">
<CustomButton
id="main/inbox"
focusable="true"
highlightCornerRadius="50"
cornerRadius="50"
marginBottom="10"
wireframe="false">
<SVGImage
width="48"
height="48"
SVG="@res/svg/ico-inbox.svg"/>
</CustomButton>

<CustomButton
id="main/setting"
focusable="true"
highlightCornerRadius="50"
cornerRadius="50"
wireframe="false">
<SVGImage
focusable="true"
width="48"
height="48"
SVG="@res/svg/ico-setting.svg"/>
Expand Down
1 change: 1 addition & 0 deletions resources/xml/fragment/dynamic_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
id="dynamic/detail/grid"/>

<ButtonClose
id="button/close"
positionType="absolute"
positionTop="10"
positionRight="10"/>
Expand Down
63 changes: 63 additions & 0 deletions resources/xml/fragment/inbox_chat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<brls:Box
wireframe="false"
axis="column"
height="auto"
width="auto">

<brls:Box>
<ButtonClose
id="inbox/back"
focusable="true"
positionType="absolute"
positionTop="10"
positionRight="10" />

<brls:Label
marginTop="20"
marginBottom="15"
marginLeft="30"
id="inbox/talker" />
</brls:Box>

<RecyclingGrid
grow="1"
preFetchLine="2"
spanCount="1"
flowMode="true"
itemHeight="1000"
paddingLeft="15"
paddingRight="20"
wireframe="false"
id="inbox/msgList" />

<brls:Box
width="100%"
backgroundColor="@theme/color/grey_1">
<CustomButton
focusable="true"
highlightCornerRadius="10"
hideHighlightBackground="true"
backgroundColor="@theme/brls/background"
grow="1"
marginLeft="20"
marginRight="20"
marginTop="15"
marginBottom="15"
height="35"
paddingLeft="10"
id="inbox/reply/hint"
cornerRadius="8">
<brls:Label
fontSize="16"
textColor="@theme/font/grey"
text="@i18n/wiliwili/inbox/chat/hint" />
<HintLabel
height="35"
positionType="absolute"
positionRight="15"
fontSize="16"
textColor="@theme/font/grey"
text="y" />
</CustomButton>
</brls:Box>
</brls:Box>
16 changes: 16 additions & 0 deletions resources/xml/fragment/inbox_feed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<brls:Box
axis="column"
width="auto"
height="auto">

<RecyclingGrid
grow="1"
preFetchLine="2"
spanCount="1"
flowMode="true"
paddingLeft="15"
paddingRight="15"
itemHeight="100"
wireframe="false"
id="inbox/feedList" />
</brls:Box>
68 changes: 68 additions & 0 deletions resources/xml/fragment/inbox_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<brls:Box
width="auto"
height="auto"
justifyContent="flexEnd"
backgroundColor="@theme/brls/backdrop">

<brls:Box
id="player/cancel"
height="100%"
hideClickAnimation="true"
grow="1" />

<brls:AppletFrame
width="600"
height="100%"
headerHidden="true"
footerHidden="true"
backgroundColor="@theme/brls/background">
<brls:Box>
<AutoTabFrame
id="inbox/tab/frame"
defaultTab="0"
tabHeight="70"
grow="1"
tabItemActiveTextColor="@theme/color/bilibili"
disableNavigationRight="true"
sidebarPosition="top">

<Tab label="@i18n/wiliwili/inbox/chat/tab"
fontSize="22">

<RecyclingGrid
grow="1"
paddingTop="10"
preFetchLine="2"
spanCount="1"
itemHeight="60"
paddingLeft="15"
paddingRight="15"
wireframe="false"
id="inbox/chatList" />
</Tab>

<Tab label="@i18n/wiliwili/inbox/tab/reply"
fontSize="22">
<InboxFeed mode="reply" />
</Tab>

<Tab label="@i18n/wiliwili/inbox/tab/at"
fontSize="22">
<InboxFeed mode="at" />
</Tab>

<Tab label="@i18n/wiliwili/inbox/tab/like"
fontSize="22">
<InboxFeed mode="like" />
</Tab>
</AutoTabFrame>

<ButtonClose
id="inbox/close"
focusable="true"
positionType="absolute"
positionTop="10"
positionRight="10" />
</brls:Box>
</brls:AppletFrame>
</brls:Box>
83 changes: 83 additions & 0 deletions resources/xml/views/feed_card.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<brls:Box
wireframe="false"
highlightCornerRadius="8"
cornerRadius="8"
backgroundColor="@theme/color/grey_1"
padding="15"
width="auto"
height="auto">

<brls:Box
wireframe="false"
marginRight="30">
<brls:Image
id="feed/avatar"
width="60"
aspectRatio="1"
scalingType="fit"
borderThickness="4"
borderColor="@theme/color/grey_1"
cornerRadius="100"
image="@res/pictures/default_avatar.png" />
</brls:Box>

<brls:Box
id="feed/content_box"
axis="column"
marginRight="30"
grow="1">
<brls:Box>
<brls:Label
id="feed/label/author"
width="auto"
height="auto"
wireframe="false"
grow="1"
fontSize="20"
marginBottom="4"
verticalAlign="bottom" />

<brls:Label
id="feed/label/misc"
width="auto"
height="auto"
fontSize="16"
marginTop="4"
verticalAlign="top"
wireframe="false"
shrink="0"
textColor="@theme/font/grey" />
</brls:Box>

<TextBox
id="feed/content"
lineHeight="1.5"
marginTop="10"
grow="1"
maxRows="4"
showMore="true" />

<brls:Label
fontSize="16"
id="feed/time"
marginTop="10"
wireframe="false"
textColor="@theme/font/grey" />

</brls:Box>

<brls:Box
id="feed/card/pic_box"
height="80"
width="80">
<brls:Image
id="feed/card/picture"
scalingType="fill"
image="@res/pictures/video-card-bg.png"
cornerRadius="4" />
<TextBox
id="feed/card/title"
fontSize="16"
maxRows="3"/>
</brls:Box>
</brls:Box>
Loading

0 comments on commit ab79071

Please sign in to comment.