Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions shell/platform/android/io/flutter/view/FlutterView.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.content.pm.ApplicationInfo;
import android.content.res.Configuration;
import android.database.ContentObserver;
import android.graphics.PixelFormat;
import android.provider.Settings;
import android.net.Uri;
import android.os.Handler;
Expand Down Expand Up @@ -276,6 +277,26 @@ public void removeFirstFrameListener(FirstFrameListener listener) {
mFirstFrameListeners.remove(listener);
}

/**
* Updates this to support rendering as a transparent {@link SurfaceView}.
*
* Sets it on top of its window. The background color still needs to be
* controlled from within the Flutter UI itself.
*/
public void enableTransparentBackground() {
setZOrderOnTop(true);
getHolder().setFormat(PixelFormat.TRANSPARENT);
}

/**
* Reverts this back to the {@link SurfaceView} defaults, at the back of its
* window and opaque.
*/
public void disableTransparentBackground() {
setZOrderOnTop(false);
getHolder().setFormat(PixelFormat.OPAQUE);
}

public void setInitialRoute(String route) {
mFlutterNavigationChannel.invokeMethod("setInitialRoute", route);
}
Expand Down