chore: simplify edge-to-edge preference logic in CordovaActivity and SystemBarPlugin (#1902)

- Remove the limitation for Android version <15 when preference AndroidEdgeToEdge is true.
- The motivation and context was described here: apache/cordova-discuss#114
- When having cordova android in Edge To Edge the app does not extend to the full height of the device in version bellow Android 15. This change allows the app to behave the same way it was possible to do with the statusbar plugin preference StatusBarOverlaysWebView given that this stopped having any effect in cordova-android 15.
This commit is contained in:
seamlink-aalves
2026-04-20 17:00:47 +01:00
committed by GitHub
parent 7b33c5dd64
commit 190076ba18
2 changed files with 2 additions and 4 deletions
@@ -121,8 +121,7 @@ public class CordovaActivity extends AppCompatActivity {
// need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception
loadConfig();
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM;
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false);
String logLevel = preferences.getString("loglevel", "ERROR");
LOG.setLogLevel(logLevel);
@@ -55,8 +55,7 @@ public class SystemBarPlugin extends CordovaPlugin {
protected void pluginInitialize() {
context = cordova.getContext();
resources = context.getResources();
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM;
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false);
}
@Override