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
0
Merge Requests
0
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
eb70610b
Commit
eb70610b
authored
Apr 07, 2020
by
justin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into v1.12.13-hotfixes
parents
9c0fda37
1e5631a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
12 deletions
+64
-12
android/src/main/java/com/idlefish/flutterboost/FlutterViewContainerManager.java
...om/idlefish/flutterboost/FlutterViewContainerManager.java
+1
-1
android/src/main/java/com/idlefish/flutterboost/containers/FlutterActivityAndFragmentDelegate.java
...rboost/containers/FlutterActivityAndFragmentDelegate.java
+4
-1
android/src/main/java/com/idlefish/flutterboost/containers/FlutterFragment.java
...com/idlefish/flutterboost/containers/FlutterFragment.java
+3
-9
example/android/app/src/main/java/com/taobao/idlefish/flutterboostexample/FitSystemWindowFrameLayout.java
...efish/flutterboostexample/FitSystemWindowFrameLayout.java
+55
-0
example/android/app/src/main/res/layout/flutter_fragment_page.xml
...android/app/src/main/res/layout/flutter_fragment_page.xml
+1
-1
No files found.
android/src/main/java/com/idlefish/flutterboost/FlutterViewContainerManager.java
View file @
eb70610b
...
@@ -133,7 +133,7 @@ public class FlutterViewContainerManager implements IContainerManager {
...
@@ -133,7 +133,7 @@ public class FlutterViewContainerManager implements IContainerManager {
urlParams
.
put
(
IContainerRecord
.
UNIQ_KEY
,
uniqueId
);
urlParams
.
put
(
IContainerRecord
.
UNIQ_KEY
,
uniqueId
);
IContainerRecord
currentTopRecord
=
getCurrentTopRecord
();
IContainerRecord
currentTopRecord
=
getCurrentTopRecord
();
if
(
onResult
!=
null
)
{
if
(
onResult
!=
null
&&
currentTopRecord
!=
null
)
{
mOnResults
.
put
(
currentTopRecord
.
uniqueId
(),
onResult
);
mOnResults
.
put
(
currentTopRecord
.
uniqueId
(),
onResult
);
}
}
...
...
android/src/main/java/com/idlefish/flutterboost/containers/FlutterActivityAndFragmentDelegate.java
View file @
eb70610b
...
@@ -127,12 +127,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
...
@@ -127,12 +127,15 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
@NonNull
@NonNull
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
Log
.
v
(
TAG
,
"Creating FlutterView."
);
Log
.
v
(
TAG
,
"Creating FlutterView."
);
flutterEngine
.
getActivityControlSurface
().
attachToActivity
(
flutterEngine
.
getActivityControlSurface
().
attachToActivity
(
host
.
getActivity
(),
host
.
getActivity
(),
host
.
getLifecycle
()
host
.
getLifecycle
()
);
);
mSyncer
=
FlutterBoost
.
instance
().
containerManager
().
generateSyncer
(
this
);
mSyncer
=
FlutterBoost
.
instance
().
containerManager
().
generateSyncer
(
this
);
ensureAlive
();
ensureAlive
();
...
@@ -188,7 +191,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
...
@@ -188,7 +191,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
public
void
onPostResume
()
{
public
void
onPostResume
()
{
Log
.
v
(
TAG
,
"onPostResume()"
);
Log
.
v
(
TAG
,
"onPostResume()"
);
ensureAlive
();
ensureAlive
();
Utils
.
setStatusBarLightMode
(
host
.
getActivity
(),
true
);
//
Utils.setStatusBarLightMode(host.getActivity(), true);
}
}
...
...
android/src/main/java/com/idlefish/flutterboost/containers/FlutterFragment.java
View file @
eb70610b
...
@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment;
...
@@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment;
import
androidx.fragment.app.FragmentActivity
;
import
androidx.fragment.app.FragmentActivity
;
import
com.idlefish.flutterboost.FlutterBoost
;
import
com.idlefish.flutterboost.FlutterBoost
;
import
com.idlefish.flutterboost.Utils
;
import
com.idlefish.flutterboost.XFlutterView
;
import
com.idlefish.flutterboost.XFlutterView
;
import
io.flutter.embedding.android.*
;
import
io.flutter.embedding.android.*
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.embedding.engine.FlutterEngine
;
...
@@ -252,17 +253,9 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
...
@@ -252,17 +253,9 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
@Nullable
@Nullable
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
configureStatusBarForFullscreenFlutterExperience
();
return
delegate
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
return
delegate
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
}
}
private
void
configureStatusBarForFullscreenFlutterExperience
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
this
.
getActivity
().
getWindow
();
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
window
.
getDecorView
().
setSystemUiVisibility
(
PlatformPlugin
.
DEFAULT_SYSTEM_UI
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
}
}
@Override
@Override
public
void
onStart
()
{
public
void
onStart
()
{
...
@@ -278,6 +271,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
...
@@ -278,6 +271,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
if
(!
isHidden
())
{
if
(!
isHidden
())
{
delegate
.
onResume
();
delegate
.
onResume
();
}
}
}
}
// TODO(mattcarroll): determine why this can't be in onResume(). Comment reason, or move if possible.
// TODO(mattcarroll): determine why this can't be in onResume(). Comment reason, or move if possible.
...
...
example/android/app/src/main/java/com/taobao/idlefish/flutterboostexample/FitSystemWindowFrameLayout.java
0 → 100644
View file @
eb70610b
package
com.taobao.idlefish.flutterboostexample
;
import
android.annotation.TargetApi
;
import
android.content.Context
;
import
android.os.Build
;
import
androidx.annotation.NonNull
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.WindowInsets
;
import
android.widget.FrameLayout
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.RequiresApi
;
import
androidx.core.view.ViewCompat
;
public
class
FitSystemWindowFrameLayout
extends
FrameLayout
{
public
FitSystemWindowFrameLayout
(
@NonNull
Context
context
)
{
super
(
context
);
}
public
FitSystemWindowFrameLayout
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
FitSystemWindowFrameLayout
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
LOLLIPOP
)
public
FitSystemWindowFrameLayout
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
@Override
public
WindowInsets
dispatchApplyWindowInsets
(
WindowInsets
insets
)
{
WindowInsets
result
=
super
.
dispatchApplyWindowInsets
(
insets
);
if
(!
insets
.
isConsumed
())
{
final
int
count
=
getChildCount
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
result
=
getChildAt
(
i
).
dispatchApplyWindowInsets
(
insets
);
}
return
result
;
}
@Override
public
void
addView
(
View
child
,
int
index
,
ViewGroup
.
LayoutParams
params
)
{
super
.
addView
(
child
,
index
,
params
);
ViewCompat
.
requestApplyInsets
(
child
);
}
}
example/android/app/src/main/res/layout/flutter_fragment_page.xml
View file @
eb70610b
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
android:orientation=
"vertical"
android:orientation=
"vertical"
android:background=
"@android:color/white"
>
android:background=
"@android:color/white"
>
<FrameLayout
<
com.taobao.idlefish.flutterboostexample.FitSystemWindow
FrameLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
...
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