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
|
# 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
|
## 0.0.91
|
||||||
|
|
||||||
- Fixes link preview on iOS
|
- Fixes link preview on iOS
|
||||||
|
|
|
||||||
|
|
@ -218,20 +218,11 @@ Future<void> startDownloadMedia(MediaFile media, bool force) async {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int failCounter = 0;
|
|
||||||
|
|
||||||
Future<void> downloadFileFast(
|
Future<void> downloadFileFast(
|
||||||
MediaFile media,
|
MediaFile media,
|
||||||
String apiUrl,
|
String apiUrl,
|
||||||
File filePath,
|
File filePath,
|
||||||
) async {
|
) async {
|
||||||
if (failCounter < 2) {
|
|
||||||
failCounter += 1;
|
|
||||||
await requestMediaReupload(media.mediaId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
failCounter = 0;
|
|
||||||
|
|
||||||
final response =
|
final response =
|
||||||
await http.get(Uri.parse(apiUrl)).timeout(const Duration(seconds: 10));
|
await http.get(Uri.parse(apiUrl)).timeout(const Duration(seconds: 10));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,7 @@ Future<void> uploadFileFastOrEnqueue(
|
||||||
try {
|
try {
|
||||||
Log.info('Uploading fast: ${task.taskId}');
|
Log.info('Uploading fast: ${task.taskId}');
|
||||||
final response =
|
final response =
|
||||||
await requestMultipart.send().timeout(const Duration(seconds: 4));
|
await requestMultipart.send().timeout(const Duration(seconds: 8));
|
||||||
var status = TaskStatus.failed;
|
var status = TaskStatus.failed;
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
status = TaskStatus.complete;
|
status = TaskStatus.complete;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:lottie/lottie.dart';
|
import 'package:lottie/lottie.dart';
|
||||||
import 'package:no_screenshot/no_screenshot.dart';
|
import 'package:no_screenshot/no_screenshot.dart';
|
||||||
|
import 'package:photo_view/photo_view.dart';
|
||||||
import 'package:twonly/globals.dart';
|
import 'package:twonly/globals.dart';
|
||||||
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||||
import 'package:twonly/src/database/tables/mediafiles.table.dart'
|
import 'package:twonly/src/database/tables/mediafiles.table.dart'
|
||||||
|
|
@ -536,15 +537,22 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
||||||
children: [
|
children: [
|
||||||
if (videoController != null)
|
if (videoController != null)
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: VideoPlayer(videoController!),
|
child: PhotoView.customChild(
|
||||||
|
initialScale: PhotoViewComputedScale.contained,
|
||||||
|
minScale: PhotoViewComputedScale.contained,
|
||||||
|
child: VideoPlayer(videoController!),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
else if (currentMedia != null &&
|
else if (currentMedia != null &&
|
||||||
currentMedia!.mediaFile.type == MediaType.image ||
|
currentMedia!.mediaFile.type == MediaType.image ||
|
||||||
currentMedia!.mediaFile.type == MediaType.gif)
|
currentMedia!.mediaFile.type == MediaType.gif)
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: Image.file(
|
child: PhotoView(
|
||||||
currentMedia!.tempPath,
|
imageProvider: FileImage(
|
||||||
fit: BoxFit.contain,
|
currentMedia!.tempPath,
|
||||||
|
),
|
||||||
|
initialScale: PhotoViewComputedScale.contained,
|
||||||
|
minScale: PhotoViewComputedScale.contained,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,6 @@ class _MemoriesPhotoSliderViewState extends State<MemoriesPhotoSliderView> {
|
||||||
child: VideoPlayerWrapper(
|
child: VideoPlayerWrapper(
|
||||||
videoPath: filePath,
|
videoPath: filePath,
|
||||||
),
|
),
|
||||||
// childSize: const Size(300, 300),
|
|
||||||
initialScale: PhotoViewComputedScale.contained,
|
initialScale: PhotoViewComputedScale.contained,
|
||||||
minScale: PhotoViewComputedScale.contained,
|
minScale: PhotoViewComputedScale.contained,
|
||||||
maxScale: PhotoViewComputedScale.covered * 4.1,
|
maxScale: PhotoViewComputedScale.covered * 4.1,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue