fluffychat merge
This commit is contained in:
parent
5f4b61d494
commit
978dc545a0
7 changed files with 10 additions and 11 deletions
|
|
@ -102,7 +102,6 @@ abstract class AppConfig {
|
|||
"https://play.google.com/store/account/orderhistory";
|
||||
static bool useActivityImageAsChatBackground = true;
|
||||
static const int overlayAnimationDuration = 250;
|
||||
static double volume = 1.0;
|
||||
static const Color gold = Color.fromARGB(255, 253, 191, 1);
|
||||
static const Color goldLight = Color.fromARGB(255, 254, 223, 73);
|
||||
static const Color success = Color(0xFF33D057);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ enum AppSettings<T> {
|
|||
// Pangea#
|
||||
),
|
||||
// #Pangea
|
||||
volume<double>('pangea.value', 1.0),
|
||||
volume<double>('pangea.volume', 1.0),
|
||||
// Pangea#
|
||||
enableSoftLogout<bool>('chat.fluffy.enable_soft_logout', false);
|
||||
|
||||
|
|
|
|||
|
|
@ -196,11 +196,10 @@ class SettingsNotificationsController extends State<SettingsNotifications> {
|
|||
|
||||
// #Pangea
|
||||
final ValueNotifier<double> volumeNotifier =
|
||||
ValueNotifier<double>(AppConfig.volume);
|
||||
ValueNotifier<double>(AppSettings.volume.value);
|
||||
|
||||
void updateVolume(double value) {
|
||||
volumeNotifier.value = value;
|
||||
AppConfig.volume = value;
|
||||
AppSettings.volume.setItem(value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,8 +157,9 @@ class SettingsStyleController extends State<SettingsStyle> {
|
|||
setState(() {});
|
||||
}
|
||||
|
||||
void changeFontSizeFactor(double d) {
|
||||
AppSettings.fontSizeFactor.setItem(d);
|
||||
void changeFontSizeFactor(double d) async {
|
||||
await AppSettings.fontSizeFactor.setItem(d);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:audioplayers/audioplayers.dart';
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/analytics_constants.dart';
|
||||
|
|
@ -30,7 +31,7 @@ class LevelUpUtil {
|
|||
) async {
|
||||
// Remove delay since GetAnalyticsController._onLevelUp is already async
|
||||
final player = AudioPlayer();
|
||||
player.setVolume(AppConfig.volume);
|
||||
player.setVolume(AppSettings.volume.value);
|
||||
|
||||
// Wait for any existing snackbars to dismiss
|
||||
await _waitForSnackbars(context);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import 'dart:math';
|
|||
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
|
||||
class ClickPlayer {
|
||||
late AudioPlayer _player;
|
||||
|
|
@ -10,7 +10,7 @@ class ClickPlayer {
|
|||
ClickPlayer() {
|
||||
_player = AudioPlayer();
|
||||
_player.setPlayerMode(PlayerMode.lowLatency);
|
||||
_player.setVolume(min(0.5, AppConfig.volume));
|
||||
_player.setVolume(min(0.5, AppSettings.volume.value));
|
||||
}
|
||||
|
||||
Future<void> play() async {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
||||
|
|
@ -78,7 +77,7 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
}
|
||||
|
||||
// #Pangea
|
||||
_audioPlayer.volume = AppConfig.volume;
|
||||
_audioPlayer.volume = AppSettings.volume.value;
|
||||
// Pangea#
|
||||
_audioPlayer.play();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue