Skip to content

Commit

Permalink
bump version 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
orzogc committed Jan 17, 2023
1 parent 01a0610 commit 73625a4
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 35 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# 更新记录
## v0.3.0(未发布)
## v0.3.0
- 支持扫描饼干二维码
- 可以设置时间线和版块是否过滤重复的串(基本设置),默认过滤
- 可以设置串内Po饼干左边是否显示Po标识(界面基本设置),默认不显示
- 可以设置串饼干下方是否显示用户饼干的备注(界面基本设置),默认不显示
- 可以设置串饼干是否使用用户饼干的自定义颜色显示(界面基本设置),默认使用
- 可以设置串时间是否使用相对时间(界面基本设置),默认不使用
- 可以设置订阅串是否显示最新回复时间(界面基本设置),默认不显示
- 可以设置白天/黑夜模式是否跟随系统(高级设置),默认不跟随
- 可以设置订阅界面里的串是否显示最新回复时间(界面基本设置),默认不显示
- 可以设置白天/黑夜模式是否跟随系统设置(高级设置),默认不跟随
- Po饼干颜色的设置从高级设置移至界面基本设置
- 发串的饼干选择界面会显示饼干在串内的回复数
- 订阅界面长按串可以选择将该串提升至订阅最上方
- 修复了一些bug

## v0.2.2
Expand Down
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- [x] 历史记录添加搜索功能
- [x] 自定义饼干颜色(包括Po和用户曾用过的饼干)
- [x] 允许设置发串前选择饼干
- [x] 增加易读时间
- [x] 订阅显示最后回复的时间
- [ ] 多图浏览
- [ ] 适应屏幕大小,实现版块/时间线/串瀑布流
- [ ] 定时切换日间和夜间模式
Expand All @@ -19,14 +21,12 @@
- [ ] 加载语录
- [ ] 适配iOS
- [ ] 自定义串布局顺序
- [ ] 增加易读时间
- [ ] 自定义UI颜色
- [ ] 备注串(tag)
- [ ] 收藏夹功能(和订阅ID结合)
- [ ] 分享功能
- [ ] 滑动引用能返回
- [ ] 颜文字排序或显示最近使用的颜文字
- [ ] 版块右滑进串
- [ ] 订阅显示最后回复的时间
- [ ] 底边栏按钮自定义
- [ ] 能够交换侧边栏
2 changes: 1 addition & 1 deletion lib/app/modules/advanced_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class _FollowPlatformBrightness extends StatelessWidget {
return ListenableBuilder(
listenable: settings.followPlatformBrightnessListenable,
builder: (context, child) => SwitchListTile(
title: const Text('白天/黑夜模式跟随系统'),
title: const Text('白天/黑夜模式跟随系统设置'),
subtitle: const Text('更改后需要重启应用'),
value: settings.followPlatformBrightness,
onChanged: (value) => settings.followPlatformBrightness = value,
Expand Down
2 changes: 1 addition & 1 deletion lib/app/modules/basic_ui_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class _ShowLatestPostTimeInFeed extends StatelessWidget {
final textStyle = Theme.of(context).textTheme.bodyMedium;

return ListTile(
title: const Text('订阅里的串显示最后回复时间'),
title: const Text('订阅界面里的串显示最后回复时间'),
trailing: ListenableBuilder(
listenable: settings.showLatestPostTimeInFeedListenable,
builder: (context, child) => DropdownButton<int>(
Expand Down
95 changes: 68 additions & 27 deletions lib/app/widgets/feed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,48 +63,87 @@ class FeedAppBarTitle extends StatelessWidget {
}

class _FeedDialog extends StatelessWidget {
final FeedController controller;

final PostBase post;

final VoidCallback onDelete;

// ignore: unused_element
const _FeedDialog({super.key, required this.post, required this.onDelete});
const _FeedDialog(
{super.key,
required this.controller,
required this.post,
required this.onDelete});

@override
Widget build(BuildContext context) => SimpleDialog(
title: Text(post.toPostNumber()),
children: [
Report(post.id),
SharePost(mainPostId: post.id),
SimpleDialogOption(
onPressed: () async {
postListBack();
Widget build(BuildContext context) {
final settings = SettingsService.to;
final client = XdnmbClientService.to.client;
final textStyle = Theme.of(context).textTheme.titleMedium;

return SimpleDialog(
title: Text(post.toPostNumber()),
children: [
Report(post.id),
SharePost(mainPostId: post.id),
SimpleDialogOption(
onPressed: () async {
postListBack();

try {
await client.deleteFeed(settings.feedId, post.id);

showToast('取消订阅 ${post.toPostNumber()} 成功');
onDelete();
} catch (e) {
showToast(
'取消订阅 ${post.toPostNumber()} 失败:${exceptionMessage(e)}');
}
},
child: Text('取消订阅', style: textStyle),
),
CopyPostId(post.id),
CopyPostReference(post.id),
CopyPostContent(post),
SimpleDialogOption(
onPressed: () async {
postListBack();

try {
await client.deleteFeed(settings.feedId, post.id);
await client.addFeed(settings.feedId, post.id);

showToast('提升 ${post.toPostNumber()} 至订阅最上方成功');
controller.refreshPage();
} catch (e) {
showToast(
'提升至订阅最上方失败,请手动重新订阅 ${post.toPostNumber()} :${exceptionMessage(e)}');

try {
await XdnmbClientService.to.client
.deleteFeed(SettingsService.to.feedId, post.id);
showToast('取消订阅 ${post.id.toPostNumber()} 成功');
onDelete();
await client.addFeed(settings.feedId, post.id);
} catch (e) {
showToast(
'取消订阅 ${post.id.toPostNumber()} 失败:${exceptionMessage(e)}');
debugPrint(
'订阅 ${post.toPostNumber()} 失败:${exceptionMessage(e)}');
}
},
child: Text('取消订阅', style: Theme.of(context).textTheme.titleMedium),
),
CopyPostId(post.id),
CopyPostReference(post.id),
CopyPostContent(post),
NewTab(post),
NewTabBackground(post),
],
);
}
},
child: Text('提升至最上方', style: textStyle),
),
NewTab(post),
NewTabBackground(post),
],
);
}
}

class _FeedItem extends StatefulWidget {
final FeedController controller;

final Visible<PostWithPage<Feed>> feed;

// ignore: unused_element
const _FeedItem(this.feed, {super.key});
const _FeedItem({super.key, required this.controller, required this.feed});

@override
State<_FeedItem> createState() => _FeedItemState();
Expand Down Expand Up @@ -216,6 +255,7 @@ class _FeedItemState extends State<_FeedItem> {
mainPost: widget.feed.item.post),
onLongPress: (post) => postListDialog(
_FeedDialog(
controller: widget.controller,
post: post,
onDelete: () => widget.feed.isVisible = false,
),
Expand Down Expand Up @@ -292,7 +332,8 @@ class _FeedBodyState extends State<FeedBody> {
controller: scrollController,
index: feed.item.toIndex(),
child: _FeedItem(
feed,
controller: widget.controller,
feed: feed,
key: ValueKey<int>(settings.isShowLatestPostTimeInFeed),
),
)
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: xdnmb
description: An app for nmbxd.com.
publish_to: 'none'
version: 0.3.0-alpha+6
version: 0.3.0+7

environment:
sdk: ">=2.18.6 <3.0.0"
Expand Down

0 comments on commit 73625a4

Please sign in to comment.