mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-11-15 20:27:24 +01:00
feat: add p2020 color scheme
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
371d41d1ea
commit
de34b0bd96
@ -166,6 +166,28 @@ build_android_apk:
|
|||||||
- main
|
- main
|
||||||
- tags
|
- tags
|
||||||
|
|
||||||
|
build_p2022_android:
|
||||||
|
extends: build_android_apk
|
||||||
|
before_script:
|
||||||
|
- git apply ./scripts/enable-android-google-services.patch
|
||||||
|
- sed -i 's/im.fluffychat.fluffychat/de.brandenburg.polizei.messenger/g' android/app/build.gradle
|
||||||
|
- sed -i 's/im.fluffychat.fluffychat/de.brandenburg.polizei.messenger/g' lib/config/app_config.dart
|
||||||
|
- sed -i 's/im.fluffychat/de.brandenburg.polizei/g' lib/config/app_config.dart
|
||||||
|
- sed -i 's/255, 135, 103, 172/255, 33, 150, 243/g' lib/config/app_config.dart
|
||||||
|
- sed -i 's/https\:\/\/push\.fluffychat\.im\/_matrix\/push\/v1\/notify\/https:\/\/janian.de\/_matrix\/push\/v1\/notify/g' lib/config/app_config.dart
|
||||||
|
- sed -i 's/\$version/\$version-ACAB/g' lib/utils/platform_infos.dart
|
||||||
|
- find assets/l10n -name "*.arb" -exec sed -i 's/FluffyChat/BB Messenger/g' {} +
|
||||||
|
- sed -i 's/FluffyChat/BB Messenger/g' lib/config/app_config.dart
|
||||||
|
- flutter gen-l10n
|
||||||
|
- cat ${P2020_BRANDING} | base64 -d > p2020_branding.tar
|
||||||
|
- tar -xf p2020_branding.tar
|
||||||
|
- rm p2020_branding.tar
|
||||||
|
- cp lib/config/themes_p2020.dart lib/config/themes.dart
|
||||||
|
- ./scripts/prepare-android-release.sh
|
||||||
|
only:
|
||||||
|
- p2022/*
|
||||||
|
- manual
|
||||||
|
|
||||||
deploy_playstore_internal:
|
deploy_playstore_internal:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
before_script:
|
before_script:
|
||||||
|
|||||||
@ -17,8 +17,6 @@ abstract class AppConfig {
|
|||||||
static const bool allowOtherHomeservers = true;
|
static const bool allowOtherHomeservers = true;
|
||||||
static const bool enableRegistration = true;
|
static const bool enableRegistration = true;
|
||||||
static const Color primaryColor = Color.fromARGB(255, 135, 103, 172);
|
static const Color primaryColor = Color.fromARGB(255, 135, 103, 172);
|
||||||
static const Color primaryColorLight = Color(0xFFCCBDEA);
|
|
||||||
static const Color secondaryColor = Color(0xFF41a2bc);
|
|
||||||
static String _privacyUrl =
|
static String _privacyUrl =
|
||||||
'https://gitlab.com/famedly/fluffychat/-/blob/main/PRIVACY.md';
|
'https://gitlab.com/famedly/fluffychat/-/blob/main/PRIVACY.md';
|
||||||
static String get privacyUrl => _privacyUrl;
|
static String get privacyUrl => _privacyUrl;
|
||||||
|
|||||||
92
lib/config/themes_p2020.dart
Normal file
92
lib/config/themes_p2020.dart
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
|
import 'app_config.dart';
|
||||||
|
|
||||||
|
abstract class FluffyThemes {
|
||||||
|
static const double columnWidth = 360.0;
|
||||||
|
|
||||||
|
static bool isColumnModeByWidth(double width) => width > columnWidth * 2 + 64;
|
||||||
|
|
||||||
|
static bool isColumnMode(BuildContext context) =>
|
||||||
|
isColumnModeByWidth(MediaQuery.of(context).size.width);
|
||||||
|
|
||||||
|
static bool getDisplayNavigationRail(BuildContext context) =>
|
||||||
|
!VRouter.of(context).path.startsWith('/settings');
|
||||||
|
|
||||||
|
static const fallbackTextStyle = TextStyle(
|
||||||
|
fontFamily: 'Roboto',
|
||||||
|
fontFamilyFallback: ['NotoEmoji'],
|
||||||
|
);
|
||||||
|
|
||||||
|
static var fallbackTextTheme = const TextTheme(
|
||||||
|
bodyText1: fallbackTextStyle,
|
||||||
|
bodyText2: fallbackTextStyle,
|
||||||
|
button: fallbackTextStyle,
|
||||||
|
caption: fallbackTextStyle,
|
||||||
|
overline: fallbackTextStyle,
|
||||||
|
headline1: fallbackTextStyle,
|
||||||
|
headline2: fallbackTextStyle,
|
||||||
|
headline3: fallbackTextStyle,
|
||||||
|
headline4: fallbackTextStyle,
|
||||||
|
headline5: fallbackTextStyle,
|
||||||
|
headline6: fallbackTextStyle,
|
||||||
|
subtitle1: fallbackTextStyle,
|
||||||
|
subtitle2: fallbackTextStyle,
|
||||||
|
);
|
||||||
|
|
||||||
|
static ThemeData buildTheme(Brightness brightness,
|
||||||
|
[ColorScheme? colorScheme]) =>
|
||||||
|
ThemeData(
|
||||||
|
visualDensity: VisualDensity.standard,
|
||||||
|
useMaterial3: true,
|
||||||
|
brightness: brightness,
|
||||||
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
brightness: brightness,
|
||||||
|
secondary: const Color.fromARGB(255, 255, 82, 82),
|
||||||
|
seedColor: const Color.fromARGB(255, 33, 150, 243),
|
||||||
|
primaryContainer: const Color.fromARGB(255, 19, 26, 59),
|
||||||
|
background: const Color.fromARGB(255, 229, 229, 229),
|
||||||
|
),
|
||||||
|
textTheme: PlatformInfos.isDesktop
|
||||||
|
? brightness == Brightness.light
|
||||||
|
? Typography.material2018().black.merge(fallbackTextTheme)
|
||||||
|
: Typography.material2018().white.merge(fallbackTextTheme)
|
||||||
|
: null,
|
||||||
|
snackBarTheme: const SnackBarThemeData(
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
dividerColor: brightness == Brightness.light
|
||||||
|
? Colors.blueGrey.shade50
|
||||||
|
: const Color.fromARGB(255, 42, 73, 111),
|
||||||
|
inputDecorationTheme: const InputDecorationTheme(
|
||||||
|
border: InputBorder.none,
|
||||||
|
filled: true,
|
||||||
|
),
|
||||||
|
appBarTheme: AppBarTheme(
|
||||||
|
surfaceTintColor:
|
||||||
|
brightness == Brightness.light ? Colors.white : Colors.black,
|
||||||
|
backgroundColor: const Color.fromARGB(255, 42, 73, 111),
|
||||||
|
shadowColor: Colors.black.withAlpha(64),
|
||||||
|
systemOverlayStyle: SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
statusBarIconBrightness: brightness.reversed,
|
||||||
|
statusBarBrightness: brightness,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
textStyle: const TextStyle(fontSize: 16),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
extension on Brightness {
|
||||||
|
Brightness get reversed =>
|
||||||
|
this == Brightness.dark ? Brightness.light : Brightness.dark;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user