mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Android: Try to fix can not set title
This commit is contained in:
@@ -92,7 +92,8 @@ class _GalleriesPage extends State<GalleriesPage> with ThemeModeWidget {
|
||||
],
|
||||
leadingIcon: const Icon(Icons.sort),
|
||||
);
|
||||
setCurrentTitle(AppLocalizations.of(context)!.galleries);
|
||||
setCurrentTitle(AppLocalizations.of(context)!.galleries,
|
||||
Theme.of(context).primaryColor.value);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
|
||||
@@ -69,7 +69,8 @@ class _GalleryPage extends State<GalleryPage> with ThemeModeWidget {
|
||||
: _data != null
|
||||
? _data!.meta.preferredTitle
|
||||
: i18n.gallery;
|
||||
setCurrentTitle(title, includePrefix: false);
|
||||
setCurrentTitle(title, Theme.of(context).primaryColor.value,
|
||||
includePrefix: false);
|
||||
return Scaffold(
|
||||
appBar: _data == null
|
||||
? AppBar(
|
||||
|
||||
@@ -287,7 +287,7 @@ String? _currentTitle;
|
||||
String? _prefix;
|
||||
final _titleLog = Logger("Title");
|
||||
|
||||
void setCurrentTitle(String title,
|
||||
void setCurrentTitle(String title, int primaryColor,
|
||||
{bool isPrefix = false,
|
||||
bool includePrefix = true,
|
||||
bool usePrefix = false}) {
|
||||
@@ -307,7 +307,7 @@ void setCurrentTitle(String title,
|
||||
});
|
||||
} else {
|
||||
SystemChrome.setApplicationSwitcherDescription(
|
||||
ApplicationSwitcherDescription(label: title))
|
||||
ApplicationSwitcherDescription(label: title, primaryColor: primaryColor))
|
||||
.then((_) {
|
||||
_currentTitle = title;
|
||||
if (isPrefix) _prefix = title;
|
||||
|
||||
@@ -17,7 +17,7 @@ class HomePage extends HookWidget {
|
||||
Widget build(BuildContext context) {
|
||||
tryInitApi(context);
|
||||
var mode = useState(MainApp.of(context).themeMode);
|
||||
setCurrentTitle("", usePrefix: true);
|
||||
setCurrentTitle("", Theme.of(context).primaryColor.value, usePrefix: true);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)!.titleBar),
|
||||
|
||||
@@ -169,7 +169,8 @@ class _MainApp extends State<MainApp> {
|
||||
routerConfig: _router,
|
||||
onGenerateTitle: (context) {
|
||||
final title = AppLocalizations.of(context)!.title;
|
||||
setCurrentTitle(title, isPrefix: true);
|
||||
setCurrentTitle(title, Theme.of(context).primaryColor.value,
|
||||
isPrefix: true);
|
||||
return title;
|
||||
},
|
||||
locale: _lang.toLocale(),
|
||||
|
||||
@@ -135,7 +135,8 @@ class _SettingsPage extends State<SettingsPage> with ThemeModeWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
setCurrentTitle(AppLocalizations.of(context)!.settings);
|
||||
setCurrentTitle(AppLocalizations.of(context)!.settings,
|
||||
Theme.of(context).primaryColor.value);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
|
||||
Reference in New Issue
Block a user