mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-11 00:00:05 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user