mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-09-11 19:17:43 +03:00
fix: android navigation bar issues (#5294)
This commit is contained in:
parent
a490f34a61
commit
f3b8ec8a04
@ -1,6 +1,7 @@
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/application/base/mobile_view_page_bloc.dart';
|
||||
import 'package:appflowy/mobile/application/page_style/document_page_style_bloc.dart';
|
||||
import 'package:appflowy/mobile/presentation/base/app_bar/app_bar.dart';
|
||||
import 'package:appflowy/mobile/presentation/base/view_page/app_bar_buttons.dart';
|
||||
import 'package:appflowy/mobile/presentation/widgets/flowy_mobile_state_container.dart';
|
||||
import 'package:appflowy/plugins/base/emoji/emoji_text.dart';
|
||||
@ -103,19 +104,21 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
||||
ViewPB? view,
|
||||
Widget child,
|
||||
) {
|
||||
final isImmersiveMode = view?.layout.isDocumentView ?? false;
|
||||
final isDocument = view?.layout.isDocumentView ?? false;
|
||||
final title = _buildTitle(context, view);
|
||||
final appBar = MobileViewPageImmersiveAppBar(
|
||||
preferredSize: Size(
|
||||
double.infinity,
|
||||
AppBarTheme.of(context).toolbarHeight ?? kToolbarHeight,
|
||||
),
|
||||
title: title,
|
||||
isImmersiveMode: isImmersiveMode,
|
||||
appBarOpacity: _appBarOpacity,
|
||||
actions: _buildAppBarActions(context, view),
|
||||
);
|
||||
final body = isImmersiveMode
|
||||
final actions = _buildAppBarActions(context, view);
|
||||
final appBar = isDocument
|
||||
? MobileViewPageImmersiveAppBar(
|
||||
preferredSize: Size(
|
||||
double.infinity,
|
||||
AppBarTheme.of(context).toolbarHeight ?? kToolbarHeight,
|
||||
),
|
||||
title: title,
|
||||
appBarOpacity: _appBarOpacity,
|
||||
actions: actions,
|
||||
)
|
||||
: FlowyAppBar(title: title, actions: actions);
|
||||
final body = isDocument
|
||||
? Builder(
|
||||
builder: (context) {
|
||||
_rebuildScrollNotificationObserver(context);
|
||||
@ -124,7 +127,7 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
||||
)
|
||||
: child;
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: isImmersiveMode,
|
||||
extendBodyBehindAppBar: isDocument,
|
||||
appBar: appBar,
|
||||
body: body,
|
||||
);
|
||||
@ -190,12 +193,12 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
||||
),
|
||||
const HSpace(16.0),
|
||||
DocumentSyncIndicator(view: view),
|
||||
const HSpace(8.0),
|
||||
const HSpace(12.0),
|
||||
]);
|
||||
} else {
|
||||
actions.addAll([
|
||||
DatabaseSyncIndicator(view: view),
|
||||
const HSpace(8.0),
|
||||
const HSpace(12.0),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:appflowy/generated/flowy_svgs.g.dart';
|
||||
import 'package:appflowy/generated/locale_keys.g.dart';
|
||||
import 'package:appflowy/mobile/application/base/mobile_view_page_bloc.dart';
|
||||
import 'package:appflowy/mobile/application/page_style/document_page_style_bloc.dart';
|
||||
import 'package:appflowy/mobile/presentation/base/app_bar/app_bar.dart';
|
||||
import 'package:appflowy/mobile/presentation/base/app_bar/app_bar_actions.dart';
|
||||
@ -21,13 +22,11 @@ class MobileViewPageImmersiveAppBar extends StatelessWidget
|
||||
const MobileViewPageImmersiveAppBar({
|
||||
super.key,
|
||||
required this.preferredSize,
|
||||
required this.isImmersiveMode,
|
||||
required this.appBarOpacity,
|
||||
required this.title,
|
||||
required this.actions,
|
||||
});
|
||||
|
||||
final bool isImmersiveMode;
|
||||
final ValueListenable appBarOpacity;
|
||||
final Widget title;
|
||||
final List<Widget> actions;
|
||||
@ -37,13 +36,6 @@ class MobileViewPageImmersiveAppBar extends StatelessWidget
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!isImmersiveMode) {
|
||||
FlowyAppBar(
|
||||
title: title,
|
||||
actions: actions,
|
||||
);
|
||||
}
|
||||
|
||||
return ValueListenableBuilder(
|
||||
valueListenable: appBarOpacity,
|
||||
builder: (_, opacity, __) => FlowyAppBar(
|
||||
@ -68,7 +60,8 @@ class MobileViewPageImmersiveAppBar extends StatelessWidget
|
||||
icon: FlowySvgs.m_app_bar_back_s,
|
||||
dimension: 30.0,
|
||||
iconPadding: 6.0,
|
||||
isImmersiveMode: isImmersiveMode,
|
||||
isImmersiveMode:
|
||||
context.read<MobileViewPageBloc>().state.isImmersiveMode,
|
||||
appBarOpacity: appBarOpacity,
|
||||
),
|
||||
);
|
||||
|
@ -162,9 +162,12 @@ class _DocumentImmersiveCoverState extends State<DocumentImmersiveCover> {
|
||||
|
||||
Widget _buildIcon(BuildContext context, String icon) {
|
||||
return GestureDetector(
|
||||
child: EmojiIconWidget(
|
||||
emoji: icon,
|
||||
emojiSize: 26,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints.tightFor(width: 34.0),
|
||||
child: EmojiIconWidget(
|
||||
emoji: icon,
|
||||
emojiSize: 26,
|
||||
),
|
||||
),
|
||||
onTap: () async {
|
||||
final result = await context.push<EmojiPickerResult>(
|
||||
|
Loading…
Reference in New Issue
Block a user