@protobase/mobile 0.94.10 → 0.94.12

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,28 @@
1
+ package net.protobase.mobile;
2
+
3
+ import android.content.res.Configuration;
4
+ import com.getcapacitor.Plugin;
5
+ import com.getcapacitor.annotation.CapacitorPlugin;
6
+
7
+ /**
8
+ * The page's text at the phone's text size: the WebView zooms text by 100% whatever the system's font size, so the
9
+ * shell sets its text zoom to the system's font scale when it loads and when the scale changes.
10
+ */
11
+ @CapacitorPlugin(name = "ProtobaseTextSize")
12
+ public class ProtobaseTextSize extends Plugin {
13
+
14
+ @Override
15
+ public void load() {
16
+ apply(getContext().getResources().getConfiguration());
17
+ }
18
+
19
+ @Override
20
+ protected void handleOnConfigurationChanged(Configuration newConfig) {
21
+ apply(newConfig);
22
+ }
23
+
24
+ private void apply(Configuration config) {
25
+ int percent = Math.round(config.fontScale * 100);
26
+ getBridge().executeOnMainThread(() -> getBridge().getWebView().getSettings().setTextZoom(percent));
27
+ }
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/mobile",
3
- "version": "0.94.10",
3
+ "version": "0.94.12",
4
4
  "description": "The Capacitor that protobase mobile builds a Protobase app's iOS and Android projects with, at fixed versions, and the native plugins that keep page script away from the session and give the iOS app its bounce; installed by the CLI on first use.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "android/build.gradle",
23
23
  "icon"
24
24
  ],
25
- "nativeContract": 10,
25
+ "nativeContract": 11,
26
26
  "capacitor": {
27
27
  "ios": {
28
28
  "src": "ios"