Flutter Engine
The Flutter Engine
Public Member Functions | Package Functions | Package Attributes | List of all members
io.flutter.plugin.platform.SingleViewWindowManager Class Referenceabstract
Inheritance diagram for io.flutter.plugin.platform.SingleViewWindowManager:
io.flutter.plugin.platform.WindowManagerHandler

Public Member Functions

Display getDefaultDisplay ()
 
void removeViewImmediate (View view)
 
void addView (View view, ViewGroup.LayoutParams params)
 
void updateViewLayout (View view, ViewGroup.LayoutParams params)
 
void removeView (View view)
 
WindowMetrics getCurrentWindowMetrics ()
 
WindowMetrics getMaximumWindowMetrics ()
 
boolean isCrossWindowBlurEnabled ()
 
void addCrossWindowBlurEnabledListener (@NonNull Consumer< Boolean > listener)
 
void addCrossWindowBlurEnabledListener ( @NonNull Executor executor, @NonNull Consumer< Boolean > listener)
 
void removeCrossWindowBlurEnabledListener (@NonNull Consumer< Boolean > listener)
 

Package Functions

 SingleViewWindowManager (WindowManager delegate, SingleViewFakeWindowViewGroup fakeWindowViewGroup)
 

Package Attributes

final WindowManager delegate
 
SingleViewFakeWindowViewGroup fakeWindowRootView
 

Detailed Description

A static proxy handler for a WindowManager with custom overrides.

The presentation's window manager delegates all calls to the default window manager. WindowManager::addView calls triggered by views that are attached to the virtual display are crashing (see: https://github.com/flutter/flutter/issues/20714). This was triggered when selecting text in an embedded WebView (as the selection handles are implemented as popup windows).

This static proxy overrides the addView, removeView, removeViewImmediate, and updateViewLayout methods to prevent these crashes, and forwards all other calls to the delegate.

This is an abstract class because some clients of Flutter compile the Android embedding with the Android System SDK, which has additional abstract methods that need to be overriden.

Definition at line 35 of file SingleViewWindowManager.java.

Constructor & Destructor Documentation

◆ SingleViewWindowManager()

io.flutter.plugin.platform.SingleViewWindowManager.SingleViewWindowManager ( WindowManager  delegate,
SingleViewFakeWindowViewGroup  fakeWindowViewGroup 
)
inlinepackage

Definition at line 41 of file SingleViewWindowManager.java.

42 {
43 this.delegate = delegate;
44 fakeWindowRootView = fakeWindowViewGroup;
45 }

Member Function Documentation

◆ addCrossWindowBlurEnabledListener() [1/2]

void io.flutter.plugin.platform.SingleViewWindowManager.addCrossWindowBlurEnabledListener ( @NonNull Executor  executor,
@NonNull Consumer< Boolean >  listener 
)
inline

Definition at line 118 of file SingleViewWindowManager.java.

119 {
120 delegate.addCrossWindowBlurEnabledListener(executor, listener);
121 }

◆ addCrossWindowBlurEnabledListener() [2/2]

void io.flutter.plugin.platform.SingleViewWindowManager.addCrossWindowBlurEnabledListener ( @NonNull Consumer< Boolean >  listener)
inline

Definition at line 112 of file SingleViewWindowManager.java.

112 {
113 delegate.addCrossWindowBlurEnabledListener(listener);
114 }

◆ addView()

void io.flutter.plugin.platform.SingleViewWindowManager.addView ( View  view,
ViewGroup.LayoutParams  params 
)
inline

Definition at line 64 of file SingleViewWindowManager.java.

64 {
65 if (fakeWindowRootView == null) {
66 Log.w(TAG, "Embedded view called addView while detached from presentation");
67 return;
68 }
69 fakeWindowRootView.addView(view, params);
70 }
const EmbeddedViewParams * params
void Log(const char *format,...) SK_PRINTF_LIKE(1
Definition: TestRunner.cpp:137

◆ getCurrentWindowMetrics()

WindowMetrics io.flutter.plugin.platform.SingleViewWindowManager.getCurrentWindowMetrics ( )
inline

Definition at line 93 of file SingleViewWindowManager.java.

93 {
94 return delegate.getCurrentWindowMetrics();
95 }

◆ getDefaultDisplay()

Display io.flutter.plugin.platform.SingleViewWindowManager.getDefaultDisplay ( )
inline

Definition at line 49 of file SingleViewWindowManager.java.

49 {
50 return delegate.getDefaultDisplay();
51 }

◆ getMaximumWindowMetrics()

WindowMetrics io.flutter.plugin.platform.SingleViewWindowManager.getMaximumWindowMetrics ( )
inline

Definition at line 100 of file SingleViewWindowManager.java.

100 {
101 return delegate.getMaximumWindowMetrics();
102 }

◆ isCrossWindowBlurEnabled()

boolean io.flutter.plugin.platform.SingleViewWindowManager.isCrossWindowBlurEnabled ( )
inline

Definition at line 106 of file SingleViewWindowManager.java.

106 {
107 return delegate.isCrossWindowBlurEnabled();
108 }

◆ removeCrossWindowBlurEnabledListener()

void io.flutter.plugin.platform.SingleViewWindowManager.removeCrossWindowBlurEnabledListener ( @NonNull Consumer< Boolean >  listener)
inline

Definition at line 125 of file SingleViewWindowManager.java.

125 {
126 delegate.removeCrossWindowBlurEnabledListener(listener);
127 }

◆ removeView()

void io.flutter.plugin.platform.SingleViewWindowManager.removeView ( View  view)
inline

Definition at line 82 of file SingleViewWindowManager.java.

82 {
83 if (fakeWindowRootView == null) {
84 Log.w(TAG, "Embedded view called removeView while detached from presentation");
85 return;
86 }
87 fakeWindowRootView.removeView(view);
88 }

◆ removeViewImmediate()

void io.flutter.plugin.platform.SingleViewWindowManager.removeViewImmediate ( View  view)
inline

Definition at line 54 of file SingleViewWindowManager.java.

54 {
55 if (fakeWindowRootView == null) {
56 Log.w(TAG, "Embedded view called removeViewImmediate while detached from presentation");
57 return;
58 }
59 view.clearAnimation();
60 fakeWindowRootView.removeView(view);
61 }

◆ updateViewLayout()

void io.flutter.plugin.platform.SingleViewWindowManager.updateViewLayout ( View  view,
ViewGroup.LayoutParams  params 
)
inline

Definition at line 73 of file SingleViewWindowManager.java.

73 {
74 if (fakeWindowRootView == null) {
75 Log.w(TAG, "Embedded view called updateViewLayout while detached from presentation");
76 return;
77 }
78 fakeWindowRootView.updateViewLayout(view, params);
79 }

Member Data Documentation

◆ delegate

final WindowManager io.flutter.plugin.platform.SingleViewWindowManager.delegate
package

Definition at line 38 of file SingleViewWindowManager.java.

◆ fakeWindowRootView

SingleViewFakeWindowViewGroup io.flutter.plugin.platform.SingleViewWindowManager.fakeWindowRootView
package

Definition at line 39 of file SingleViewWindowManager.java.


The documentation for this class was generated from the following file: