mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-03-03 12:16:47 +00:00
feature: zoom in media viewer
This commit is contained in:
parent
b59687c5ca
commit
15ae2b5669
5 changed files with 19 additions and 15 deletions
|
|
@ -1,5 +1,11 @@
|
|||
# Changelog
|
||||
|
||||
## 0.0.92
|
||||
|
||||
- Adds option to zoom in received images / videos
|
||||
- Fixes issue with "reuploaded requested" not working
|
||||
- Fixes race condition while writing to the log file
|
||||
|
||||
## 0.0.91
|
||||
|
||||
- Fixes link preview on iOS
|
||||
|
|
|
|||
|
|
@ -218,20 +218,11 @@ Future<void> startDownloadMedia(MediaFile media, bool force) async {
|
|||
}
|
||||
}
|
||||
|
||||
int failCounter = 0;
|
||||
|
||||
Future<void> downloadFileFast(
|
||||
MediaFile media,
|
||||
String apiUrl,
|
||||
File filePath,
|
||||
) async {
|
||||
if (failCounter < 2) {
|
||||
failCounter += 1;
|
||||
await requestMediaReupload(media.mediaId);
|
||||
return;
|
||||
}
|
||||
failCounter = 0;
|
||||
|
||||
final response =
|
||||
await http.get(Uri.parse(apiUrl)).timeout(const Duration(seconds: 10));
|
||||
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ Future<void> uploadFileFastOrEnqueue(
|
|||
try {
|
||||
Log.info('Uploading fast: ${task.taskId}');
|
||||
final response =
|
||||
await requestMultipart.send().timeout(const Duration(seconds: 4));
|
||||
await requestMultipart.send().timeout(const Duration(seconds: 8));
|
||||
var status = TaskStatus.failed;
|
||||
if (response.statusCode == 200) {
|
||||
status = TaskStatus.complete;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:lottie/lottie.dart';
|
||||
import 'package:no_screenshot/no_screenshot.dart';
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
import 'package:twonly/globals.dart';
|
||||
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||
import 'package:twonly/src/database/tables/mediafiles.table.dart'
|
||||
|
|
@ -536,15 +537,22 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
|||
children: [
|
||||
if (videoController != null)
|
||||
Positioned.fill(
|
||||
child: PhotoView.customChild(
|
||||
initialScale: PhotoViewComputedScale.contained,
|
||||
minScale: PhotoViewComputedScale.contained,
|
||||
child: VideoPlayer(videoController!),
|
||||
),
|
||||
)
|
||||
else if (currentMedia != null &&
|
||||
currentMedia!.mediaFile.type == MediaType.image ||
|
||||
currentMedia!.mediaFile.type == MediaType.gif)
|
||||
Positioned.fill(
|
||||
child: Image.file(
|
||||
child: PhotoView(
|
||||
imageProvider: FileImage(
|
||||
currentMedia!.tempPath,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
initialScale: PhotoViewComputedScale.contained,
|
||||
minScale: PhotoViewComputedScale.contained,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -242,7 +242,6 @@ class _MemoriesPhotoSliderViewState extends State<MemoriesPhotoSliderView> {
|
|||
child: VideoPlayerWrapper(
|
||||
videoPath: filePath,
|
||||
),
|
||||
// childSize: const Size(300, 300),
|
||||
initialScale: PhotoViewComputedScale.contained,
|
||||
minScale: PhotoViewComputedScale.contained,
|
||||
maxScale: PhotoViewComputedScale.covered * 4.1,
|
||||
|
|
|
|||
Loading…
Reference in a new issue