Add wallpaper
This commit is contained in:
parent
948e5839c4
commit
bfa04e45eb
|
@ -1,3 +1,7 @@
|
||||||
|
# Version 0.12.0 - 2020-04-??
|
||||||
|
### Features:
|
||||||
|
- Implement custom wallpapers
|
||||||
|
|
||||||
# Version 0.11.0 - 2020-04-02
|
# Version 0.11.0 - 2020-04-02
|
||||||
### Features:
|
### Features:
|
||||||
- Share content with FluffyChat
|
- Share content with FluffyChat
|
||||||
|
|
|
@ -50,6 +50,7 @@ class MatrixState extends State<Matrix> {
|
||||||
Map<String, dynamic> shareContent;
|
Map<String, dynamic> shareContent;
|
||||||
|
|
||||||
String activeRoomId;
|
String activeRoomId;
|
||||||
|
File wallpaper;
|
||||||
|
|
||||||
void clean() async {
|
void clean() async {
|
||||||
if (!kIsWeb) return;
|
if (!kIsWeb) return;
|
||||||
|
@ -365,6 +366,14 @@ class MatrixState extends State<Matrix> {
|
||||||
} else {
|
} else {
|
||||||
client = widget.client;
|
client = widget.client;
|
||||||
}
|
}
|
||||||
|
if (client.storeAPI != null) {
|
||||||
|
client.storeAPI.getItem("chat.fluffy.wallpaper").then((final path) async {
|
||||||
|
final file = File(path);
|
||||||
|
if (await file.exists()) {
|
||||||
|
wallpaper = file;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -190,6 +190,8 @@ class I18n {
|
||||||
String get changeTheNameOfTheGroup =>
|
String get changeTheNameOfTheGroup =>
|
||||||
Intl.message("Change the name of the group");
|
Intl.message("Change the name of the group");
|
||||||
|
|
||||||
|
String get changeWallpaper => Intl.message("Change wallpaper");
|
||||||
|
|
||||||
String get changeTheServer => Intl.message("Change the server");
|
String get changeTheServer => Intl.message("Change the server");
|
||||||
|
|
||||||
String get channelCorruptedDecryptError =>
|
String get channelCorruptedDecryptError =>
|
||||||
|
@ -722,6 +724,8 @@ class I18n {
|
||||||
|
|
||||||
String get voiceMessage => Intl.message("Voice message");
|
String get voiceMessage => Intl.message("Voice message");
|
||||||
|
|
||||||
|
String get wallpaper => Intl.message("Wallpaper");
|
||||||
|
|
||||||
String get warningEncryptionInBeta => Intl.message(
|
String get warningEncryptionInBeta => Intl.message(
|
||||||
"End to end encryption is currently in Beta! Use at your own risk!");
|
"End to end encryption is currently in Beta! Use at your own risk!");
|
||||||
|
|
||||||
|
|
|
@ -221,6 +221,11 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
|
"Change wallpaper": "Hintergrund ändern",
|
||||||
|
"@Change wallpaper": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
"Change the server": "Ändere den Server",
|
"Change the server": "Ändere den Server",
|
||||||
"@Change the server": {
|
"@Change the server": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
@ -1182,6 +1187,11 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
|
"Wallpaper": "Hintergrund",
|
||||||
|
"@Wallpaper": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
"Voice message": "Sprachnachricht",
|
"Voice message": "Sprachnachricht",
|
||||||
"@Voice message": {
|
"@Voice message": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"@@last_modified": "2020-03-15T12:01:07.169209",
|
"@@last_modified": "2020-04-03T20:17:02.102828",
|
||||||
"About": "About",
|
"About": "About",
|
||||||
"@About": {
|
"@About": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
@ -221,6 +221,11 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
|
"Change wallpaper": "Change wallpaper",
|
||||||
|
"@Change wallpaper": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
"Change the server": "Change the server",
|
"Change the server": "Change the server",
|
||||||
"@Change the server": {
|
"@Change the server": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
@ -1182,6 +1187,11 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
|
"Wallpaper": "Wallpaper",
|
||||||
|
"@Wallpaper": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
"End to end encryption is currently in Beta! Use at your own risk!": "End to end encryption is currently in Beta! Use at your own risk!",
|
"End to end encryption is currently in Beta! Use at your own risk!": "End to end encryption is currently in Beta! Use at your own risk!",
|
||||||
"@End to end encryption is currently in Beta! Use at your own risk!": {
|
"@End to end encryption is currently in Beta! Use at your own risk!": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
|
|
|
@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"Cancel" : MessageLookupByLibrary.simpleMessage("Abbrechen"),
|
"Cancel" : MessageLookupByLibrary.simpleMessage("Abbrechen"),
|
||||||
"Change the name of the group" : MessageLookupByLibrary.simpleMessage("Gruppenname ändern"),
|
"Change the name of the group" : MessageLookupByLibrary.simpleMessage("Gruppenname ändern"),
|
||||||
"Change the server" : MessageLookupByLibrary.simpleMessage("Ändere den Server"),
|
"Change the server" : MessageLookupByLibrary.simpleMessage("Ändere den Server"),
|
||||||
|
"Change wallpaper" : MessageLookupByLibrary.simpleMessage("Hintergrund ändern"),
|
||||||
"Change your style" : MessageLookupByLibrary.simpleMessage("Ändere Deinen Style"),
|
"Change your style" : MessageLookupByLibrary.simpleMessage("Ändere Deinen Style"),
|
||||||
"Changelog" : MessageLookupByLibrary.simpleMessage("Changelog"),
|
"Changelog" : MessageLookupByLibrary.simpleMessage("Changelog"),
|
||||||
"Chat details" : MessageLookupByLibrary.simpleMessage("Gruppeninfo"),
|
"Chat details" : MessageLookupByLibrary.simpleMessage("Gruppeninfo"),
|
||||||
|
@ -282,6 +283,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"Visible for all participants" : MessageLookupByLibrary.simpleMessage("Sichtbar für alle Teilnehmer"),
|
"Visible for all participants" : MessageLookupByLibrary.simpleMessage("Sichtbar für alle Teilnehmer"),
|
||||||
"Visible for everyone" : MessageLookupByLibrary.simpleMessage("Für jeden sichtbar"),
|
"Visible for everyone" : MessageLookupByLibrary.simpleMessage("Für jeden sichtbar"),
|
||||||
"Voice message" : MessageLookupByLibrary.simpleMessage("Sprachnachricht"),
|
"Voice message" : MessageLookupByLibrary.simpleMessage("Sprachnachricht"),
|
||||||
|
"Wallpaper" : MessageLookupByLibrary.simpleMessage("Hintergrund"),
|
||||||
"Wednesday" : MessageLookupByLibrary.simpleMessage("Mittwoch"),
|
"Wednesday" : MessageLookupByLibrary.simpleMessage("Mittwoch"),
|
||||||
"Who is allowed to join this group" : MessageLookupByLibrary.simpleMessage("Wer darf der Gruppe beitreten"),
|
"Who is allowed to join this group" : MessageLookupByLibrary.simpleMessage("Wer darf der Gruppe beitreten"),
|
||||||
"Write a message..." : MessageLookupByLibrary.simpleMessage("Schreibe eine Nachricht ..."),
|
"Write a message..." : MessageLookupByLibrary.simpleMessage("Schreibe eine Nachricht ..."),
|
||||||
|
|
|
@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"Cancel" : MessageLookupByLibrary.simpleMessage("Cancel"),
|
"Cancel" : MessageLookupByLibrary.simpleMessage("Cancel"),
|
||||||
"Change the name of the group" : MessageLookupByLibrary.simpleMessage("Change the name of the group"),
|
"Change the name of the group" : MessageLookupByLibrary.simpleMessage("Change the name of the group"),
|
||||||
"Change the server" : MessageLookupByLibrary.simpleMessage("Change the server"),
|
"Change the server" : MessageLookupByLibrary.simpleMessage("Change the server"),
|
||||||
|
"Change wallpaper" : MessageLookupByLibrary.simpleMessage("Change wallpaper"),
|
||||||
"Change your style" : MessageLookupByLibrary.simpleMessage("Change your style"),
|
"Change your style" : MessageLookupByLibrary.simpleMessage("Change your style"),
|
||||||
"Changelog" : MessageLookupByLibrary.simpleMessage("Changelog"),
|
"Changelog" : MessageLookupByLibrary.simpleMessage("Changelog"),
|
||||||
"Chat details" : MessageLookupByLibrary.simpleMessage("Chat details"),
|
"Chat details" : MessageLookupByLibrary.simpleMessage("Chat details"),
|
||||||
|
@ -282,6 +283,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||||
"Visible for all participants" : MessageLookupByLibrary.simpleMessage("Visible for all participants"),
|
"Visible for all participants" : MessageLookupByLibrary.simpleMessage("Visible for all participants"),
|
||||||
"Visible for everyone" : MessageLookupByLibrary.simpleMessage("Visible for everyone"),
|
"Visible for everyone" : MessageLookupByLibrary.simpleMessage("Visible for everyone"),
|
||||||
"Voice message" : MessageLookupByLibrary.simpleMessage("Voice message"),
|
"Voice message" : MessageLookupByLibrary.simpleMessage("Voice message"),
|
||||||
|
"Wallpaper" : MessageLookupByLibrary.simpleMessage("Wallpaper"),
|
||||||
"Wednesday" : MessageLookupByLibrary.simpleMessage("Wednesday"),
|
"Wednesday" : MessageLookupByLibrary.simpleMessage("Wednesday"),
|
||||||
"Who is allowed to join this group" : MessageLookupByLibrary.simpleMessage("Who is allowed to join this group"),
|
"Who is allowed to join this group" : MessageLookupByLibrary.simpleMessage("Who is allowed to join this group"),
|
||||||
"Write a message..." : MessageLookupByLibrary.simpleMessage("Write a message..."),
|
"Write a message..." : MessageLookupByLibrary.simpleMessage("Write a message..."),
|
||||||
|
|
|
@ -17,7 +17,6 @@ import 'package:fluffychat/utils/room_extension.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:pedantic/pedantic.dart';
|
import 'package:pedantic/pedantic.dart';
|
||||||
|
|
||||||
|
@ -432,11 +431,15 @@ class _ChatState extends State<_Chat> {
|
||||||
: null,
|
: null,
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (!kIsWeb)
|
if (Matrix.of(context).wallpaper != null)
|
||||||
SvgPicture.asset(
|
Opacity(
|
||||||
"assets/chat.svg",
|
opacity: 0.66,
|
||||||
height: double.infinity,
|
child: Image.file(
|
||||||
color: Theme.of(context).primaryColor.withOpacity(0.05),
|
Matrix.of(context).wallpaper,
|
||||||
|
height: double.infinity,
|
||||||
|
width: double.infinity,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SafeArea(
|
SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -544,7 +547,9 @@ class _ChatState extends State<_Chat> {
|
||||||
room.membership == Membership.join
|
room.membership == Membership.join
|
||||||
? Container(
|
? Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).backgroundColor,
|
color: Theme.of(context)
|
||||||
|
.backgroundColor
|
||||||
|
.withOpacity(0.8),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|
|
@ -350,7 +350,7 @@ class _ChatListState extends State<ChatList> {
|
||||||
title: Text(I18n.of(context).publicRooms),
|
title: Text(I18n.of(context).publicRooms),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Divider(indent: 70, height: 1),
|
: Container(),
|
||||||
itemCount: totalCount,
|
itemCount: totalCount,
|
||||||
itemBuilder: (BuildContext context, int i) => i < rooms.length
|
itemBuilder: (BuildContext context, int i) => i < rooms.length
|
||||||
? ChatListItem(
|
? ChatListItem(
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'dart:io';
|
||||||
import 'package:famedlysdk/famedlysdk.dart';
|
import 'package:famedlysdk/famedlysdk.dart';
|
||||||
import 'package:fluffychat/components/settings_themes.dart';
|
import 'package:fluffychat/components/settings_themes.dart';
|
||||||
import 'package:fluffychat/views/settings_devices.dart';
|
import 'package:fluffychat/views/settings_devices.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
@ -92,6 +93,26 @@ class _SettingsState extends State<Settings> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setWallpaperAction(BuildContext context) async {
|
||||||
|
final wallpaper = await ImagePicker.pickImage(source: ImageSource.gallery);
|
||||||
|
if (wallpaper == null) return;
|
||||||
|
Matrix.of(context).wallpaper = wallpaper;
|
||||||
|
await Matrix.of(context)
|
||||||
|
.client
|
||||||
|
.storeAPI
|
||||||
|
.setItem("chat.fluffy.wallpaper", wallpaper.path);
|
||||||
|
setState(() => null);
|
||||||
|
}
|
||||||
|
|
||||||
|
void deleteWallpaperAction(BuildContext context) async {
|
||||||
|
Matrix.of(context).wallpaper = null;
|
||||||
|
await Matrix.of(context)
|
||||||
|
.client
|
||||||
|
.storeAPI
|
||||||
|
.setItem("chat.fluffy.wallpaper", null);
|
||||||
|
setState(() => null);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final Client client = Matrix.of(context).client;
|
final Client client = Matrix.of(context).client;
|
||||||
|
@ -136,6 +157,38 @@ class _SettingsState extends State<Settings> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ThemesSettings(),
|
ThemesSettings(),
|
||||||
|
if (!kIsWeb && client.storeAPI != null) Divider(thickness: 1),
|
||||||
|
if (!kIsWeb && client.storeAPI != null)
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
I18n.of(context).wallpaper,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (Matrix.of(context).wallpaper != null)
|
||||||
|
ListTile(
|
||||||
|
title: Image.file(
|
||||||
|
Matrix.of(context).wallpaper,
|
||||||
|
height: 38,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
trailing: Icon(
|
||||||
|
Icons.delete_forever,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
onTap: () => deleteWallpaperAction(context),
|
||||||
|
),
|
||||||
|
if (!kIsWeb && client.storeAPI != null)
|
||||||
|
Builder(builder: (context) {
|
||||||
|
return ListTile(
|
||||||
|
title: Text(I18n.of(context).changeWallpaper),
|
||||||
|
trailing: Icon(Icons.wallpaper),
|
||||||
|
onTap: () => setWallpaperAction(context),
|
||||||
|
);
|
||||||
|
}),
|
||||||
Divider(thickness: 1),
|
Divider(thickness: 1),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
|
|
21
pubspec.lock
21
pubspec.lock
|
@ -209,13 +209,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.5"
|
version: "1.2.5"
|
||||||
flutter_svg:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: flutter_svg
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.17.1"
|
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -426,20 +419,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.6.4"
|
version: "1.6.4"
|
||||||
path_drawing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path_drawing
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.4.1"
|
|
||||||
path_parsing:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: path_parsing
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.4"
|
|
||||||
path_provider:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -11,7 +11,7 @@ description: Chat with your friends.
|
||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 0.11.0+31
|
version: 0.12.0+32
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.6.0 <3.0.0"
|
sdk: ">=2.6.0 <3.0.0"
|
||||||
|
@ -48,7 +48,6 @@ dependencies:
|
||||||
http: ^0.12.0+4
|
http: ^0.12.0+4
|
||||||
universal_html: ^1.1.12
|
universal_html: ^1.1.12
|
||||||
receive_sharing_intent: ^1.3.3
|
receive_sharing_intent: ^1.3.3
|
||||||
flutter_svg: ^0.17.1
|
|
||||||
flutter_slidable: ^0.5.4
|
flutter_slidable: ^0.5.4
|
||||||
photo_view: ^0.9.2
|
photo_view: ^0.9.2
|
||||||
flutter_sound: ^2.1.1
|
flutter_sound: ^2.1.1
|
||||||
|
|
Loading…
Reference in a new issue