Skip to content

Commit

Permalink
bump version 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
orzogc committed Aug 6, 2023
1 parent 65f6041 commit 61ba4e2
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 更新记录
## v0.5.1(未发布)
- 可以设置长按历史或订阅/标签按钮会在新标签页打开对应页面(高级设置)
- 长按串的时间会在相对时间和绝对时间之间切换
- 长按串的时间会在相对时间和具体时间之间切换
- 修复“修复字体显示”无效的问题

## v0.5.0
Expand Down
2 changes: 1 addition & 1 deletion lib/app/data/services/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class SettingsService extends GetxService {
set showRelativeTime(bool showRelativeTime) =>
_settingsBox.put(Settings.showRelativeTime, showRelativeTime);

/// 0是不显示,1是显示绝对时间,2是显示相对时间
/// 0是不显示,1是显示具体时间,2是显示相对时间
int get showLatestPostTimeInFeed =>
(_settingsBox.get(Settings.showLatestPostTimeInFeed, defaultValue: 0)
as int)
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 @@ -504,7 +504,7 @@ class _ShowLatestPostTimeInFeed extends StatelessWidget {
DropdownMenuItem<int>(
value: 1,
alignment: Alignment.centerRight,
child: Text('显示绝对时间'),
child: Text('显示具体时间'),
),
DropdownMenuItem<int>(
value: 2,
Expand Down
1 change: 0 additions & 1 deletion lib/app/modules/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class _TopOverlay extends StatelessWidget {
showReplyCount: false,
showPoTag: true,
showPostTags: false,
longPressPostIdToCopy: false,
),
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/app/modules/post_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ class PostFontSettingsView extends GetView<PostFontSettingsController> {
child: PostContent(
post: _post,
showFullTime: false,
longPressPostTimeToSwitch: false,
longPressPostIdToCopy: false,
contentTextStyle: TextStyle(
fontSize: controller._postContentFontSize.value,
Expand Down
10 changes: 10 additions & 0 deletions lib/app/widgets/post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ class _PostTime extends StatefulWidget {

final bool showFullTime;

final bool longPressPostTimeToSwitch;

final TextStyle? textStyle;

const _PostTime(
// ignore: unused_element
{super.key,
required this.postTime,
this.showFullTime = true,
this.longPressPostTimeToSwitch = true,
this.textStyle});

@override
Expand Down Expand Up @@ -162,6 +165,7 @@ class _PostTimeState extends State<_PostTime> {
return ListenBuilder(
listenable: settings.showRelativeTimeListenable,
builder: (context, child) => PostTime(
enableSwitch: widget.longPressPostTimeToSwitch,
isShowRelativeTime: settings.showRelativeTime,
relativeTime: (context) => Text(
time.relativeTime(widget.postTime),
Expand Down Expand Up @@ -603,6 +607,8 @@ class PostContent extends StatelessWidget {

final bool isPinned;

final bool longPressPostTimeToSwitch;

final bool longPressPostIdToCopy;

final double? headerHeight;
Expand Down Expand Up @@ -648,6 +654,7 @@ class PostContent extends StatelessWidget {
this.showPoTag = false,
this.showPostTags = true,
this.isPinned = false,
this.longPressPostTimeToSwitch = true,
this.longPressPostIdToCopy = true,
this.headerHeight,
this.contentMaxHeight,
Expand Down Expand Up @@ -728,6 +735,7 @@ class PostContent extends StatelessWidget {
child: _PostTime(
postTime: post.postTime,
showFullTime: showFullTime,
longPressPostTimeToSwitch: longPressPostTimeToSwitch,
textStyle: headerTextStyle,
),
),
Expand Down Expand Up @@ -818,6 +826,7 @@ class PostInkWell extends StatelessWidget {
bool showPoTag = false,
bool showPostTags = true,
bool isPinned = false,
bool longPressPostTimeToSwitch = true,
bool longPressPostIdToCopy = true,
double? headerHeight,
double? contentMaxHeight,
Expand Down Expand Up @@ -850,6 +859,7 @@ class PostInkWell extends StatelessWidget {
showPoTag: showPoTag,
showPostTags: showPostTags,
isPinned: isPinned,
longPressPostTimeToSwitch: longPressPostTimeToSwitch,
longPressPostIdToCopy: longPressPostIdToCopy,
headerHeight: headerHeight,
contentMaxHeight: contentMaxHeight,
Expand Down
8 changes: 6 additions & 2 deletions lib/app/widgets/time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class _TimerRefresher extends TimerRefreshWidget {
}

class PostTime extends StatefulWidget {
final bool enableSwitch;

final bool isShowRelativeTime;

final WidgetBuilder relativeTime;
Expand All @@ -20,6 +22,7 @@ class PostTime extends StatefulWidget {

const PostTime(
{super.key,
this.enableSwitch = true,
required this.isShowRelativeTime,
required this.relativeTime,
required this.absoluteTime});
Expand Down Expand Up @@ -49,8 +52,9 @@ class _PostTimeState extends State<PostTime> {

@override
Widget build(BuildContext context) => GestureDetector(
onLongPress: () =>
setState(() => _isShowRelativeTime = !_isShowRelativeTime),
onLongPress: widget.enableSwitch
? () => setState(() => _isShowRelativeTime = !_isShowRelativeTime)
: null,
child: _isShowRelativeTime
? _TimerRefresher(builder: widget.relativeTime)
: widget.absoluteTime);
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: nmbxd
description: An app for nmbxd.com.
publish_to: 'none'
version: 0.5.1-alpha+11
version: 0.5.1+12

environment:
sdk: '>=3.0.6 <4.0.0'
Expand Down

0 comments on commit 61ba4e2

Please sign in to comment.