Skip to content
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.webkit.WebChromeClient;
import com.foxdebug.system.Ui;
import org.json.JSONObject;
import android.os.Bundle;
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated

public class BrowserActivity extends Activity {

Expand All @@ -37,6 +38,19 @@ public void onCreate(Bundle savedInstanceState) {
browser = new Browser(this, theme, onlyConsole);
browser.setUrl(url);
setContentView(browser);

if (Build.VERSION.SDK_INT >= 30) {
getWindow().setDecorFitsSystemWindows(false);
}

browser.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
v.setPadding(insets.getSystemWindowInsetLeft(), insets.getSystemWindowInsetTop(), insets.getSystemWindowInsetRight(), insets.getSystemWindowInsetBottom());
return insets.consumeSystemWindowInsets();
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated
}
});
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated

setSystemTheme(theme.get("primaryColor"));
}

Expand All @@ -62,12 +76,12 @@ private void setSystemTheme(int systemBarColor) {
window
.getClass()
.getMethod("setNavigationBarColor", int.class)
.invoke(window, systemBarColor);
.invoke(window, Color.TRANSPARENT);

window
.getClass()
.getMethod("setStatusBarColor", int.class)
.invoke(window, systemBarColor);
.invoke(window, Color.TRANSPARENT);

if (Build.VERSION.SDK_INT < 30) {
setStatusBarStyle(window);
Expand Down