@capawesome/capacitor-android-edge-to-edge-support 8.0.2 → 8.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -28,19 +28,27 @@ public class EdgeToEdge {
|
|
|
28
28
|
@Nullable
|
|
29
29
|
private View statusBarOverlay;
|
|
30
30
|
|
|
31
|
+
private int currentNavigationBarColor;
|
|
32
|
+
|
|
33
|
+
private int currentStatusBarColor;
|
|
34
|
+
|
|
31
35
|
public EdgeToEdge(@NonNull EdgeToEdgePlugin plugin, @NonNull EdgeToEdgeConfig config) {
|
|
32
36
|
this.config = config;
|
|
33
37
|
this.plugin = plugin;
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Apply insets to enable the edge-to-edge feature
|
|
40
|
-
applyInsets();
|
|
38
|
+
// Store initial colors from config
|
|
39
|
+
this.currentStatusBarColor = config.getStatusBarColor();
|
|
40
|
+
this.currentNavigationBarColor = config.getNavigationBarColor();
|
|
41
|
+
// Enable edge-to-edge
|
|
42
|
+
enable();
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
public void enable() {
|
|
46
|
+
// Create color overlays if they don't exist
|
|
47
|
+
createColorOverlays();
|
|
48
|
+
// Restore previously set colors
|
|
49
|
+
setStatusBarColor(currentStatusBarColor);
|
|
50
|
+
setNavigationBarColor(currentNavigationBarColor);
|
|
51
|
+
// Apply insets
|
|
44
52
|
applyInsets();
|
|
45
53
|
}
|
|
46
54
|
|
|
@@ -169,12 +177,14 @@ public class EdgeToEdge {
|
|
|
169
177
|
}
|
|
170
178
|
|
|
171
179
|
private void setNavigationBarColor(int color) {
|
|
180
|
+
this.currentNavigationBarColor = color;
|
|
172
181
|
if (navigationBarOverlay != null) {
|
|
173
182
|
navigationBarOverlay.setBackgroundColor(color);
|
|
174
183
|
}
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
private void setStatusBarColor(int color) {
|
|
187
|
+
this.currentStatusBarColor = color;
|
|
178
188
|
if (statusBarOverlay != null) {
|
|
179
189
|
statusBarOverlay.setBackgroundColor(color);
|
|
180
190
|
}
|
package/package.json
CHANGED