mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 11:18:41 +00:00
fix #166
This commit is contained in:
parent
db75b11b75
commit
7a300456a3
4 changed files with 33 additions and 27 deletions
|
|
@ -8,7 +8,7 @@
|
|||
"onboardingE2eBody": "Genieße durch die Ende-zu-Ende-Verschlüsselung die Gewissheit, dass nur du und deine Freunde die geteilten Momente sehen können.",
|
||||
"onboardingFocusTitle": "Fokussiere dich auf das Teilen von Momenten",
|
||||
"onboardingFocusBody": "Verabschiede dich von süchtig machenden Funktionen! twonly wurde für das Teilen von Momenten ohne nutzlose Ablenkungen oder Werbung entwickelt.",
|
||||
"onboardingSendTwonliesTitle": "Twonlies senden",
|
||||
"onboardingSendTwonliesTitle": "twonlies senden",
|
||||
"onboardingSendTwonliesBody": "Teile Momente sicher mit deinem Partner. twonly stellt sicher, dass nur dein Partner sie öffnen kann, sodass deine Momente mit deinem Partner eine two(o)nly Sache bleiben!",
|
||||
"onboardingNotProductTitle": "Du bist nicht das Produkt!",
|
||||
"onboardingNotProductBody": "twonly finanziert sich durch eine geringe monatliche Gebühr und nicht durch den Verkauf deiner Daten.",
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
"shareImagedEditorSavedImage": "Gespeichert",
|
||||
"shareImagedSelectAll": "Alle auswählen",
|
||||
"shareImageAllUsers": "Alle Kontakte",
|
||||
"shareImageAllTwonlyWarning": "Twonlies können nur an verifizierte Kontakte gesendet werden!",
|
||||
"shareImageAllTwonlyWarning": "twonlies können nur an verifizierte Kontakte gesendet werden!",
|
||||
"shareImageSearchAllContacts": "Alle Kontakte durchsuchen",
|
||||
"@shareImageSearchAllContacts": {},
|
||||
"shareImageUserNotVerified": "Benutzer ist nicht verifiziert",
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
String get onboardingFocusBody => 'Verabschiede dich von süchtig machenden Funktionen! twonly wurde für das Teilen von Momenten ohne nutzlose Ablenkungen oder Werbung entwickelt.';
|
||||
|
||||
@override
|
||||
String get onboardingSendTwonliesTitle => 'Twonlies senden';
|
||||
String get onboardingSendTwonliesTitle => 'twonlies senden';
|
||||
|
||||
@override
|
||||
String get onboardingSendTwonliesBody => 'Teile Momente sicher mit deinem Partner. twonly stellt sicher, dass nur dein Partner sie öffnen kann, sodass deine Momente mit deinem Partner eine two(o)nly Sache bleiben!';
|
||||
|
|
@ -126,7 +126,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
String get shareImageAllUsers => 'Alle Kontakte';
|
||||
|
||||
@override
|
||||
String get shareImageAllTwonlyWarning => 'Twonlies können nur an verifizierte Kontakte gesendet werden!';
|
||||
String get shareImageAllTwonlyWarning => 'twonlies können nur an verifizierte Kontakte gesendet werden!';
|
||||
|
||||
@override
|
||||
String get shareImageUserNotVerified => 'Benutzer ist nicht verifiziert';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:collection';
|
||||
import 'dart:io';
|
||||
import 'dart:async';
|
||||
import 'package:camera/camera.dart';
|
||||
|
|
@ -58,6 +59,7 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
|||
double tabDownPostion = 0;
|
||||
bool sendingOrLoadingImage = true;
|
||||
bool isDisposed = false;
|
||||
HashSet<int> selectedUserIds = HashSet();
|
||||
double widthRatio = 1, heightRatio = 1, pixelRatio = 1;
|
||||
VideoPlayerController? videoController;
|
||||
|
||||
|
|
@ -105,6 +107,18 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
void updateStatus(int userId, bool checked) {
|
||||
if (checked) {
|
||||
if (_isRealTwonly) {
|
||||
selectedUserIds.clear();
|
||||
}
|
||||
selectedUserIds.add(userId);
|
||||
} else {
|
||||
selectedUserIds.remove(userId);
|
||||
}
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
Future updateAsync(int userId) async {
|
||||
if (sendNextMediaToUserName != null) return;
|
||||
Contact? contact = await twonlyDatabase.contactsDao
|
||||
|
|
@ -241,6 +255,7 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
|||
if (_isRealTwonly) {
|
||||
maxShowTime = 12;
|
||||
}
|
||||
selectedUserIds = HashSet();
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
|
|
@ -308,7 +323,8 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
|||
imageBytesFuture: imageBytes,
|
||||
isRealTwonly: _isRealTwonly,
|
||||
maxShowTime: maxShowTime,
|
||||
preselectedUser: widget.sendTo,
|
||||
selectedUserIds: selectedUserIds,
|
||||
updateStatus: updateStatus,
|
||||
videoFilePath: widget.videoFilePath,
|
||||
mirrorVideo: widget.mirrorVideo,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ class ShareImageView extends StatefulWidget {
|
|||
required this.isRealTwonly,
|
||||
required this.mirrorVideo,
|
||||
required this.maxShowTime,
|
||||
this.preselectedUser,
|
||||
required this.selectedUserIds,
|
||||
required this.updateStatus,
|
||||
required this.videoFilePath,
|
||||
this.enableVideoAudio});
|
||||
final Future<Uint8List?> imageBytesFuture;
|
||||
|
|
@ -32,8 +33,9 @@ class ShareImageView extends StatefulWidget {
|
|||
final bool mirrorVideo;
|
||||
final int maxShowTime;
|
||||
final XFile? videoFilePath;
|
||||
final Contact? preselectedUser;
|
||||
final HashSet<int> selectedUserIds;
|
||||
final bool? enableVideoAudio;
|
||||
final Function(int, bool) updateStatus;
|
||||
|
||||
@override
|
||||
State<ShareImageView> createState() => _ShareImageView();
|
||||
|
|
@ -47,7 +49,6 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
Uint8List? imageBytes;
|
||||
bool sendingImage = false;
|
||||
bool hideArchivedUsers = true;
|
||||
final HashSet<int> _selectedUserIds = HashSet<int>();
|
||||
final TextEditingController searchUserName = TextEditingController();
|
||||
bool showRealTwonlyWarning = false;
|
||||
late StreamSubscription<List<Contact>> contactSub;
|
||||
|
|
@ -57,10 +58,6 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
|
||||
if (widget.preselectedUser != null) {
|
||||
_selectedUserIds.add(widget.preselectedUser!.userId);
|
||||
}
|
||||
|
||||
Stream<List<Contact>> allContacts =
|
||||
twonlyDatabase.contactsDao.watchContactsForShareView();
|
||||
|
||||
|
|
@ -129,7 +126,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
.where((x) =>
|
||||
!x.archived ||
|
||||
!hideArchivedUsers ||
|
||||
_selectedUserIds.contains(x.userId))
|
||||
widget.selectedUserIds.contains(x.userId))
|
||||
.toList());
|
||||
return;
|
||||
}
|
||||
|
|
@ -151,14 +148,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
}
|
||||
}
|
||||
showRealTwonlyWarning = false;
|
||||
if (checked) {
|
||||
if (widget.isRealTwonly) {
|
||||
_selectedUserIds.clear();
|
||||
}
|
||||
_selectedUserIds.add(userId);
|
||||
} else {
|
||||
_selectedUserIds.remove(userId);
|
||||
}
|
||||
widget.updateStatus(userId, checked);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +183,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
if (_pinnedContacs.isNotEmpty) const SizedBox(height: 10),
|
||||
BestFriendsSelector(
|
||||
users: _pinnedContacs,
|
||||
selectedUserIds: _selectedUserIds,
|
||||
selectedUserIds: widget.selectedUserIds,
|
||||
isRealTwonly: widget.isRealTwonly,
|
||||
updateStatus: updateStatus,
|
||||
title: context.lang.shareImagePinnedContacts,
|
||||
|
|
@ -201,7 +191,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
const SizedBox(height: 10),
|
||||
BestFriendsSelector(
|
||||
users: _bestFriends,
|
||||
selectedUserIds: _selectedUserIds,
|
||||
selectedUserIds: widget.selectedUserIds,
|
||||
isRealTwonly: widget.isRealTwonly,
|
||||
updateStatus: updateStatus,
|
||||
title: context.lang.shareImageBestFriends,
|
||||
|
|
@ -250,7 +240,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
Expanded(
|
||||
child: UserList(
|
||||
List.from(_otherUsers),
|
||||
selectedUserIds: _selectedUserIds,
|
||||
selectedUserIds: widget.selectedUserIds,
|
||||
isRealTwonly: widget.isRealTwonly,
|
||||
updateStatus: updateStatus,
|
||||
),
|
||||
|
|
@ -278,7 +268,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
)
|
||||
: FaIcon(FontAwesomeIcons.solidPaperPlane),
|
||||
onPressed: () async {
|
||||
if (imageBytes == null || _selectedUserIds.isEmpty) {
|
||||
if (imageBytes == null || widget.selectedUserIds.isEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -298,7 +288,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
});
|
||||
|
||||
sendMediaFile(
|
||||
_selectedUserIds.toList(),
|
||||
widget.selectedUserIds.toList(),
|
||||
imageBytes!,
|
||||
widget.isRealTwonly,
|
||||
widget.maxShowTime,
|
||||
|
|
@ -322,7 +312,7 @@ class _ShareImageView extends State<ShareImageView> {
|
|||
EdgeInsets.symmetric(vertical: 10, horizontal: 30),
|
||||
),
|
||||
backgroundColor: WidgetStateProperty.all<Color>(
|
||||
imageBytes == null || _selectedUserIds.isEmpty
|
||||
imageBytes == null || widget.selectedUserIds.isEmpty
|
||||
? Theme.of(context).colorScheme.secondary
|
||||
: Theme.of(context).colorScheme.primary,
|
||||
)),
|
||||
|
|
|
|||
Loading…
Reference in a new issue