Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW-824: install google fonts to fetch font from http #832

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/adr/0003-improve-for-load-image-first-time.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 1. Improve for load image first time and keep image when scrolling
# 3. Improve for load image first time and keep image when scrolling

Date: 2023-06-27

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0006. DOMException error when use delete disk of Hive for Web
# 6. DOMException error when use delete disk of Hive for Web

Date: 2023-09-13

Expand Down
2 changes: 1 addition & 1 deletion docs/adr/0009-Instructions-for-naming-twake-events.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 7. Instructions for naming twake events
# 9. Instructions for naming twake events

Date: 2023-10-03

Expand Down
202 changes: 0 additions & 202 deletions fonts/Roboto/LICENSE.txt

This file was deleted.

Binary file removed fonts/Roboto/Roboto-Black.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-BlackItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Bold.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-BoldItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Italic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Light.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-LightItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Medium.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-MediumItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Regular.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-Thin.ttf
Binary file not shown.
Binary file removed fonts/Roboto/Roboto-ThinItalic.ttf
Binary file not shown.
Binary file removed fonts/Roboto/RobotoMono-Regular.ttf
Binary file not shown.
34 changes: 15 additions & 19 deletions lib/config/themes.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:linagora_design_flutter/colors/linagora_ref_colors.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';

import 'app_config.dart';

abstract class FluffyThemes {
abstract class TwakeThemes {
static const double columnWidth = 360.0;
static const double iconSize = 24.0;

Expand All @@ -18,58 +19,53 @@ abstract class FluffyThemes {
static bool getDisplayNavigationRail(BuildContext context) =>
!(GoRouterState.of(context).path?.startsWith('/settings') == true);

static const fallbackTextStyle = TextStyle(
fontFamily: 'Inter',
fontFamilyFallback: ['Inter'],
);

static var fallbackTextTheme = TextTheme(
bodyLarge: fallbackTextStyle.copyWith(
bodyLarge: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: -0.15,
),
bodyMedium: fallbackTextStyle.copyWith(
bodyMedium: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.25,
),
bodySmall: fallbackTextStyle.copyWith(
bodySmall: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.4,
),
labelLarge: fallbackTextStyle.copyWith(
labelLarge: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.1,
),
labelSmall: fallbackTextStyle.copyWith(
labelSmall: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.5,
),
displayLarge: fallbackTextStyle.copyWith(
displayLarge: GoogleFonts.inter(
fontWeight: FontWeight.w700,
),
displayMedium: fallbackTextStyle.copyWith(
displayMedium: GoogleFonts.inter(
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
displaySmall: fallbackTextStyle.copyWith(
displaySmall: GoogleFonts.inter(
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
headlineMedium: fallbackTextStyle.copyWith(
headlineMedium: GoogleFonts.inter(
fontWeight: FontWeight.w600,
),
headlineSmall: fallbackTextStyle.copyWith(
headlineSmall: GoogleFonts.inter(
fontWeight: FontWeight.w600,
letterSpacing: 0.4,
),
titleLarge: fallbackTextStyle.copyWith(
titleLarge: GoogleFonts.inter(
fontWeight: FontWeight.w600,
),
titleMedium: fallbackTextStyle.copyWith(
titleMedium: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.15,
),
titleSmall: fallbackTextStyle.copyWith(
titleSmall: GoogleFonts.inter(
fontWeight: FontWeight.w500,
letterSpacing: 0.1,
),
Expand Down
9 changes: 5 additions & 4 deletions lib/pages/bootstrap/bootstrap_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:matrix/encryption.dart';
import 'package:matrix/encryption/utils/bootstrap.dart';
import 'package:matrix/matrix.dart';
Expand Down Expand Up @@ -117,7 +118,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
body: Center(
child: ConstrainedBox(
constraints:
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 1.5),
const BoxConstraints(maxWidth: TwakeThemes.columnWidth * 1.5),
child: ListView(
padding: const EdgeInsets.all(16.0),
children: [
Expand All @@ -140,7 +141,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
minLines: 2,
maxLines: 4,
readOnly: true,
style: const TextStyle(fontFamily: 'RobotoMono'),
style: GoogleFonts.robotoMono(),
hoangdat marked this conversation as resolved.
Show resolved Hide resolved
controller: TextEditingController(text: key),
decoration: const InputDecoration(
contentPadding: EdgeInsets.all(16),
Expand Down Expand Up @@ -244,7 +245,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
body: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 1.5,
maxWidth: TwakeThemes.columnWidth * 1.5,
),
child: ListView(
padding: const EdgeInsets.all(16.0),
Expand All @@ -270,7 +271,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
? null
: [AutofillHints.password],
controller: _recoveryKeyTextEditingController,
style: const TextStyle(fontFamily: 'RobotoMono'),
style: GoogleFonts.robotoMono(),
decoration: InputDecoration(
contentPadding: const EdgeInsets.all(16),
hintStyle: TextStyle(
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/chat_emoji_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ChatEmojiPicker extends StatelessWidget {
valueListenable: controller.showEmojiPickerNotifier,
builder: (context, showEmojiPicker, _) {
return AnimatedContainer(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
duration: TwakeThemes.animationDuration,
curve: TwakeThemes.animationCurve,
width: MediaQuery.of(context).size.width,
height: showEmojiPicker ? MediaQuery.of(context).size.height / 3 : 0,
child: showEmojiPicker
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_event_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ChatEventList extends StatelessWidget {

@override
Widget build(BuildContext context) {
final horizontalPadding = FluffyThemes.isColumnMode(context) ? 8.0 : 0.0;
final horizontalPadding = TwakeThemes.isColumnMode(context) ? 8.0 : 0.0;

// create a map of eventId --> index to greatly improve performance of
// ListView's findChildIndexCallback
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ChatView extends StatelessWidget with MessageContentMixin {
return const SizedBox.shrink();
}

final bottomSheetPadding = FluffyThemes.isColumnMode(context) ? 16.0 : 8.0;
final bottomSheetPadding = TwakeThemes.isColumnMode(context) ? 16.0 : 8.0;

return GestureDetector(
onTapDown: controller.setReadMarker,
Expand Down Expand Up @@ -273,7 +273,7 @@ class ChatView extends StatelessWidget with MessageContentMixin {
controller.room!.membership == Membership.join)
Container(
constraints: const BoxConstraints(
maxWidth: FluffyThemes.columnWidth * 2.5,
maxWidth: TwakeThemes.columnWidth * 2.5,
),
alignment: Alignment.center,
child: controller.room?.isAbandonedDMRoom == true
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/events/message/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ class Message extends StatelessWidget {
? LinagoraSysColors.material().secondaryContainer
: Theme.of(context).primaryColor.withAlpha(0),
constraints:
const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5),
const BoxConstraints(maxWidth: TwakeThemes.columnWidth * 2.5),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Expand Down
Loading