Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
flutter_boost_1.22.4
Commits
08671c5f
Commit
08671c5f
authored
Oct 17, 2019
by
yangwu.jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Null pointer fixed
parent
a5aeb476
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
android/src/main/java/com/idlefish/flutterboost/XFlutterView.java
...src/main/java/com/idlefish/flutterboost/XFlutterView.java
+14
-3
No files found.
android/src/main/java/com/idlefish/flutterboost/XFlutterView.java
View file @
08671c5f
...
@@ -259,8 +259,15 @@ public class XFlutterView extends FrameLayout {
...
@@ -259,8 +259,15 @@ public class XFlutterView extends FrameLayout {
protected
void
onConfigurationChanged
(
@NonNull
Configuration
newConfig
)
{
protected
void
onConfigurationChanged
(
@NonNull
Configuration
newConfig
)
{
super
.
onConfigurationChanged
(
newConfig
);
super
.
onConfigurationChanged
(
newConfig
);
Log
.
v
(
TAG
,
"Configuration changed. Sending locales and user settings to Flutter."
);
Log
.
v
(
TAG
,
"Configuration changed. Sending locales and user settings to Flutter."
);
sendLocalesToFlutter
(
newConfig
);
try
{
sendUserSettingsToFlutter
();
sendLocalesToFlutter
(
newConfig
);
sendUserSettingsToFlutter
();
}
catch
(
Throwable
e
){
Log
.
e
(
TAG
,
"onConfigurationChanged error "
);
}
}
}
/**
/**
...
@@ -760,7 +767,9 @@ public class XFlutterView extends FrameLayout {
...
@@ -760,7 +767,9 @@ public class XFlutterView extends FrameLayout {
}
else
{
}
else
{
locales
.
add
(
config
.
locale
);
locales
.
add
(
config
.
locale
);
}
}
flutterEngine
.
getLocalizationChannel
().
sendLocales
(
locales
);
if
(
flutterEngine
!=
null
&&
flutterEngine
.
getLocalizationChannel
()!=
null
){
flutterEngine
.
getLocalizationChannel
().
sendLocales
(
locales
);
}
}
}
/**
/**
...
@@ -772,10 +781,12 @@ public class XFlutterView extends FrameLayout {
...
@@ -772,10 +781,12 @@ public class XFlutterView extends FrameLayout {
* FlutterEngine must be non-null when this method is invoked.
* FlutterEngine must be non-null when this method is invoked.
*/
*/
private
void
sendUserSettingsToFlutter
()
{
private
void
sendUserSettingsToFlutter
()
{
if
(
flutterEngine
!=
null
&&
flutterEngine
.
getSettingsChannel
()!=
null
){
flutterEngine
.
getSettingsChannel
().
startMessage
()
flutterEngine
.
getSettingsChannel
().
startMessage
()
.
setTextScaleFactor
(
getResources
().
getConfiguration
().
fontScale
)
.
setTextScaleFactor
(
getResources
().
getConfiguration
().
fontScale
)
.
setUse24HourFormat
(
DateFormat
.
is24HourFormat
(
getContext
()))
.
setUse24HourFormat
(
DateFormat
.
is24HourFormat
(
getContext
()))
.
send
();
.
send
();
}
}
}
// TODO(mattcarroll): consider introducing a system channel for this communication instead of JNI
// TODO(mattcarroll): consider introducing a system channel for this communication instead of JNI
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment