@capawesome/capacitor-android-edge-to-edge-support 8.0.1 → 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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Capacitor Plugin ProGuard Rules
|
|
2
|
+
# These rules ensure the plugin works correctly when the consumer app uses minification
|
|
3
|
+
|
|
4
|
+
# Keep all plugin classes
|
|
5
|
+
-keep class io.capawesome.capacitorjs.plugins.androidedgetoedgesupport.** { *; }
|
|
6
|
+
|
|
7
|
+
# Keep Capacitor annotations (needed for reflection-based plugin loading)
|
|
8
|
+
-keep @com.getcapacitor.annotation.CapacitorPlugin class * { *; }
|
|
9
|
+
-keep @com.getcapacitor.PluginMethod class * { *; }
|
|
10
|
+
-keepclassmembers class * {
|
|
11
|
+
@com.getcapacitor.PluginMethod *;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
# Keep CoordinatorLayout.LayoutParams (used via reflection in EdgeToEdge.java)
|
|
15
|
+
-keep class androidx.coordinatorlayout.widget.CoordinatorLayout$LayoutParams { *; }
|
|
16
|
+
|
|
17
|
+
# Keep AndroidX classes used by the plugin
|
|
18
|
+
-keep class androidx.core.view.ViewCompat { *; }
|
|
19
|
+
-keep class androidx.core.view.WindowInsetsCompat { *; }
|
|
20
|
+
-keep class androidx.core.view.WindowInsetsCompat$Type { *; }
|
|
21
|
+
-keep class androidx.core.graphics.Insets { *; }
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capawesome/capacitor-android-edge-to-edge-support",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
4
4
|
"description": "Capacitor plugin to support edge-to-edge display on Android.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"android/src/main/",
|
|
11
11
|
"android/build.gradle",
|
|
12
|
+
"android/consumer-rules.pro",
|
|
12
13
|
"dist/"
|
|
13
14
|
],
|
|
14
15
|
"author": "Robin Genz <mail@robingenz.dev>",
|