Skip to content

Commit 748eeb3

Browse files
authored
chore:update Bottom Bar with animation indicator (#633)(#625)(#627)(#771)
* chore:update `Bottom Bar` with animation indacator * chore: Add border to badge in bar and textStyle * chore: resolve a11y zoom and voiceOver * fix: order of the accessible label sur android * fix: switching from on/off without animation ios * fix: VoiceOver a11y TabBar * chore: update a11y badge text
1 parent f77da5d commit 748eeb3

21 files changed

Lines changed: 1451 additions & 203 deletions

app/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased](https://github.com/Orange-OpenSource/ouds-flutter/compare/1.3.1...develop)
88
### Added
99
### Changed
10+
- [Library] `tab bar component`, update the animation of the `selected tab indicator` ([#633](https://github.com/Orange-OpenSource/ouds-flutter/issues/633))
1011
- [DemoApp][Library] Update `ToolBar Top`, with Badge in Trailing Actions ([#642](https://github.com/Orange-OpenSource/ouds-flutter/issues/642))
1112
- [DemoApp][Library] update `alert message`, `switch`, `radio`, `checkbox`, `text input`, `pin code input`, `phone number input`, components to use rich text ([#782](https://github.com/Orange-OpenSource/ouds-flutter/issues/782))
1213
- [Library] Update text input component to v1.4 ([#692](https://github.com/Orange-OpenSource/ouds-flutter/issues/692))
@@ -24,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2425
- [DemoApp][Library] update tokens 2.4.0 ([#726](https://github.com/Orange-OpenSource/ouds-flutter/issues/726))
2526

2627
### Fixed
28+
- [DemoApp][Library] `Bottom Bar` Inconsistent order of the accessible ([#625](https://github.com/Orange-OpenSource/ouds-flutter/issues/625))
29+
- [Library] `Bottom Bar` Overlap when zoom is activated ([#627](https://github.com/Orange-OpenSource/ouds-flutter/issues/627))
2730
- [DemoApp] Update pubspec icons 1.6 ([#794](https://github.com/Orange-OpenSource/ouds-flutter/issues/794))
2831
- [Library] `Password input` Label is truncated when zoom is applied ([#600](https://github.com/Orange-OpenSource/ouds-flutter/issues/600))
2932
- [Library] `Filter chip` is not reached by keyboard focus or Switch Access focus ([#474](https://github.com/Orange-OpenSource/ouds-flutter/issues/474))

app/lib/l10n/gen/ouds_flutter_app_localizations.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,18 @@ abstract class AppLocalizations {
13141314
/// **'Last item badge'**
13151315
String get app_components_navigationBar_lastItemBadge_label;
13161316

1317+
/// No description provided for @app_components_navigationBar_badge_count_a11y.
1318+
///
1319+
/// In en, this message translates to:
1320+
/// **'{count, plural, =1 {1 unread notification} other {{count} unread notifications}}'**
1321+
String app_components_navigationBar_badge_count_a11y(int count);
1322+
1323+
/// No description provided for @app_components_navigationBar_badge_dot_a11y.
1324+
///
1325+
/// In en, this message translates to:
1326+
/// **'Unread notification'**
1327+
String get app_components_navigationBar_badge_dot_a11y;
1328+
13171329
/// No description provided for @app_components_topAppBar_label.
13181330
///
13191331
/// In en, this message translates to:

app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,24 @@ class AppLocalizationsAr extends AppLocalizations {
689689
String get app_components_navigationBar_lastItemBadge_label =>
690690
'Last item badge';
691691

692+
@override
693+
String app_components_navigationBar_badge_count_a11y(int count) {
694+
String _temp0 = intl.Intl.pluralLogic(
695+
count,
696+
locale: localeName,
697+
other: '$count إشعار غير مقروء',
698+
many: '$count إشعارًا غير مقروء',
699+
few: '$count إشعارات غير مقروءة',
700+
two: 'إشعاران غير مقروءين',
701+
one: 'إشعار واحد غير مقروء',
702+
zero: 'لا توجد إشعارات غير مقروءة',
703+
);
704+
return '$_temp0';
705+
}
706+
707+
@override
708+
String get app_components_navigationBar_badge_dot_a11y => 'إشعار غير مقروء';
709+
692710
@override
693711
String get app_components_topAppBar_label => 'Top bar';
694712

app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,21 @@ class AppLocalizationsEn extends AppLocalizations {
689689
String get app_components_navigationBar_lastItemBadge_label =>
690690
'Last item badge';
691691

692+
@override
693+
String app_components_navigationBar_badge_count_a11y(int count) {
694+
String _temp0 = intl.Intl.pluralLogic(
695+
count,
696+
locale: localeName,
697+
other: '$count unread notifications',
698+
one: '1 unread notification',
699+
);
700+
return '$_temp0';
701+
}
702+
703+
@override
704+
String get app_components_navigationBar_badge_dot_a11y =>
705+
'Unread notification';
706+
692707
@override
693708
String get app_components_topAppBar_label => 'Top bar';
694709

app/lib/l10n/gen/ouds_flutter_app_localizations_fr.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,21 @@ class AppLocalizationsFr extends AppLocalizations {
693693
String get app_components_navigationBar_lastItemBadge_label =>
694694
'Last item badge';
695695

696+
@override
697+
String app_components_navigationBar_badge_count_a11y(int count) {
698+
String _temp0 = intl.Intl.pluralLogic(
699+
count,
700+
locale: localeName,
701+
other: '$count notifications non lues',
702+
one: '1 notification non lue',
703+
);
704+
return '$_temp0';
705+
}
706+
707+
@override
708+
String get app_components_navigationBar_badge_dot_a11y =>
709+
'Notification non lue';
710+
696711
@override
697712
String get app_components_topAppBar_label => 'Top bar';
698713

app/lib/l10n/ouds_flutter_ar.arb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@
125125

126126
"@_components_navigation_bar": {},
127127
"app_components_navigationBar_description_text": "Bottom bars يوفر الوصول إلى الوجهات الرئيسية للتطبيق باستخدام 3 إلى 5 علامات تبويب دائمة. يتم تمثيل كل وجهة بواسطة أيقونة وعلامة نصية اختيارية.",
128+
"app_components_navigationBar_badge_count_a11y": "{count, plural, zero {لا توجد إشعارات غير مقروءة} one {إشعار واحد غير مقروء} two {إشعاران غير مقروءين} few {{count} إشعارات غير مقروءة} many {{count} إشعارًا غير مقروء} other {{count} إشعار غير مقروء}}",
129+
"@app_components_navigationBar_badge_count_a11y": {
130+
"placeholders": {
131+
"count": {
132+
"type": "int"
133+
}
134+
}
135+
},
136+
"app_components_navigationBar_badge_dot_a11y": "إشعار غير مقروء",
128137

129138
"@_components_topAppBar": {},
130139
"app_components_topAppBar_description_text": "Top bar هو مكون موجه من الأعلى يعرض عنوان الشاشة ويوفر الوصول إلى الإجراءات الرئيسية وعناصر التنقل.",

app/lib/l10n/ouds_flutter_en.arb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,15 @@
294294
"app_components_navigationBar_description_text": "The Bottom bar provides access to an app’s primary destinations using 3 to 5 persistent tabs. Each destination is represented by an icon and optionally a text label.",
295295
"app_components_navigationBar_itemCount_label": "Item count",
296296
"app_components_navigationBar_lastItemBadge_label": "Last item badge",
297+
"app_components_navigationBar_badge_count_a11y": "{count, plural, =1 {1 unread notification} other {{count} unread notifications}}",
298+
"@app_components_navigationBar_badge_count_a11y": {
299+
"placeholders": {
300+
"count": {
301+
"type": "int"
302+
}
303+
}
304+
},
305+
"app_components_navigationBar_badge_dot_a11y": "Unread notification",
297306

298307
"@_components_topAppBar": {},
299308
"app_components_topAppBar_label": "Top bar",

app/lib/l10n/ouds_flutter_fr.arb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@
122122

123123
"@_components_navigation_bar": {},
124124
"app_components_navigationBar_description_text": "Une Bottom bar (ou barre inférieure) permet d'accéder aux principales destinations d'une application grâce à 3 à 5 onglets permanents. Chaque destination est représentée par une icône et, éventuellement, par un libellé textuel.",
125+
"app_components_navigationBar_badge_count_a11y": "{count, plural, =1 {1 notification non lue} other {{count} notifications non lues}}",
126+
"@app_components_navigationBar_badge_count_a11y": {
127+
"placeholders": {
128+
"count": {
129+
"type": "int"
130+
}
131+
}
132+
},
133+
"app_components_navigationBar_badge_dot_a11y": "Notification non lue",
125134

126135
"@_components_topAppBar": {},
127136
"app_components_topAppBar_description_text": "L'app bar (ou barre d'application) est un composant situé en haut de l'ecran qui affiche le titre et donne accès aux actions principales et aux éléments de navigation.",

app/lib/ui/components/components.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ List<Component> components(BuildContext context) {
157157
onDestinationSelected: (index) {},
158158
translucent: true,
159159
destinations: NavigationBarCustomizationUtils.buildItems(
160+
context: context,
160161
themeController: themeController,
161162
),
162163
),

app/lib/ui/components/navigation/navigation_bar_customization_utils.dart

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
* // Software description: Flutter library of reusable graphical components
1111
* //
1212
*/
13+
import 'package:flutter/widgets.dart';
1314
import 'package:ouds_core/components/navigation/ouds_navigation_bar_item.dart';
15+
import 'package:ouds_flutter_demo/l10n/gen/ouds_flutter_app_localizations.dart';
1416
import 'package:ouds_flutter_demo/ui/components/navigation/navigation_bar_customization.dart';
1517
import 'package:ouds_flutter_demo/ui/components/navigation/navigation_bar_enum.dart';
1618
import 'package:ouds_flutter_demo/ui/theme/theme_controller.dart';
@@ -23,39 +25,54 @@ class NavigationBarCustomizationUtils {
2325

2426
/// Returns an optional navigation bar item badge based on the selected badge type
2527
/// (count badge, standard badge, or none).
26-
static OudsNavigationBarItemBadge? getItemBadge(NavigationBarCustomizationState customizationState) {
28+
static OudsNavigationBarItemBadge? getItemBadge(
29+
NavigationBarCustomizationState customizationState,
30+
BuildContext context,
31+
) {
32+
final l10n = AppLocalizations.of(context)!;
33+
2734
return customizationState.selectedItemBadge == ItemBadge.count
28-
? OudsNavigationBarItemBadge(contentDescription: "$itemBadgeCount notification unread", count: itemBadgeCount)
35+
? OudsNavigationBarItemBadge(
36+
contentDescription: l10n
37+
.app_components_navigationBar_badge_count_a11y(itemBadgeCount),
38+
count: itemBadgeCount,
39+
)
2940
: customizationState.selectedItemBadge == ItemBadge.dot
30-
? OudsNavigationBarItemBadge(contentDescription: "notification unread")
31-
: null;
41+
? OudsNavigationBarItemBadge(
42+
contentDescription:
43+
l10n.app_components_navigationBar_badge_dot_a11y,
44+
)
45+
: null;
3246
}
3347

3448
/// Generates a list of consecutive item count values from [minItemCount] to [maxItemCount] (inclusive).
35-
static final itemCountOptions = List<int>.generate(maxItemCount - minItemCount + 1, (index) => minItemCount + index);
49+
static final itemCountOptions = List<int>.generate(
50+
maxItemCount - minItemCount + 1,
51+
(index) => minItemCount + index,
52+
);
3653

3754
/// Builds a shared list of navigation bar items based on the current
3855
/// customization state and theme.
3956
static List<OudsNavigationBarItem> buildItems({
4057
required ThemeController themeController,
58+
required BuildContext context,
4159
NavigationBarCustomizationState? customizationState,
4260
int itemCount = minItemCount,
4361
}) {
4462
final safeItemCount = itemCount.clamp(minItemCount, maxItemCount);
4563

46-
return List.generate(
47-
safeItemCount,
48-
(index) {
49-
final isLastItem = index == safeItemCount - 1;
64+
return List.generate(safeItemCount, (index) {
65+
final isLastItem = index == safeItemCount - 1;
5066

51-
return OudsNavigationBarItem(
52-
icon: AppAssets.icons.functionalSocialAndEngagementHeartEmpty(
53-
themeController,
54-
),
55-
label: 'Label', //'item ${index + 1}',
56-
badge: (isLastItem && customizationState != null) ? getItemBadge(customizationState) : null,
57-
);
58-
},
59-
);
67+
return OudsNavigationBarItem(
68+
icon: AppAssets.icons.functionalSocialAndEngagementHeartEmpty(
69+
themeController,
70+
),
71+
label: 'Label', //'item ${index + 1}',
72+
badge: (isLastItem && customizationState != null)
73+
? getItemBadge(customizationState, context)
74+
: null,
75+
);
76+
});
6077
}
6178
}

0 commit comments

Comments
 (0)