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

Redesign Auth page #29

Merged
merged 28 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ All user visible changes to this project will be documented in this file. This p
- UI:
- User information auto-updating on changes ([#7], [#4]).
- Menu:
- Language selection ([#23]).
- Language selection ([#23], [#29]).
- Media panel:
- Reorderable buttons dock on desktop ([#9], [#6]).

Expand All @@ -26,7 +26,8 @@ All user visible changes to this project will be documented in this file. This p
- Media panel:
- Redesigned desktop interface ([#26], [#34], [#9]);
- Redesigned mobile interface ([#31], [#34]).
- Redesigned login interface ([#35]).
- Redesigned login interface ([#35]);
- Redesigned auth page ([#29]).

### Fixed

Expand All @@ -49,6 +50,7 @@ All user visible changes to this project will be documented in this file. This p
[#15]: /../../pull/15
[#23]: /../../pull/23
[#26]: /../../pull/26
[#29]: /../../pull/29
[#31]: /../../pull/31
[#34]: /../../pull/34
[#35]: /../../pull/35
Expand Down
Binary file added assets/images/logo/logo.riv
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/l10n/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ btn_reply = Reply
btn_resend_code = Resend confirmation code
btn_saved_messages = Saved messages
btn_settings = Settings
btn_start_chatting = Start chatting
btn_start = Start
btn_submit = Submit
btn_video_call = Video call
btn_write_message = Write a message
Expand Down
2 changes: 1 addition & 1 deletion assets/l10n/ru-RU.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ btn_reply = Ответить
btn_resend_code = Отправить код ещё раз
btn_saved_messages = Сохранённые сообщения
btn_settings = Настройки
btn_start_chatting = Начать общение
btn_start = Начать
btn_submit = Применить
btn_video_call = Видеозвонок
btn_write_message = Написать сообщение
Expand Down
5 changes: 5 additions & 0 deletions lib/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class Config {
/// May be (and intended to be) used as a [ChatDirectLink] prefix.
static String origin = '';

/// Indicator whether all looped animations should be disabled.
///
/// Intended to be used in E2E testing.
static bool disableInfiniteAnimations = false;

/// Initializes this [Config] by applying values from the following sources
/// (in the following order):
/// - default values;
Expand Down
31 changes: 25 additions & 6 deletions lib/ui/page/auth/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

import 'dart:async';

import 'package:flutter/widgets.dart' show GlobalKey;
import 'package:get/get.dart';
import 'package:rive/rive.dart';

import '/domain/service/auth.dart';
import '/routes.dart';
Expand All @@ -34,12 +36,24 @@ class AuthController extends GetxController {
/// Current logo's animation frame.
RxInt logoFrame = RxInt(0);

/// Timer that periodically increases [logoFrame].
/// [SMITrigger] triggering the blinking animation.
SMITrigger? blink;

/// [GlobalKey] of the button opening the [Language] selection.
final GlobalKey languageKey = GlobalKey();

/// [Timer] periodically increasing the [logoFrame].
Timer? _animationTimer;

/// Returns user authentication status.
Rx<RxStatus> get authStatus => _auth.status;

@override
void onClose() {
_animationTimer?.cancel();
super.onClose();
}

@override
void onReady() => Future.delayed(const Duration(milliseconds: 500), animate);

Expand All @@ -54,13 +68,18 @@ class AuthController extends GetxController {
}
}

/// Resets the [logoFrame] and starts the animation.
/// Resets the [logoFrame] and starts the blinking animation.
void animate() {
blink?.fire();

logoFrame.value = 1;
_animationTimer?.cancel();
_animationTimer = Timer.periodic(const Duration(milliseconds: 45), (t) {
++logoFrame.value;
if (logoFrame >= 9) t.cancel();
});
_animationTimer = Timer.periodic(
const Duration(milliseconds: 45),
(t) {
++logoFrame.value;
if (logoFrame >= 9) t.cancel();
},
);
}
}
Loading