Skip to content

Commit

Permalink
Tw 1827/update online status based on design (#1905)
Browse files Browse the repository at this point in the history
* TW-1827: update online status based on new design

* Update the arrow back -> cheron icon
  • Loading branch information
sherlockvn authored Jul 9, 2024
1 parent e15e50f commit 789aa47
Show file tree
Hide file tree
Showing 28 changed files with 55 additions and 52 deletions.
1 change: 0 additions & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2943,7 +2943,6 @@
"contactsCount": "Contacts ({count})",
"linagoraContactsCount": "Linagora contacts ({count})",
"fetchingPhonebookContacts": "Fetching contacts from device...({progress}% completed)",
"activeNow": "Active now",
"languageEnglish": "English",
"@languageEnglish": {
"type": "text",
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/add_story/add_story_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AddStoryView extends StatelessWidget {
backgroundColor: Colors.blueGrey.shade900,
appBar: AppBar(
leading: TwakeIconButton(
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
tooltip: L10n.of(context)!.back,
onTap: () => context.pop(),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/archive/archive_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ArchiveView extends StatelessWidget {
builder: (BuildContext context, snapshot) => Scaffold(
appBar: AppBar(
leading: TwakeIconButton(
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
tooltip: L10n.of(context)!.back,
onTap: () => context.pop(),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_app_bar_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class ChatAppBarTitleText extends StatelessWidget {

@override
Widget build(BuildContext context) {
final TextStyle? statusTextStyle = text == L10n.of(context)!.activeNow
final TextStyle? statusTextStyle = text == L10n.of(context)!.online
? ChatAppBarTitleStyle.onlineStatusTextStyle(context)
: ChatAppBarTitleStyle.offlineStatusTextStyle(context);

Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/chat_app_bar_title_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class ChatAppBarTitleStyle {
static TextStyle? onlineStatusTextStyle(BuildContext context) =>
responsive.isMobile(context)
? Theme.of(context).textTheme.labelMedium?.copyWith(
color: LinagoraRefColors.material().secondary,
color: LinagoraRefColors.material().secondary[40],
letterSpacing: ChatAppBarTitleStyle.letterSpacingStatusContent,
)
: Theme.of(context).textTheme.bodySmall?.copyWith(
color: LinagoraRefColors.material().secondary,
color: LinagoraRefColors.material().secondary[40],
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PinnedMessagesScreen extends StatelessWidget {
),
leading: TwakeIconButton(
tooltip: L10n.of(context)!.back,
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: controller.onClickBackButton,
),
actions: [
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class ChatView extends StatelessWidget with MessageContentMixin {
padding: const EdgeInsets.only(left: 8),
child: TwakeIconButton(
tooltip: L10n.of(context)!.back,
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: controller.onBackPress,
paddingAll: 8.0,
margin: const EdgeInsets.symmetric(vertical: 12.0),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat_details/chat_details_edit_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ChatDetailsEditView extends StatelessWidget {
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
onPressed: controller.onBack,
icon: const Icon(Icons.arrow_back),
icon: const Icon(Icons.arrow_back_ios),
),
),
Text(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat_details/chat_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ChatDetailsView extends StatelessWidget {
highlightColor: Colors.transparent,
onPressed: controller.widget.closeRightColumn,
icon: controller.widget.isInStack
? const Icon(Icons.arrow_back)
? const Icon(Icons.arrow_back_ios)
: const Icon(Icons.close),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat_draft/draft_chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DraftChatView extends StatelessWidget {
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
tooltip: L10n.of(context)!.back,
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: () => context.pop(),
paddingAll: 8.0,
margin: const EdgeInsets.symmetric(vertical: 12.0),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat_profile_info/chat_profile_info_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ChatProfileInfoView extends StatelessWidget {
child: IconButton(
onPressed: controller.widget.onBack,
icon: controller.widget.isInStack
? const Icon(Icons.arrow_back)
? const Icon(Icons.arrow_back_ios)
: const Icon(Icons.close),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat_search/chat_search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class _ChatSearchAppBar extends StatelessWidget {
Padding(
padding: ChatViewStyle.paddingLeading(context),
child: TwakeIconButton(
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: controller.onBack,
tooltip: L10n.of(context)!.back,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/dialer/dialer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ class MyCallingPage extends State<Calling> {
left: 24.0,
child: IconButton(
color: Colors.black45,
icon: const Icon(Icons.arrow_back),
icon: const Icon(Icons.arrow_back_ios),
onPressed: () {
PIPView.of(context)?.setFloating(true);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/error_page/error_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _ErrorPageBackButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TextButton.icon(
icon: const Icon(Icons.arrow_back),
icon: const Icon(Icons.arrow_back_ios),
onPressed: () => _goToRooms(context),
label: Text(
L10n.of(context)!.errorPageButton,
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/homeserver_picker/homeserver_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class HomeserverAppBar extends StatelessWidget {
prefixIcon: Navigator.of(context).canPop()
? IconButton(
onPressed: Navigator.of(context).pop,
icon: const Icon(Icons.arrow_back),
icon: const Icon(Icons.arrow_back_ios),
)
: null,
prefixText: '${L10n.of(context)!.homeserver}: ',
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/homeserver_picker/homeserver_picker_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class HomeserverPickerView extends StatelessWidget {
appBar: PlatformInfos.isMobile
? AppBar(
leading: TwakeIconButton(
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: controller.state != HomeserverState.loading
? () => context.pop()
: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/image_viewer/media_viewer_app_bar_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MediaViewerAppbarView extends StatelessWidget {
IconButton(
icon: Icon(
MediaViewerAppBar.responsiveUtils.isMobile(context)
? Icons.arrow_back_rounded
? Icons.arrow_back_ios_rounded
: Icons.close,
color: LinagoraSysColors.material().onPrimary,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/image_viewer/media_viewer_app_bar_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MediaViewerAppBarWeb extends StatelessWidget
IconButton(
icon: Icon(
MediaViewerAppBar.responsiveUtils.isMobile(context)
? Icons.arrow_back_rounded
? Icons.arrow_back_ios_rounded
: Icons.close,
color: LinagoraSysColors.material().onPrimary,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/new_group/new_group_chat_info_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class NewGroupChatInfoView extends StatelessWidget {
title: Row(
children: [
TwakeIconButton(
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: () => Navigator.of(context).pop(),
tooltip: L10n.of(context)!.back,
paddingAll: NewGroupChatInfoStyle.backIconPaddingAll,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/new_private_chat/widget/contact_status_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ContactStatusWidget extends StatelessWidget {
required this.status,
});

final Color activeColor = const Color(0xFF43A843);
final Color? activeColor = LinagoraRefColors.material().secondary[40];
final Color? inactiveColor = LinagoraRefColors.material().neutral[60];

@override
Expand All @@ -30,7 +30,7 @@ class ContactStatusWidget extends StatelessWidget {
),
status == ContactStatus.active
? Text(
" ${L10n.of(context)!.active}",
" ${L10n.of(context)!.online}",
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: activeColor,
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/profile_info/profile_info_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProfileInfoView extends StatelessWidget {
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
onPressed: () => Navigator.of(context).pop(),
icon: const Icon(Icons.arrow_back),
icon: const Icon(Icons.arrow_back_ios),
),
),
Flexible(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/search/search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class SearchView extends StatelessWidget {
children: [
TwakeIconButton(
tooltip: L10n.of(context)!.back,
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: () => Navigator.of(context).pop(),
paddingAll: SearchViewStyle.paddingBackButton,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SettingsProfileView extends StatelessWidget {
leading: responsive.isMobile(context)
? IconButton(
icon: const Icon(
Icons.arrow_back,
Icons.arrow_back_ios,
size: SettingsProfileViewStyle.sizeIcon,
),
onPressed: () => context.pop(),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/twake_welcome/twake_welcome_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TwakeWelcomeView extends StatelessWidget {
? AppBar(
backgroundColor: Colors.transparent,
leading: TwakeIconButton(
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: () => context.pop(),
tooltip: L10n.of(context)!.back,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/room_status_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ extension RoomStatusExtension on Room {
) {
if (directChatPresence != null) {
if (directChatPresence.presence == PresenceType.online) {
return L10n.of(context)!.activeNow;
return L10n.of(context)!.online;
}
final lastActiveDateTime = directChatPresence.lastActiveTimestamp;
final currentDateTime = DateTime.now();
if (lastActiveDateTime != null) {
if (lastActiveDateTime.isLessThanOneMinuteAgo()) {
return L10n.of(context)!.activeNow;
return L10n.of(context)!.online;
} else if (lastActiveDateTime.isLessThanOneHourAgo()) {
return L10n.of(context)!.onlineMinAgo(
currentDateTime.difference(lastActiveDateTime).inMinutes,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/app_bars/searchable_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SearchableAppBar extends StatelessWidget {
children: [
if (isFullScreen) ...[
TwakeIconButton(
icon: Icons.arrow_back,
icon: Icons.arrow_back_ios,
onTap: () {
if (!FirstColumnInnerRoutes.instance
.goRouteAvailableInFirstColumn()) {
Expand Down
Loading

0 comments on commit 789aa47

Please sign in to comment.