mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-01 23:59:50 +08:00
@@ -24,6 +24,13 @@ mixin CommonSlideMixin<T extends CommonSlidePage> on State<T>, TickerProvider {
|
||||
|
||||
static bool slideDismissReplyPage = Pref.slideDismissReplyPage;
|
||||
|
||||
bool isDxAllowed(double dx) {
|
||||
return enableSlide
|
||||
? dx > CommonSlideMixin.offset &&
|
||||
dx < maxWidth - CommonSlideMixin.offset
|
||||
: true;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -235,12 +235,8 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
if (_isMulti) {
|
||||
return TabBarView<TabBarDragGestureRecognizer>(
|
||||
controller: _tabController,
|
||||
horizontalDragGestureRecognizer: TabBarDragGestureRecognizer(
|
||||
isDxAllowed: (double dx) => enableSlide
|
||||
? dx > CommonSlideMixin.offset &&
|
||||
dx < maxWidth - CommonSlideMixin.offset
|
||||
: true,
|
||||
),
|
||||
horizontalDragGestureRecognizer: () =>
|
||||
TabBarDragGestureRecognizer(isDxAllowed: isDxAllowed),
|
||||
children: List.generate(
|
||||
widget.list.length,
|
||||
(index) => _buildBody(
|
||||
|
||||
@@ -139,7 +139,7 @@ class _HistoryPageState extends State<HistoryPage>
|
||||
: const CustomTabBarViewScrollPhysics(),
|
||||
controller: _historyController.tabController,
|
||||
horizontalDragGestureRecognizer:
|
||||
CustomHorizontalDragGestureRecognizer(),
|
||||
CustomHorizontalDragGestureRecognizer.new,
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => child),
|
||||
..._historyController.tabs.map(
|
||||
|
||||
@@ -135,7 +135,7 @@ class _LaterPageState extends State<LaterPage>
|
||||
: const CustomTabBarViewScrollPhysics(),
|
||||
controller: _tabController,
|
||||
horizontalDragGestureRecognizer:
|
||||
CustomHorizontalDragGestureRecognizer(),
|
||||
CustomHorizontalDragGestureRecognizer.new,
|
||||
children: LaterViewType.values
|
||||
.map((item) => item.page)
|
||||
.toList(),
|
||||
|
||||
@@ -733,7 +733,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
onPageChanged: (value) =>
|
||||
_liveRoomController.pageIndex.value = value,
|
||||
horizontalDragGestureRecognizer:
|
||||
CustomHorizontalDragGestureRecognizer(),
|
||||
CustomHorizontalDragGestureRecognizer.new,
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => chat()),
|
||||
SuperChatPanel(
|
||||
|
||||
@@ -97,12 +97,8 @@ class _IntroDetailState extends State<PgcIntroPanel>
|
||||
return TabBarView<TabBarDragGestureRecognizer>(
|
||||
controller: _tabController,
|
||||
physics: const CustomTabBarViewScrollPhysics(),
|
||||
horizontalDragGestureRecognizer: TabBarDragGestureRecognizer(
|
||||
isDxAllowed: (double dx) => enableSlide
|
||||
? dx > CommonSlideMixin.offset &&
|
||||
dx < maxWidth - CommonSlideMixin.offset
|
||||
: true,
|
||||
),
|
||||
horizontalDragGestureRecognizer: () =>
|
||||
TabBarDragGestureRecognizer(isDxAllowed: isDxAllowed),
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => _buildInfo(theme)),
|
||||
PgcReviewPage(
|
||||
|
||||
Reference in New Issue
Block a user