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
@ -16,7 +16,7 @@ stages:
|
|||||||
|
|
||||||
code_analyze:
|
code_analyze:
|
||||||
stage: test
|
stage: test
|
||||||
script: [./scripts/code_analyze.sh]
|
script: [ ./scripts/code_analyze.sh ]
|
||||||
artifacts:
|
artifacts:
|
||||||
reports:
|
reports:
|
||||||
codequality: code-quality-report.json
|
codequality: code-quality-report.json
|
||||||
@ -26,7 +26,7 @@ code_analyze:
|
|||||||
|
|
||||||
widget_test:
|
widget_test:
|
||||||
stage: test
|
stage: test
|
||||||
script: [flutter test]
|
script: [ flutter test ]
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- famedly
|
- famedly
|
||||||
@ -99,9 +99,9 @@ release_mode_launches:
|
|||||||
stage: test
|
stage: test
|
||||||
before_script:
|
before_script:
|
||||||
- |
|
- |
|
||||||
if [ "$FLAVOR" == "proprietary" ]; then
|
if [ "$FLAVOR" == "proprietary" ]; then
|
||||||
git apply ./scripts/enable-android-google-services.patch
|
git apply ./scripts/enable-android-google-services.patch
|
||||||
fi
|
fi
|
||||||
script:
|
script:
|
||||||
# start AVD and keep running in background
|
# start AVD and keep running in background
|
||||||
- scripts/integration-start-avd.sh &
|
- scripts/integration-start-avd.sh &
|
||||||
@ -115,8 +115,8 @@ release_mode_launches:
|
|||||||
build_web:
|
build_web:
|
||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
[sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh]
|
[ sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh ]
|
||||||
script: [./scripts/build-web.sh]
|
script: [ ./scripts/build-web.sh ]
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- build/web/
|
- build/web/
|
||||||
@ -125,8 +125,8 @@ build_windows:
|
|||||||
extends:
|
extends:
|
||||||
- .shared_windows_runners
|
- .shared_windows_runners
|
||||||
stage: build
|
stage: build
|
||||||
before_script: [./scripts/prepare-windows.ps1]
|
before_script: [ ./scripts/prepare-windows.ps1 ]
|
||||||
script: [./scripts/build-windows.ps1]
|
script: [ ./scripts/build-windows.ps1 ]
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- build/windows/runner/Release
|
- build/windows/runner/Release
|
||||||
@ -137,7 +137,7 @@ build_windows:
|
|||||||
|
|
||||||
build_android_debug:
|
build_android_debug:
|
||||||
stage: build
|
stage: build
|
||||||
script: [./scripts/build-android-debug.sh]
|
script: [ ./scripts/build-android-debug.sh ]
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- famedly
|
- famedly
|
||||||
@ -154,7 +154,7 @@ build_android_apk:
|
|||||||
before_script:
|
before_script:
|
||||||
- git apply ./scripts/enable-android-google-services.patch
|
- git apply ./scripts/enable-android-google-services.patch
|
||||||
- ./scripts/prepare-android-release.sh
|
- ./scripts/prepare-android-release.sh
|
||||||
script: [./scripts/build-android-apk.sh]
|
script: [ ./scripts/build-android-apk.sh ]
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- famedly
|
- famedly
|
||||||
@ -166,12 +166,34 @@ 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:
|
||||||
- git apply ./scripts/enable-android-google-services.patch
|
- git apply ./scripts/enable-android-google-services.patch
|
||||||
- ./scripts/prepare-android-release.sh
|
- ./scripts/prepare-android-release.sh
|
||||||
script: [./scripts/release-playstore-beta.sh]
|
script: [ ./scripts/release-playstore-beta.sh ]
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- famedly
|
- famedly
|
||||||
@ -235,7 +257,7 @@ build_linux_x86:
|
|||||||
[
|
[
|
||||||
sudo apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration -y && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 -y,
|
sudo apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration -y && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 -y,
|
||||||
]
|
]
|
||||||
script: [./scripts/build-linux.sh]
|
script: [ ./scripts/build-linux.sh ]
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_success
|
when: on_success
|
||||||
paths:
|
paths:
|
||||||
@ -243,9 +265,9 @@ build_linux_x86:
|
|||||||
|
|
||||||
build_linux_arm64:
|
build_linux_arm64:
|
||||||
stage: build
|
stage: build
|
||||||
before_script: [flutter upgrade]
|
before_script: [ flutter upgrade ]
|
||||||
script: [./scripts/build-linux.sh]
|
script: [ ./scripts/build-linux.sh ]
|
||||||
tags: [docker_arm64]
|
tags: [ docker_arm64 ]
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
- tags
|
- tags
|
||||||
@ -257,7 +279,7 @@ build_linux_arm64:
|
|||||||
|
|
||||||
update_dependencies:
|
update_dependencies:
|
||||||
stage: build
|
stage: build
|
||||||
needs: []
|
needs: [ ]
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
only:
|
only:
|
||||||
@ -335,7 +357,7 @@ deploy_playstore:
|
|||||||
before_script:
|
before_script:
|
||||||
- git apply ./scripts/enable-android-google-services.patch
|
- git apply ./scripts/enable-android-google-services.patch
|
||||||
- ./scripts/prepare-android-release.sh
|
- ./scripts/prepare-android-release.sh
|
||||||
script: [./scripts/release-playstore.sh]
|
script: [ ./scripts/release-playstore.sh ]
|
||||||
resource_group: playstore_release
|
resource_group: playstore_release
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
|
|||||||
@ -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