mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: horizontal image view
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -49,6 +49,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
// 回复类型
|
// 回复类型
|
||||||
late int replyType;
|
late int replyType;
|
||||||
bool _isFabVisible = true;
|
bool _isFabVisible = true;
|
||||||
|
bool? _imageStatus;
|
||||||
int oid = 0;
|
int oid = 0;
|
||||||
int? opusId;
|
int? opusId;
|
||||||
bool isOpusId = false;
|
bool isOpusId = false;
|
||||||
@@ -63,9 +64,10 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
|
|
||||||
get _getImageCallback => _horizontalPreview
|
get _getImageCallback => _horizontalPreview
|
||||||
? (imgList, index) {
|
? (imgList, index) {
|
||||||
bool needReverse = _isFabVisible;
|
_imageStatus = true;
|
||||||
if (needReverse) {
|
bool isFabVisible = _isFabVisible;
|
||||||
_fabAnimationCtr?.reverse();
|
if (isFabVisible) {
|
||||||
|
_hideFab();
|
||||||
}
|
}
|
||||||
final ctr = AnimationController(
|
final ctr = AnimationController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
@@ -81,9 +83,10 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
imgList,
|
imgList,
|
||||||
index,
|
index,
|
||||||
(value) async {
|
(value) async {
|
||||||
if (needReverse) {
|
_imageStatus = null;
|
||||||
needReverse = false;
|
if (isFabVisible) {
|
||||||
_fabAnimationCtr?.forward();
|
isFabVisible = false;
|
||||||
|
_showFab();
|
||||||
}
|
}
|
||||||
if (value == false) {
|
if (value == false) {
|
||||||
await ctr.reverse();
|
await ctr.reverse();
|
||||||
@@ -194,9 +197,9 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
} else {
|
} else {
|
||||||
ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
|
ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
|
||||||
if (scaffoldState != null) {
|
if (scaffoldState != null) {
|
||||||
bool needReverse = _isFabVisible;
|
bool isFabVisible = _isFabVisible;
|
||||||
if (needReverse) {
|
if (isFabVisible) {
|
||||||
_fabAnimationCtr?.reverse();
|
_hideFab();
|
||||||
}
|
}
|
||||||
scaffoldState.showBottomSheet(
|
scaffoldState.showBottomSheet(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
@@ -206,8 +209,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
child: replyReplyPage(
|
child: replyReplyPage(
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
if (needReverse) {
|
if (isFabVisible && _imageStatus != true) {
|
||||||
_fabAnimationCtr?.forward();
|
_showFab();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
late String dynamicType;
|
late String dynamicType;
|
||||||
late int type;
|
late int type;
|
||||||
bool _isFabVisible = true;
|
bool _isFabVisible = true;
|
||||||
|
bool? _imageStatus;
|
||||||
late AnimationController fabAnimationCtr;
|
late AnimationController fabAnimationCtr;
|
||||||
|
|
||||||
late final List<double> _ratio = GStorage.dynamicDetailRatio;
|
late final List<double> _ratio = GStorage.dynamicDetailRatio;
|
||||||
@@ -56,9 +57,10 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
|
|
||||||
get _getImageCallback => _horizontalPreview
|
get _getImageCallback => _horizontalPreview
|
||||||
? (imgList, index) {
|
? (imgList, index) {
|
||||||
bool needReverse = _isFabVisible;
|
_imageStatus = true;
|
||||||
if (needReverse) {
|
bool isFabVisible = _isFabVisible;
|
||||||
fabAnimationCtr.reverse();
|
if (isFabVisible) {
|
||||||
|
_hideFab();
|
||||||
}
|
}
|
||||||
final ctr = AnimationController(
|
final ctr = AnimationController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
@@ -74,9 +76,10 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
imgList,
|
imgList,
|
||||||
index,
|
index,
|
||||||
(value) async {
|
(value) async {
|
||||||
if (needReverse) {
|
_imageStatus = null;
|
||||||
needReverse = false;
|
if (isFabVisible) {
|
||||||
fabAnimationCtr.forward();
|
isFabVisible = false;
|
||||||
|
_showFab();
|
||||||
}
|
}
|
||||||
if (value == false) {
|
if (value == false) {
|
||||||
await ctr.reverse();
|
await ctr.reverse();
|
||||||
@@ -187,9 +190,9 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
} else {
|
} else {
|
||||||
ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
|
ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
|
||||||
if (scaffoldState != null) {
|
if (scaffoldState != null) {
|
||||||
bool needReverse = _isFabVisible;
|
bool isFabVisible = _isFabVisible;
|
||||||
if (needReverse) {
|
if (isFabVisible) {
|
||||||
fabAnimationCtr.reverse();
|
_hideFab();
|
||||||
}
|
}
|
||||||
scaffoldState.showBottomSheet(
|
scaffoldState.showBottomSheet(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
@@ -199,8 +202,8 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
child: replyReplyPage(
|
child: replyReplyPage(
|
||||||
false,
|
false,
|
||||||
() {
|
() {
|
||||||
if (needReverse) {
|
if (isFabVisible && _imageStatus != true) {
|
||||||
fabAnimationCtr.forward();
|
_showFab();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user