Merge branch 'krille/better-story-viewer' into 'main'

chore: Minor story viewer fixes

See merge request famedly/fluffychat!768
This commit is contained in:
Krille Fear 2022-03-10 16:48:16 +00:00
commit c4609edb52

View File

@ -172,15 +172,7 @@ class StoryView extends StatelessWidget {
controller.loadingModeOff();
}
final hash = event.infoMap['xyz.amorgan.blurhash'];
return GestureDetector(
onTapDown: controller.hold,
onTapUp: controller.unhold,
onTapCancel: controller.unhold,
onVerticalDragStart: controller.hold,
onVerticalDragEnd: controller.unhold,
onHorizontalDragStart: controller.hold,
onHorizontalDragEnd: controller.unhold,
child: Stack(
return Stack(
children: [
if (hash is String)
BlurHash(
@ -204,8 +196,7 @@ class StoryView extends StatelessWidget {
return Container();
}
controller.loadingModeOff();
return Center(
child: VideoPlayer(videoPlayerController));
return Center(child: VideoPlayer(videoPlayerController));
},
),
),
@ -230,7 +221,15 @@ class StoryView extends StatelessWidget {
);
},
),
AnimatedContainer(
GestureDetector(
onTapDown: controller.hold,
onTapUp: controller.unhold,
onTapCancel: controller.unhold,
onVerticalDragStart: controller.hold,
onVerticalDragEnd: controller.unhold,
onHorizontalDragStart: controller.hold,
onHorizontalDragEnd: controller.unhold,
child: AnimatedContainer(
duration: const Duration(milliseconds: 200),
padding: const EdgeInsets.symmetric(
horizontal: 8.0,
@ -275,6 +274,7 @@ class StoryView extends StatelessWidget {
),
),
),
),
Positioned(
top: 4,
left: 4,
@ -317,8 +317,6 @@ class StoryView extends StatelessWidget {
child: TextField(
focusNode: controller.replyFocus,
controller: controller.replyController,
minLines: 1,
maxLines: 7,
onSubmitted: controller.replyAction,
textInputAction: TextInputAction.send,
readOnly: controller.replyLoading,
@ -329,8 +327,14 @@ class StoryView extends StatelessWidget {
icon: const Icon(Icons.emoji_emotions_outlined),
),
suffixIcon: controller.replyLoading
? const CircularProgressIndicator.adaptive(
strokeWidth: 2)
? const SizedBox(
width: 16,
height: 16,
child: Center(
child: CircularProgressIndicator.adaptive(
strokeWidth: 2),
),
)
: IconButton(
onPressed: controller.replyAction,
icon: const Icon(Icons.send_outlined),
@ -360,7 +364,6 @@ class StoryView extends StatelessWidget {
),
),
],
),
);
},
),