mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
feat: "Selected Comments" status displayed (#1857)
* Add support for UpSelection in reply display and controller * update --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
enum ReplySortType {
|
enum ReplySortType {
|
||||||
time('最新评论', '最新'),
|
time('最新评论', '最新'),
|
||||||
hot('最热评论', '最热')
|
hot('最热评论', '最热'),
|
||||||
|
select('精选评论', '精选')
|
||||||
;
|
;
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
|||||||
if (data.hasUpTop()) {
|
if (data.hasUpTop()) {
|
||||||
data.replies.insert(0, data.upTop);
|
data.replies.insert(0, data.upTop);
|
||||||
}
|
}
|
||||||
|
if (subjectControl?.title == ReplySortType.select.title) {
|
||||||
|
sortType.value = .select;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
isEnd = data.cursor.isEnd;
|
isEnd = data.cursor.isEnd;
|
||||||
return false;
|
return false;
|
||||||
@@ -87,7 +90,6 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
|||||||
// 排序搜索评论
|
// 排序搜索评论
|
||||||
void queryBySort() {
|
void queryBySort() {
|
||||||
if (isLoading) return;
|
if (isLoading) return;
|
||||||
feedBack();
|
|
||||||
switch (sortType.value) {
|
switch (sortType.value) {
|
||||||
case ReplySortType.time:
|
case ReplySortType.time:
|
||||||
sortType.value = ReplySortType.hot;
|
sortType.value = ReplySortType.hot;
|
||||||
@@ -97,7 +99,10 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
|||||||
sortType.value = ReplySortType.time;
|
sortType.value = ReplySortType.time;
|
||||||
mode.value = Mode.MAIN_LIST_TIME;
|
mode.value = Mode.MAIN_LIST_TIME;
|
||||||
break;
|
break;
|
||||||
|
case ReplySortType.select:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
feedBack();
|
||||||
onReload();
|
onReload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1111,7 +1111,7 @@ Future<void> _showReplySortDialog(
|
|||||||
builder: (context) => SelectDialog<ReplySortType>(
|
builder: (context) => SelectDialog<ReplySortType>(
|
||||||
title: '评论展示',
|
title: '评论展示',
|
||||||
value: Pref.replySortType,
|
value: Pref.replySortType,
|
||||||
values: ReplySortType.values.map((e) => (e, e.title)).toList(),
|
values: ReplySortType.values.take(2).map((e) => (e, e.title)).toList(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (res != null) {
|
if (res != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user