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

[MA-PART-3] TF-2431 Implement multiple account on mobile #2435

Open
wants to merge 17 commits into
base: starting-page
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
- \#1792 Add option 'Empty Trash' in folder menu

### Changed
- \#1755 Use TupleKey('ObjectId\|AccountId\|UserName') store data to cache
- \#1755 Use TupleKey('AccountId\|UserName\|ObjectId') store data to cache

### Fixed
- \#1385 Fix \[Email rule\] Icon edit and delete might be seen as disable
Expand Down
47 changes: 47 additions & 0 deletions assets/images/ic_logo_twake_horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions assets/images/ic_switch_account.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions core/lib/presentation/resources/image_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ class ImagePaths {
String get icLogoTwakeWelcome => _getImagePath('ic_logo_twake_welcome.svg');
String get icCheckboxOn => _getImagePath('ic_checkbox_on.svg');
String get icCheckboxOff => _getImagePath('ic_checkbox_off.svg');
String get icLogoTwakeHorizontal => _getImagePath('ic_logo_twake_horizontal.svg');
String get icSwitchAccount => _getImagePath('ic_switch_account.svg');

String _getImagePath(String imageName) {
return AssetsPaths.images + imageName;
Expand Down
16 changes: 10 additions & 6 deletions core/lib/presentation/utils/theme_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,32 @@ class ThemeUtils {

static TextTheme get _textTheme {
return const TextTheme(
bodyLarge: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 17,
letterSpacing: -0.15,
),
titleLarge: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 28
),
bodyLarge: TextStyle(
fontSize: 17
),
bodyMedium: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 15
),
bodySmall: TextStyle(
fontWeight: FontWeight.w500
fontWeight: FontWeight.normal,
fontSize: 15
),
headlineLarge: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 32,
),
labelSmall: TextStyle(
fontWeight: FontWeight.normal
),
labelLarge: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16
)
);
}
Expand Down
20 changes: 10 additions & 10 deletions core/lib/presentation/views/dialog/confirmation_dialog_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class ConfirmDialogBuilder {
TextStyle? _styleContent;
double? _radiusButton;
double? heightButton;
EdgeInsets? _paddingTitle;
EdgeInsets? _paddingContent;
EdgeInsets? _paddingButton;
EdgeInsetsGeometry? _paddingTitle;
EdgeInsetsGeometry? _paddingContent;
EdgeInsetsGeometry? _paddingButton;
EdgeInsets? _outsideDialogPadding;
EdgeInsets? _marginIcon;
EdgeInsets? _margin;
EdgeInsetsGeometry? _marginIcon;
EdgeInsetsGeometry? _margin;
double? _widthDialog;
double? _heightDialog;
double maxWith;
Expand Down Expand Up @@ -95,23 +95,23 @@ class ConfirmDialogBuilder {
_radiusButton = radius;
}

void paddingTitle(EdgeInsets? value) {
void paddingTitle(EdgeInsetsGeometry? value) {
_paddingTitle = value;
}

void paddingContent(EdgeInsets? value) {
void paddingContent(EdgeInsetsGeometry? value) {
_paddingContent = value;
}

void paddingButton(EdgeInsets? value) {
void paddingButton(EdgeInsetsGeometry? value) {
_paddingButton = value;
}

void marginIcon(EdgeInsets? value) {
void marginIcon(EdgeInsetsGeometry? value) {
_marginIcon = value;
}

void margin(EdgeInsets? value) {
void margin(EdgeInsetsGeometry? value) {
_margin = value;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 27. Use TupleKey store data cache
# 27. Use TupleKey store data to hive database

Date: 2023-04-27

Expand All @@ -9,13 +9,14 @@ Accepted
## Context

- Multiple accounts login at the same time in the same browser. The accounts will use the same database (`IndexDatabase`).
- To support multiple accounts

## Decision

- Use unique parameters (`AccountId`, `UserName`, `ObjectId(MailboxId/EmailId/StateType`) to form a unique `key` for storage (called `TupleKey`).
- TupleKey has the format: `ObjectId | AccountId | User`;
- Use unique parameters (`AccountId`, `UserName`, `ObjectId(MailboxId/EmailId/StateType/...)`) to form a unique `key` for storage (called `TupleKey`).
- TupleKey has the format: `AccountId | UserName | [ObjectId]`;
- `HiveDatabase` includes many `Box`. Each box is a `Map<Key, Object>` with `key=TupleKey`.

## Consequences

- The correct `mailbox` and `email` lists are obtained for each account
- Each account will manage its own data storage boxes
Loading
Loading