Merge remote-tracking branch 'origin/main' into server-list

This commit is contained in:
TheOneWithTheBraid 2022-02-06 14:50:56 +01:00
commit fe5e9170f5
11 changed files with 285 additions and 57 deletions

View File

@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
}
android {
compileSdkVersion 30
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'

View File

@ -2714,5 +2714,20 @@
"whatIsGoingOn": "Co se děje?",
"@whatIsGoingOn": {},
"addDescription": "Přidat popis",
"@addDescription": {}
"@addDescription": {},
"iUnderstand": "Rozumím",
"@iUnderstand": {},
"markAsRead": "Označit jako přečtené",
"@markAsRead": {},
"bubbleSize": "Velikost bubliny",
"@bubbleSize": {
"type": "text",
"placeholders": {}
},
"reportUser": "Nahlásit uživatele",
"@reportUser": {},
"openChat": "Otevřete chat",
"@openChat": {},
"storyPrivacyWarning": "Upozorňujeme, že lidé se ve vašem příběhu mohou navzájem vidět a kontaktovat. Vaše příběhy budou viditelné po dobu 24 hodin, ale není zaručeno, že budou smazány ze všech zařízení a serverů.",
"@storyPrivacyWarning": {}
}

View File

@ -2719,5 +2719,9 @@
"dismiss": "Desbotar",
"@dismiss": {},
"markAsRead": "Marcar como lido",
"@markAsRead": {}
"@markAsRead": {},
"reportUser": "Denunciar usuaria",
"@reportUser": {},
"openChat": "Abrir Chat",
"@openChat": {}
}

View File

@ -2721,5 +2721,9 @@
"dismiss": "Abaikan",
"@dismiss": {},
"markAsRead": "Tandai sebagai dibaca",
"@markAsRead": {}
"@markAsRead": {},
"reportUser": "Laporkan pengguna",
"@reportUser": {},
"openChat": "Buka Chat",
"@openChat": {}
}

View File

@ -1,6 +1,6 @@
{
"@@last_modified": "2021-08-14 12:41:09.835634",
"about": "Om Fluffychat",
"about": "Om",
"@about": {
"type": "text",
"placeholders": {}
@ -259,7 +259,7 @@
"username": {}
}
},
"changedTheJoinRulesTo": "{username} ändrade anslutningsreglerna till",
"changedTheJoinRulesTo": "{username} ändrade anslutningsreglerna till {joinRules}",
"@changedTheJoinRulesTo": {
"type": "text",
"placeholders": {
@ -489,7 +489,7 @@
"type": "text",
"placeholders": {}
},
"dateAndTimeOfDay": "{timeOfDay}, {date}",
"dateAndTimeOfDay": "{date}, {timeOfDay}",
"@dateAndTimeOfDay": {
"type": "text",
"placeholders": {
@ -505,7 +505,7 @@
"day": {}
}
},
"dateWithYear": "{day}-{month}-{year}",
"dateWithYear": "{year}-{month}-{day}",
"@dateWithYear": {
"type": "text",
"placeholders": {
@ -524,7 +524,7 @@
"type": "text",
"placeholders": {}
},
"delete": "Ta bort",
"delete": "Radera",
"@delete": {
"type": "text",
"placeholders": {}
@ -891,7 +891,7 @@
"type": "text",
"placeholders": {}
},
"inviteContactToGroup": "Bjud in kontakt till",
"inviteContactToGroup": "Bjud in kontakt till {groupName}",
"@inviteContactToGroup": {
"type": "text",
"placeholders": {
@ -1193,7 +1193,7 @@
"type": "text",
"placeholders": {}
},
"notifications": "Notifikationer",
"notifications": "Aviseringar",
"@notifications": {
"type": "text",
"placeholders": {}
@ -1232,7 +1232,7 @@
"type": "text",
"placeholders": {}
},
"ok": "ok",
"ok": "OK",
"@ok": {
"type": "text",
"placeholders": {}
@ -1445,7 +1445,7 @@
"type": "text",
"placeholders": {}
},
"unbanFromChat": "Ta bort exil",
"unbanFromChat": "Ta bort chatt-blockering",
"@unbanFromChat": {
"type": "text",
"placeholders": {}
@ -1675,7 +1675,7 @@
"type": "text",
"placeholders": {}
},
"sharedTheLocation": "{username} delade positionen",
"sharedTheLocation": "{username} delade sin position",
"@sharedTheLocation": {
"type": "text",
"placeholders": {
@ -1709,7 +1709,7 @@
"senderName": {}
}
},
"startYourFirstChat": "Starta din första chatt nu! 🙂\n- tryck på \"meddelande knappen\"\n- Ange din kompis användarnamn\n- Ha så kul med chattandet",
"startYourFirstChat": "Starta din första chatt nu! 🙂\n- tryck på \"ny chatt\"\n- Skanna en väns QR-kod\n- Ha så kul med chattandet",
"@startYourFirstChat": {
"type": "text",
"placeholders": {}
@ -1860,14 +1860,14 @@
"type": "text",
"placeholders": {}
},
"unreadChats": "{unreadCount, plural, other{{unreadCount} olästa chattar}}",
"unreadChats": "{unreadCount, plural, =1{en oläst chatt} other{{unreadCount} olästa chattar}}",
"@unreadChats": {
"type": "text",
"placeholders": {
"unreadCount": {}
}
},
"unreadMessages": "{unreadEvents, plural, other{{unreadEvents} olästa meddelanden}}",
"unreadMessages": "{unreadEvents, plural, =1{ett oläst meddelande} other{{unreadEvents} olästa meddelanden}}",
"@unreadMessages": {
"type": "text",
"placeholders": {
@ -2284,7 +2284,7 @@
"type": "text",
"placeholders": {}
},
"createNewSpace": "Skapa nytt utrymme",
"createNewSpace": "Nytt utrymme",
"@createNewSpace": {
"type": "text",
"placeholders": {}
@ -2567,5 +2567,166 @@
"placeholders": {
"count": {}
}
}
},
"commandHint_create": "Skapa en tom grupp-chatt\nAnvänd --no-encryption för att inaktivera kryptering",
"@commandHint_create": {
"type": "text",
"description": "Usage hint for the command /create"
},
"commandHint_discardsession": "Kasta bort sessionen",
"@commandHint_discardsession": {
"type": "text",
"description": "Usage hint for the command /discardsession"
},
"commandHint_dm": "Starta en direkt-chatt\nAnvänd --no-encryption för att inaktivera kryptering",
"@commandHint_dm": {
"type": "text",
"description": "Usage hint for the command /dm"
},
"homeserver": "Hemserver",
"@homeserver": {},
"oneClientLoggedOut": "En av dina klienter har loggats ut",
"@oneClientLoggedOut": {},
"addAccount": "Lägg till konto",
"@addAccount": {},
"editBundlesForAccount": "Lägg till paket för detta konto",
"@editBundlesForAccount": {},
"addToBundle": "Utöka paket",
"@addToBundle": {},
"bundleName": "Paketnamn",
"@bundleName": {},
"serverRequiresEmail": "Servern behöver validera din e-postadress för registrering.",
"@serverRequiresEmail": {},
"singlesignon": "Single Sign On",
"@singlesignon": {
"type": "text",
"placeholders": {}
},
"unverified": "Ej verifierad",
"@unverified": {},
"messageInfo": "Meddelandeinformation",
"@messageInfo": {},
"messageType": "Meddelandetyp",
"@messageType": {},
"time": "Tid",
"@time": {},
"sender": "Avsändare",
"@sender": {},
"removeFromSpace": "Ta bort från utrymme",
"@removeFromSpace": {},
"addToSpaceDescription": "Välj ett utrymme som chatten skall läggas till i.",
"@addToSpaceDescription": {},
"start": "Starta",
"@start": {},
"pleaseEnterSecurityKeyDescription": "För att låsa upp din chatt-backup, vänligen ange säkerhetsnyckeln som skapats i en tidigare session. Säkerhetsnyckeln är INTE densamma som ditt lösenord.",
"@pleaseEnterSecurityKeyDescription": {},
"saveTheSecurityKeyNow": "Spara säkerhetsnyckeln nu",
"@saveTheSecurityKeyNow": {},
"iUnderstand": "Jag förstår",
"@iUnderstand": {},
"yourStory": "Din berättelse",
"@yourStory": {},
"openGallery": "Öppna galleri",
"@openGallery": {},
"storyFrom": "Berättelse från {date}: \n{body}",
"@storyFrom": {
"type": "text",
"placeholders": {
"date": {},
"body": {}
}
},
"passwordsDoNotMatch": "Lösenorden stämmer inte överens!",
"@passwordsDoNotMatch": {},
"repeatPassword": "Upprepa lösenord",
"@repeatPassword": {},
"pleaseChooseAtLeastChars": "Vänligen ange minst {min} tecken.",
"@pleaseChooseAtLeastChars": {
"type": "text",
"placeholders": {
"min": {}
}
},
"markAsRead": "Markera som läst",
"@markAsRead": {},
"setupChatBackup": "Konfigurera chatt-backup",
"@setupChatBackup": {},
"setupChatBackupDescription": "För att skydda dina meddelanden så det skapats en säkerhetsnyckel.\nFörvara nyckeln på ett säkert ställe, t ex med en lösenordshanterare.",
"@setupChatBackupDescription": {},
"commandHint_clearcache": "Rensa cache",
"@commandHint_clearcache": {
"type": "text",
"description": "Usage hint for the command /clearcache"
},
"newUsernameDescription": "Ditt användar-ID kommer att ha formatet @användarnamn:servernamn",
"@newUsernameDescription": {},
"openVideoCamera": "Aktivera kamera för video",
"@openVideoCamera": {
"type": "text",
"placeholders": {}
},
"link": "Länk",
"@link": {},
"publish": "Publicera",
"@publish": {},
"unsubscribeStories": "Avprenumerera berättelser",
"@unsubscribeStories": {},
"replyHasBeenSent": "Svar har skickats",
"@replyHasBeenSent": {},
"videoWithSize": "Video ({size})",
"@videoWithSize": {
"type": "text",
"placeholders": {
"size": {}
}
},
"whatIsGoingOn": "Vad händer?",
"@whatIsGoingOn": {},
"addDescription": "Lägg till beskrivning",
"@addDescription": {},
"reportUser": "Rapportera användare",
"@reportUser": {},
"openChat": "Öppna Chatt",
"@openChat": {},
"yourUserId": "Ditt användar-ID:",
"@yourUserId": {},
"sendOnEnter": "Skicka med Enter",
"@sendOnEnter": {},
"iWroteDownTheKey": "Jag har antecknat nyckeln",
"@iWroteDownTheKey": {},
"addToStory": "Addera till berättelse",
"@addToStory": {},
"pleaseEnterValidEmail": "Vänligen ange en giltig e-postadress.",
"@pleaseEnterValidEmail": {},
"scanQrCode": "Skanna QR-kod",
"@scanQrCode": {},
"bubbleSize": "Storlek på bubbla",
"@bubbleSize": {
"type": "text",
"placeholders": {}
},
"yourChatBackupHasBeenSetUp": "Din chatt-backup har konfigurerats.",
"@yourChatBackupHasBeenSetUp": {},
"loginWithOneClick": "Logga in med ett klick",
"@loginWithOneClick": {},
"typeInInviteLinkManually": "Skriv in länk med inbjudan manuellt...",
"@typeInInviteLinkManually": {},
"newPasswordDescription": "För att kunna återställa ditt lösenord så bör du vid tillfälle lägga till en e-postadress till ditt konto.",
"@newPasswordDescription": {},
"removeFromBundle": "Ta bort från paket",
"@removeFromBundle": {},
"enableMultiAccounts": "(BETA) Aktivera multi-konton på denna enhet",
"@enableMultiAccounts": {},
"removeFromSpaceDescription": "Detta raderar chatten från det nuvarande utrymmet. Chatten är fortfarande synlig under \"Alla chattar\".",
"@removeFromSpaceDescription": {},
"whoCanSeeMyStories": "Vem kan se mina berättelser?",
"@whoCanSeeMyStories": {},
"setupChatBackupNow": "Konfigurera din chatt-backup nu",
"@setupChatBackupNow": {},
"whoCanSeeMyStoriesDesc": "Notera att användare kan se och kontakta varandra i din berättelse.",
"@whoCanSeeMyStoriesDesc": {},
"thisUserHasNotPostedAnythingYet": "Den här användaren har inte lagt till något till deras berättelse än",
"@thisUserHasNotPostedAnythingYet": {},
"storyPrivacyWarning": "Notera att användare kan se och kontakta varandra i din berättelse. Din berättelse är synlig i 24 timmar, men det finns ingen garanti för att berättelser raderas från alla enheter och servrar.",
"@storyPrivacyWarning": {}
}

View File

@ -2727,5 +2727,9 @@
"dismiss": "Kapat",
"@dismiss": {},
"markAsRead": "Okundu olarak işaretle",
"@markAsRead": {}
"@markAsRead": {},
"reportUser": "Kullanıcıyı bildir",
"@reportUser": {},
"openChat": "Sohbeti Aç",
"@openChat": {}
}

View File

@ -2722,5 +2722,9 @@
"dismiss": "Відхилити",
"@dismiss": {},
"markAsRead": "Позначити прочитаним",
"@markAsRead": {}
"@markAsRead": {},
"reportUser": "Поскаржився на користувача",
"@reportUser": {},
"openChat": "Відкрити бесіду",
"@openChat": {}
}

View File

@ -2729,5 +2729,7 @@
"markAsRead": "标为已读",
"@markAsRead": {},
"reportUser": "举报用户",
"@reportUser": {}
"@reportUser": {},
"openChat": "打开聊天",
"@openChat": {}
}

View File

@ -38,7 +38,6 @@ abstract class FluffyThemes {
colorScheme: ThemeData.light().colorScheme.copyWith(
primary: AppConfig.chatColor,
secondary: AppConfig.chatColor,
secondaryVariant: AppConfig.secondaryColor,
surface: FluffyThemes.lighten(AppConfig.chatColor, 0.535),
),
backgroundColor: Colors.white,
@ -133,7 +132,6 @@ abstract class FluffyThemes {
colorScheme: ThemeData.dark().colorScheme.copyWith(
primary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
secondary: FluffyThemes.lighten(AppConfig.chatColor, 0.33),
secondaryVariant: AppConfig.secondaryColor,
surface: FluffyThemes.darken(AppConfig.chatColor, 0.35),
),
secondaryHeaderColor: Colors.blueGrey.shade900,

View File

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
@ -35,12 +36,25 @@ class AddStoryController extends State<AddStoryPage> {
bool get hasMedia => image != null || video != null;
void updateColors() => hasMedia
? null
: setState(() {
backgroundColor = controller.text.color;
backgroundColorDark = controller.text.darkColor;
});
bool hasText = false;
Timer? _updateColorsCooldown;
void updateColors() {
if (hasText != controller.text.isNotEmpty) {
setState(() {
hasText = controller.text.isNotEmpty;
});
}
_updateColorsCooldown?.cancel();
_updateColorsCooldown = Timer(
const Duration(seconds: 3),
() => setState(() {
backgroundColor = controller.text.color;
backgroundColorDark = controller.text.darkColor;
}),
);
}
void importMedia() async {
final picked = await FilePickerCross.importFromStorage(
@ -88,6 +102,11 @@ class AddStoryController extends State<AddStoryPage> {
});
}
void reset() => setState(() {
image = video = null;
controller.clear();
});
void postStory() async {
if (video == null && image == null && controller.text.isEmpty) return;
final client = Matrix.of(context).client;
@ -150,7 +169,6 @@ class AddStoryController extends State<AddStoryPage> {
backgroundColorDark = text.darkColor;
final shareContent = Matrix.of(context).shareContent;
// ignore: unnecessary_null_comparison
if (shareContent != null) {
final shareFile = shareContent.tryGet<MatrixFile>('file')?.detectFileType;

View File

@ -4,7 +4,6 @@ import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:video_player/video_player.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'add_story.dart';
class AddStoryView extends StatelessWidget {
@ -34,24 +33,13 @@ class AddStoryView extends StatelessWidget {
],
),
),
actions: controller.hasMedia
? null
: [
IconButton(
icon: const Icon(Icons.photo_outlined),
onPressed: controller.importMedia,
),
if (PlatformInfos.isMobile)
IconButton(
icon: const Icon(Icons.camera_alt_outlined),
onPressed: controller.capturePhoto,
),
if (PlatformInfos.isMobile)
IconButton(
icon: const Icon(Icons.video_camera_back_outlined),
onPressed: controller.captureVideo,
),
],
actions: [
if (controller.hasMedia)
IconButton(
icon: const Icon(Icons.delete_outlined),
onPressed: controller.reset,
),
],
),
extendBodyBehindAppBar: true,
body: Stack(
@ -104,7 +92,7 @@ class AddStoryView extends StatelessWidget {
? null
: Colors.black.withOpacity(0.5),
),
onEditingComplete: controller.updateColors,
onChanged: (_) => controller.updateColors(),
decoration: InputDecoration(
border: InputBorder.none,
hintText: controller.hasMedia
@ -123,12 +111,42 @@ class AddStoryView extends StatelessWidget {
),
],
),
floatingActionButton: FloatingActionButton.extended(
onPressed: controller.postStory,
label: Text(L10n.of(context)!.publish),
backgroundColor: Theme.of(context).colorScheme.surface,
foregroundColor: Theme.of(context).colorScheme.onSurface,
icon: const Icon(Icons.send_rounded),
floatingActionButton: Column(
mainAxisSize: MainAxisSize.min,
children: [
FloatingActionButton(
onPressed: controller.captureVideo,
backgroundColor: controller.backgroundColorDark,
foregroundColor: Colors.white,
heroTag: null,
child: const Icon(Icons.video_camera_front_outlined),
),
const SizedBox(height: 16),
FloatingActionButton(
onPressed: controller.capturePhoto,
backgroundColor: controller.backgroundColorDark,
foregroundColor: Colors.white,
heroTag: null,
child: const Icon(Icons.camera_alt_outlined),
),
const SizedBox(height: 16),
FloatingActionButton(
onPressed: controller.importMedia,
backgroundColor: controller.backgroundColorDark,
foregroundColor: Colors.white,
heroTag: null,
child: const Icon(Icons.photo_outlined),
),
if (controller.hasMedia || controller.hasText) ...[
const SizedBox(height: 16),
FloatingActionButton(
onPressed: controller.postStory,
backgroundColor: Theme.of(context).colorScheme.surface,
foregroundColor: Theme.of(context).colorScheme.onSurface,
child: const Icon(Icons.send_rounded),
),
],
],
),
);
}