Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Attributes | Package Functions | Package Attributes | List of all members
io.flutter.plugin.platform.PlatformPlugin Class Reference

Classes

interface  PlatformPluginDelegate
 

Public Member Functions

 PlatformPlugin (@NonNull Activity activity, @NonNull PlatformChannel platformChannel)
 
 PlatformPlugin ( @NonNull Activity activity, @NonNull PlatformChannel platformChannel, @Nullable PlatformPluginDelegate delegate)
 
void destroy ()
 
void updateSystemUiOverlays ()
 

Static Public Attributes

static final int DEFAULT_SYSTEM_UI
 

Package Functions

void vibrateHapticFeedback ( @NonNull PlatformChannel.HapticFeedbackType feedbackType)
 

Package Attributes

final PlatformChannel.PlatformMessageHandler mPlatformMessageHandler
 

Detailed Description

Android implementation of the platform plugin.

Definition at line 36 of file PlatformPlugin.java.

Constructor & Destructor Documentation

◆ PlatformPlugin() [1/2]

io.flutter.plugin.platform.PlatformPlugin.PlatformPlugin ( @NonNull Activity  activity,
@NonNull PlatformChannel  platformChannel 
)
inline

Definition at line 158 of file PlatformPlugin.java.

158 {
159 this(activity, platformChannel, null);
160 }

◆ PlatformPlugin() [2/2]

io.flutter.plugin.platform.PlatformPlugin.PlatformPlugin ( @NonNull Activity  activity,
@NonNull PlatformChannel  platformChannel,
@Nullable PlatformPluginDelegate  delegate 
)
inline

Definition at line 162 of file PlatformPlugin.java.

165 {
166 this.activity = activity;
167 this.platformChannel = platformChannel;
169 this.platformPluginDelegate = delegate;
170
171 mEnabledOverlays = DEFAULT_SYSTEM_UI;
172 }
void setPlatformMessageHandler(@Nullable PlatformMessageHandler platformMessageHandler)
final PlatformChannel.PlatformMessageHandler mPlatformMessageHandler

Member Function Documentation

◆ destroy()

void io.flutter.plugin.platform.PlatformPlugin.destroy ( )
inline

Releases all resources held by this PlatformPlugin.

Do not invoke any methods on a PlatformPlugin after invoking this method.

Definition at line 179 of file PlatformPlugin.java.

179 {
180 this.platformChannel.setPlatformMessageHandler(null);
181 }

◆ updateSystemUiOverlays()

void io.flutter.plugin.platform.PlatformPlugin.updateSystemUiOverlays ( )
inline

Refreshes Android's window system UI (AKA system chrome) to match Flutter's desired PlatformChannel.SystemChromeStyle.

Updating the system UI Overlays is accomplished by altering the decor view of the Window associated with the android.app.Activity that was provided to this
PlatformPlugin
.

Definition at line 372 of file PlatformPlugin.java.

372 {
373 activity.getWindow().getDecorView().setSystemUiVisibility(mEnabledOverlays);
374 if (currentTheme != null) {
375 setSystemChromeSystemUIOverlayStyle(currentTheme);
376 }
377 }

◆ vibrateHapticFeedback()

void io.flutter.plugin.platform.PlatformPlugin.vibrateHapticFeedback ( @NonNull PlatformChannel.HapticFeedbackType  feedbackType)
inlinepackage

Definition at line 191 of file PlatformPlugin.java.

192 {
193 View view = activity.getWindow().getDecorView();
194 switch (feedbackType) {
195 case STANDARD:
196 view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
197 break;
198 case LIGHT_IMPACT:
199 view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
200 break;
201 case MEDIUM_IMPACT:
202 view.performHapticFeedback(HapticFeedbackConstants.KEYBOARD_TAP);
203 break;
204 case HEAVY_IMPACT:
205 if (Build.VERSION.SDK_INT >= API_LEVELS.API_23) {
206 view.performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
207 }
208 break;
209 case SELECTION_CLICK:
210 view.performHapticFeedback(HapticFeedbackConstants.CLOCK_TICK);
211 break;
212 }
213 }
def Build(configs, env, options)
Definition: build.py:232

Member Data Documentation

◆ DEFAULT_SYSTEM_UI

final int io.flutter.plugin.platform.PlatformPlugin.DEFAULT_SYSTEM_UI
static
Initial value:
=
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

Definition at line 37 of file PlatformPlugin.java.

◆ mPlatformMessageHandler

final PlatformChannel.PlatformMessageHandler io.flutter.plugin.platform.PlatformPlugin.mPlatformMessageHandler
package

Definition at line 76 of file PlatformPlugin.java.


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