TF-1033: apply auto scroll to identity , composer , vacation screen
This commit is contained in:
@@ -1365,4 +1365,13 @@ class ComposerController extends BaseController {
|
|||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
popBack();
|
popBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void onEnterKeyDown() {
|
||||||
|
scrollController.animateTo(
|
||||||
|
keyboardRichTextController.currentLine * 20,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.linear,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -680,7 +680,7 @@ class ComposerView extends GetWidget<ComposerController>
|
|||||||
if(responsiveUtils.isMobile(context)){
|
if(responsiveUtils.isMobile(context)){
|
||||||
controller.keyboardRichTextController.onCreateHTMLEditor(
|
controller.keyboardRichTextController.onCreateHTMLEditor(
|
||||||
editorApi,
|
editorApi,
|
||||||
scrollController: controller.scrollController,
|
onEnterKeyDown: controller.onEnterKeyDown,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
richTextMobileTabletController.listenHtmlEditorApi();
|
richTextMobileTabletController.listenHtmlEditorApi();
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class IdentityCreatorController extends BaseController {
|
|||||||
String? _contentHtmlEditor;
|
String? _contentHtmlEditor;
|
||||||
|
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
|
double currentPositionYHTMLEditor = 250;
|
||||||
|
|
||||||
void updateNameIdentity(BuildContext context, String? value) {
|
void updateNameIdentity(BuildContext context, String? value) {
|
||||||
_nameIdentity = value;
|
_nameIdentity = value;
|
||||||
@@ -403,4 +404,20 @@ class IdentityCreatorController extends BaseController {
|
|||||||
popBack();
|
popBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onFocusHTMLEditor() {
|
||||||
|
scrollController.animateTo(
|
||||||
|
currentPositionYHTMLEditor,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.linear,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void onEnterKeyDown() {
|
||||||
|
scrollController.animateTo(
|
||||||
|
currentPositionYHTMLEditor - keyboardRichTextController.currentLine * 20,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.linear,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -510,12 +510,13 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return html_editor_mobile.HtmlEditor(
|
return html_editor_mobile.HtmlEditor(
|
||||||
key: const Key('signature_html_editor_mobile'),
|
key:const Key('html_editor_mobile'),
|
||||||
minHeight: 230,
|
minHeight: 230,
|
||||||
onCreated: (htmlEditorController) {
|
onCreated: (htmlEditorController) {
|
||||||
controller.keyboardRichTextController.onCreateHTMLEditor(
|
controller.keyboardRichTextController.onCreateHTMLEditor(
|
||||||
htmlEditorController,
|
htmlEditorController,
|
||||||
scrollController:controller.scrollController,
|
onFocus: controller.onFocusHTMLEditor,
|
||||||
|
onEnterKeyDown: controller.onEnterKeyDown,
|
||||||
);
|
);
|
||||||
controller.signatureHtmlEditorMobileController = htmlEditorController;
|
controller.signatureHtmlEditorMobileController = htmlEditorController;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ class VacationController extends BaseController {
|
|||||||
|
|
||||||
late Worker vacationWorker;
|
late Worker vacationWorker;
|
||||||
|
|
||||||
|
final ScrollController scrollController = ScrollController();
|
||||||
|
double currentPositionYHTMLEditor = 660;
|
||||||
|
|
||||||
VacationController(
|
VacationController(
|
||||||
this._getAllVacationInteractor,
|
this._getAllVacationInteractor,
|
||||||
this._updateVacationInteractor,
|
this._updateVacationInteractor,
|
||||||
@@ -358,6 +361,22 @@ class VacationController extends BaseController {
|
|||||||
_settingController.backToUniversalSettings();
|
_settingController.backToUniversalSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onFocusHTMLEditor() {
|
||||||
|
scrollController.animateTo(
|
||||||
|
currentPositionYHTMLEditor,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.linear,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void onEnterKeyDown() {
|
||||||
|
scrollController.animateTo(
|
||||||
|
currentPositionYHTMLEditor + richTextControllerForMobile.currentLine * 20,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.linear,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
messageTextController.dispose();
|
messageTextController.dispose();
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
|||||||
: null,
|
: null,
|
||||||
padding: SettingsUtils.getMarginViewForSettingDetails(context, _responsiveUtils),
|
padding: SettingsUtils.getMarginViewForSettingDetails(context, _responsiveUtils),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
controller: controller.scrollController,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -472,7 +473,13 @@ class VacationView extends GetWidget<VacationController> with RichTextButtonMixi
|
|||||||
minHeight: 150,
|
minHeight: 150,
|
||||||
addDefaultSelectionMenuItems: false,
|
addDefaultSelectionMenuItems: false,
|
||||||
initialContent: controller.vacationMessageHtmlText ?? '',
|
initialContent: controller.vacationMessageHtmlText ?? '',
|
||||||
onCreated: controller.richTextControllerForMobile.onCreateHTMLEditor
|
onCreated: (htmlApi) {
|
||||||
|
controller.richTextControllerForMobile.onCreateHTMLEditor(
|
||||||
|
htmlApi,
|
||||||
|
onFocus: controller.onFocusHTMLEditor,
|
||||||
|
onEnterKeyDown: controller.onEnterKeyDown,
|
||||||
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ dependencies:
|
|||||||
rich_text_composer:
|
rich_text_composer:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/linagora/rich-text-composer.git
|
url: https://github.com/linagora/rich-text-composer.git
|
||||||
ref: apply_rich_text_bottom_sheet
|
ref: master
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
|||||||
Reference in New Issue
Block a user