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 1846 update style of image picker #2167

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,7 @@
},
"settingsLanguageDescription": "Set the language you use on Twake Chat",
"sendImages": "{count, plural, =1{Send 1 image} other{Send {count} images}}",
"enterCaption": "Enter a caption",
"enterCaption": "Add a caption...",
"failToSend": "Failed to send, please try again",
"showLess": "Show Less",
"showMore": "Show More",
Expand Down
17 changes: 14 additions & 3 deletions lib/pages/chat/chat_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum PickerType {
IconData getIcon() {
switch (this) {
case PickerType.gallery:
return Icons.photo;
return Icons.photo_outlined;
case PickerType.documents:
return Icons.attach_file;
case PickerType.location:
Expand All @@ -51,15 +51,26 @@ enum PickerType {
Color getBackgroundColor() {
switch (this) {
case PickerType.gallery:
return ChatActionsStyle.colorBackgroundGalleryBottom;
case PickerType.documents:
return ChatActionsStyle.colorBackgroundDocumentBottom;
return ChatActionsStyle.colorBackgroundGalleryBottom;
case PickerType.location:
return ChatActionsStyle.colorBackgroundLocationBottom;
case PickerType.contact:
return ChatActionsStyle.colorBackgroundContactBottom;
}
}

Color? getTextColor(BuildContext context) {
switch (this) {
case PickerType.gallery:
return LinagoraSysColors.material().primary;
case PickerType.documents:
return LinagoraSysColors.material().tertiary;
case PickerType.location:
case PickerType.contact:
return LinagoraSysColors.material().onBackground;
}
}
}

enum ChatScrollState {
Expand Down
7 changes: 4 additions & 3 deletions lib/pages/chat/chat_actions_style.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import 'package:flutter/material.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';

class ChatActionsStyle {
static const Color colorBackgroundGalleryBottom = Color(0xFFFFAB00);
static const Color colorBackgroundGalleryBottom = Colors.transparent;
static const Color colorBackgroundDocumentBottom = Color(0xFFEDE7F6);
static const Color colorBackgroundLocationBottom = Color(0xFFE0F2F1);
static const Color colorBackgroundContactBottom = Color(0xFFFCE4EC);

static const Color colorGalleryIcon = Color(0xFFFFFFFF);
static const Color colorDocumentIcon = Color(0xFF7C4DFF);
static Color colorGalleryIcon = LinagoraSysColors.material().primary;
static Color colorDocumentIcon = LinagoraSysColors.material().tertiary;
static const Color colorLocationIcon = Color(0xFF00BFA5);
static const Color colorContactIcon = Color(0xFF880E4F);
}
10 changes: 3 additions & 7 deletions lib/pages/chat/item_actions_bottom_widget.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:fluffychat/pages/chat/chat_actions.dart';
import 'package:flutter/material.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';

typedef OnPickerTypeTap = void Function(PickerType);

Expand All @@ -21,25 +20,22 @@ class PickerTypeOnBottom extends StatelessWidget {
child: Column(
children: [
Container(
width: 56,
height: 56,
padding: const EdgeInsets.all(16),
margin: const EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
decoration: ShapeDecoration(
color: pickerType.getBackgroundColor(),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(36),
),
),
child: Icon(
size: 24,
pickerType.getIcon(),
color: pickerType.getIconColor(),
),
),
Text(
pickerType.getTitle(context),
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: LinagoraSysColors.material().onBackground,
color: pickerType.getTextColor(context),
),
),
],
Expand Down
10 changes: 8 additions & 2 deletions lib/pages/chat/send_file_dialog/send_file_dialog_style.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:linagora_design_flutter/colors/linagora_ref_colors.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';

class SendFileDialogStyle {
static const dialogBorderRadius = 16.0;
Expand Down Expand Up @@ -34,9 +35,12 @@ class SendFileDialogStyle {
?.merge(
Theme.of(context).inputDecorationTheme.hintStyle,
)
.copyWith(letterSpacing: -0.15),
.copyWith(
letterSpacing: -0.15,
color: LinagoraRefColors.material().neutralVariant[60],
),
filled: true,
fillColor: Theme.of(context).colorScheme.surfaceContainerHighest,
fillColor: LinagoraSysColors.material().background,
);

static const spaceBwInputBarAndButton = SizedBox(height: 8.0);
Expand Down Expand Up @@ -73,4 +77,6 @@ class SendFileDialogStyle {
);

static const double errorSubHeaderWidth = 340;

static const double heightOfBottomSheet = 400;
}
4 changes: 3 additions & 1 deletion lib/presentation/mixins/media_picker_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ mixin MediaPickerMixin on CommonMediaPickerMixin {
});

return await linagora_image_picker.ImagePicker.showImagesGridBottomSheet(
heightOfBottomSheet: SendFileDialogStyle.heightOfBottomSheet,
hoangdat marked this conversation as resolved.
Show resolved Hide resolved
context: context,
controller: imagePickerController,
backgroundImageCamera: MediaPickerStyle.cameraIcon,
Expand All @@ -115,6 +116,7 @@ mixin MediaPickerMixin on CommonMediaPickerMixin {
L10n.of(context)!.photoSelectedCounter(counterImage),
style: Theme.of(context).textTheme.titleMedium,
),
const Icon(Icons.chevron_right_outlined),
const Expanded(child: SizedBox.shrink()),
],
),
Expand Down Expand Up @@ -163,7 +165,7 @@ mixin MediaPickerMixin on CommonMediaPickerMixin {
return child!;
},
child: Container(
color: Colors.white,
color: LinagoraSysColors.material().background,
child: Column(
children: [
Stack(
Expand Down
6 changes: 4 additions & 2 deletions lib/presentation/style/media_picker_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class MediaPickerStyle {

static const EdgeInsets itemPickerPadding = EdgeInsets.only(
top: 8.0,
bottom: 34.0,
bottom: 17.0,
right: 65,
left: 65,
);

static const EdgeInsets composerPadding = EdgeInsets.only(
Expand All @@ -26,7 +28,7 @@ class MediaPickerStyle {
left: 4.0,
);

static const EdgeInsets sendButtonPadding = EdgeInsets.only(left: 8);
static const EdgeInsets sendButtonPadding = EdgeInsets.only(top: 4, left: 12);

static const BorderRadius sendButtonBorderRadius =
BorderRadius.all(Radius.circular(100));
Expand Down